From nobody Fri Nov 13 01:07:59 2026 X-Original-To: dev-commits-src-all@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 4jQfJH6L5Rz6xy5Z for ; Fri, 13 Nov 2026 01:07:59 +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 4jQfJH5Jjsz4jSt for ; Fri, 13 Nov 2026 01:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794532079; 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=/CzvXeYz+I5GdX1P1x6FDruxjl4P4E3fBzSxNSHXlxo=; b=xcnr4pxP15CnIkmNiVaZe4Q0L3yI1/ywjrYHalgxPRuVtLZ/5GluNN05t4QqBrO2oKiZHt x7njJy4MAMSsQytKEzWX8mCsVRY4gLhucInRRl+ZZpPdx3roz6ZkgOkJeIeYtWsq/ww6A9 BiXW/0InRV9I23JF4t6bs6XadKxxn8//MomeDNSJjSA+8bARe1mVPsajzXm5IEWMpB7ez6 B+TAO5GD47LvoEowWSIyRBogzEa3WAh0yoxuGCADStvURxVn0/ABsaY+Uyp3XxCb7X2aYi Xk3a3+Wjkti+Jzd/fvu2Tw+AdCFCrjvXN1UYaMWAFfyOlo/lGKIlQOCR6XEe9w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794532079; b=pK+5yvk7Rbmajdea3FK2TYu9FFZD2bRNq0czVck5w50F8h4j5BunLuJFg4lDmKy5xJS4FZ 3mwCH7DdsEUYW6c+ib45gSr2woIlsDVdkNX15CUaVqcQeLGH2nU62AQqsusTW8DFF4d1h9 LE5Pk4hGH0oLAJBDVTMxplTlGwdQJVgo5igWsRdc0DeZtPTlW25uz4zI6EKmf0ZVo5WKLg UPqIuo5PPvfxYZvPxMiqlDk3vDgQBOgsbBVB0w4fJ8ovvtLqZtJISvYcsij4Ycy7kO7ah+ v+Au4h8RtT2TBxew6u39bo1Kvvs0v2V0E/o56j9iKU3YscZ8a7bf3EqGGhouIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794532079; 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=/CzvXeYz+I5GdX1P1x6FDruxjl4P4E3fBzSxNSHXlxo=; b=h4gqsPeRVIlRwKD9N1ZBCm8jLxF1jdlR2GGVqrWT5/X+88ApZuSP3W0prenXS5/3TgdYUB h8MhzFpBFxfSq/7/J4xQPiu0xI3j1XRD9zu1IN/bbdwP2EI5apXBMDmd0JIK7XhT33ubG4 kS7Pg5IN+HH5zT9vGBkVtKZBTsnq/IMY+erqNhIr+G0OoMp2MieBR8YE+9ZHW3pjDsk2gG 31b94Fquimbzn43FqpUpAWdjRgvvsQ6bgXSkxGZBOCGm0357pCKs7SO9h4IbFA7orzCqTL lSDyRBaQMJnPqjZRTLBPQWW8MIz4EsICLb/0zEMAulToMXCu+PGmO829PF77ZQ== 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 4jQfJH4wNpz1Qgx for ; Fri, 13 Nov 2026 01:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1849f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 13 Nov 2026 01:07:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 98256c39a966 - stable/15 - ice: Roll back Tx queues after scheduler setup failures List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 98256c39a96674a3fba5ad5b5666ee062bddd955 Auto-Submitted: auto-generated Date: Fri, 13 Nov 2026 01:07:59 +0000 Message-Id: <6af662ef.1849f.31182b8e@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=98256c39a96674a3fba5ad5b5666ee062bddd955 commit 98256c39a96674a3fba5ad5b5666ee062bddd955 Author: Kevin Bowling AuthorDate: 2026-10-31 23:55:31 +0000 Commit: Kevin Bowling CommitDate: 2026-11-13 01:07:50 +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. Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58907 (cherry picked from commit a50d83ef83d716d5e5e7f727c366561dd1b79d00) --- 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; } -