From nobody Sat Oct 31 23:59:51 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jHFMC6j8Jz6xdTn for ; Sat, 31 Oct 2026 23:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jHFMC4vnYz3JqY for ; Sat, 31 Oct 2026 23:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793491191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UP91OqLMU1xUhsQC+SbfN36zH35Jg9nilUTDKC44Tt0=; b=mx3ZudlKVQs/JRmEBEcCOCBOBE4O1yF8i0O3SkG0XRtE7K8Bbo5MkW8rHGnRkJ5/B2uUOM nVwc533huYpE+AwwAZ5ZxyPSLXPgUYqbp6xVXW5WI8dyp5KMT6lnS4CHMGmNKroua4tU1O ZGoSEoQixc5cnMWJjwAu2lsq/0t4Q5ap+b8/Vj/Wx/f/ewMaJ29sFQP93Azc/nWGoIdQkr bdPM/3VPVDuxBh1SXS5DZHYGmEnuv51wOo5Ztwb3yRWmF5OrqM9D+ZpjZbDiEUOHIKOCRF xgxLsYpMwXpiyJC9XPe7y//fvtKUwa2qeseUOuaASwJrSTtXUsaP69Os3mNlKg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793491191; b=M7IY+eHMPK6K6vZxC0vYsDDrvFK06Fz9ia/3GOSliwf+P0mneFkXa+kZ7r07zMYVvMAq6v 3MDLQcAlyuKOH327+EcidYC12QwxIWwNGEbOv529tHlUyEaK7TM+Ik0G1sbmBOo+ILZ3c5 Ke31lqNdYwoh4yO4Hn7CmgFy5xSx4H1b6Ih7ZNK1s71E0IbpV2V2GDfUni/pB/O7+FDiDp 8QksiN8s5L5AmBAFpAdt6ZGpqM9s0v6jamWPVhwe3o2BRueZclgzb8AjxV7dHs7BBWOBql xZuhax8LeQO1MMk8uZ7aj5/hripy7Pibd+mJlkX/nqEfgozuMPzdzjN6b3ygFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793491191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UP91OqLMU1xUhsQC+SbfN36zH35Jg9nilUTDKC44Tt0=; b=AJFuoEWOVacyaZisFGmGO9icCiwbM3n7+NHLQiqANhmI45bddtx5+6kuLVRm3xfNjasAVZ owwIeO7nKD8m49xHoXrB+7X23yQZsYwEZ+bvUza8iE7AMO53YMOQEVjbWm/5lMHotw5N6r MqV7mPRwOUFMsv0R7P+Uv6aaKz5xGFs0JsUsHdhiY0eT6+MVkKr0J5VGSgx8/LuWX8Jy2+ 0k/K0N1lyoWdL47hys0nEq+axTyhg+EdhTI4hyDRzSeyGWA6LedvNi9yvSVLrMIIsW1978 PI+5ntSfjh7ROs/qz3kjF269J/5TFhSO4JKu8T9FU7u8H27rG519gVAnfbGCRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jHFMC45XzzbWw for ; Sat, 31 Oct 2026 23:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18af2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 31 Oct 2026 23:59:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: a50d83ef83d7 - main - ice: Roll back Tx queues after scheduler setup failures List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a50d83ef83d716d5e5e7f727c366561dd1b79d00 Auto-Submitted: auto-generated Date: Sat, 31 Oct 2026 23:59:51 +0000 Message-Id: <6ae680f7.18af2.53ba83ec@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=a50d83ef83d716d5e5e7f727c366561dd1b79d00 commit a50d83ef83d716d5e5e7f727c366561dd1b79d00 Author: Kevin Bowling AuthorDate: 2026-10-31 23:55:31 +0000 Commit: Kevin Bowling CommitDate: 2026-10-31 23:59:46 +0000 ice: Roll back Tx queues after scheduler setup failures Add Tx LAN Queues commits the PQM queue and PSM leaf before returning success. ice_ena_vsi_txq() can subsequently fail to create the software scheduler node or replay its saved bandwidth configuration. Returning at that point leaves an allocated queue that the caller does not record. Later queue setup can fail until a function or PF reset removes it. Issue Disable Tx LAN Queues directly from the completed Add response before returning a post-add error. Keep the rollback buffer on the stack so the allocation failure being recovered cannot also prevent cleanup. Remove any software node and invalidate its queue context only after firmware accepts the disable. Preserve the queue context and any software node when rollback fails so active hardware state is not hidden. This follows the Add and Disable command lifecycle documented in the Intel E810 Datasheet, document 613875-003, section 10.5.5.8. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58907 --- sys/dev/ice/ice_common.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/sys/dev/ice/ice_common.c b/sys/dev/ice/ice_common.c index b895f661bc46..caf5a48e11e9 100644 --- a/sys/dev/ice/ice_common.c +++ b/sys/dev/ice/ice_common.c @@ -5369,6 +5369,44 @@ ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle) return &q_ctx[q_handle]; } +/** + * ice_rollback_vsi_txq - undo a successfully added LAN Tx queue + * @pi: port information structure + * @q_ctx: software queue context + * @buf: completed Add Tx LAN Queues command buffer + * + * This function needs to be called with the scheduler lock held. + */ +static int +ice_rollback_vsi_txq(struct ice_port_info *pi, struct ice_q_ctx *q_ctx, + struct ice_aqc_add_tx_qgrp *buf) +{ + /* An allocation failure after the Add command must not prevent cleanup. */ + u8 qg_buf[sizeof(struct ice_aqc_dis_txq_item) + sizeof(__le16)] = { 0 }; + struct ice_aqc_dis_txq_item *qg_list; + struct ice_sched_node *node; + struct ice_hw *hw = pi->hw; + int status; + + qg_list = (struct ice_aqc_dis_txq_item *)qg_buf; + qg_list->parent_teid = buf->parent_teid; + qg_list->num_qs = 1; + qg_list->q_id[0] = buf->txqs[0].txq_id; + + status = ice_aq_dis_lan_txq(hw, 1, qg_list, sizeof(qg_buf), + ICE_NO_RESET, 0, NULL); + if (status) + return status; + + node = ice_sched_find_node_by_teid(pi->root, + LE32_TO_CPU(buf->txqs[0].q_teid)); + if (node) + ice_free_sched_node(pi, node); + q_ctx->q_handle = ICE_INVAL_Q_HANDLE; + q_ctx->q_teid = 0; + return 0; +} + /** * ice_ena_vsi_txq * @pi: port information structure @@ -5391,6 +5429,7 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle, struct ice_sched_node *parent; struct ice_q_ctx *q_ctx; struct ice_hw *hw; + int rollback_status; int status; if (!pi || pi->port_state != ICE_SCHED_PORT_STATE_READY) @@ -5466,6 +5505,19 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle, status = ice_sched_add_node(pi, hw->num_tx_sched_layers - 1, &node, NULL); if (!status) status = ice_sched_replay_q_bw(pi, q_ctx); + if (status) { + ice_debug(hw, ICE_DBG_SCHED, + "Queue %d post-add setup failed, error %d\n", + LE16_TO_CPU(buf->txqs[0].txq_id), status); + rollback_status = ice_rollback_vsi_txq(pi, q_ctx, buf); + if (rollback_status) { + ice_debug(hw, ICE_DBG_SCHED, + "Failed to roll back queue %d, error %d\n", + LE16_TO_CPU(buf->txqs[0].txq_id), + rollback_status); + status = rollback_status; + } + } ena_txq_exit: ice_release_lock(&pi->sched_lock); @@ -6931,4 +6983,3 @@ bool ice_is_fw_auto_drop_supported(struct ice_hw *hw) return true; return false; } -