From nobody Sat Oct 31 23:59:51 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 4jHFMJ6vtqz6xdPJ for ; Sat, 31 Oct 2026 23:59:56 +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 4jHFMJ5Fzxz3JyN for ; Sat, 31 Oct 2026 23:59:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793491196; 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=OAethcj4rdZJww7Ss+mT0t7N2HyAjbMqiIaHrYJhJhjXyCX1+IVog8lzNYO8nbuDtFRhTc RmvbHqYnHOYHH+YcFKDkXg7I9+174jRcHjnEn6JUipe4SPKhYBGx9EX5UIVa90BF6yYoag dU7jBmGejAgr9814DUAmYp6ooNz48wNloQMSfIhHgx1mYI67UWSWBrA08p0I21waR2HKl9 a31rvQksIWWYZyQ3ea4VzyOX60Cz2ozgw0OnetsWemloNAq7daiqNLZleVopxg0cKRu8sm kpUzaCz5uV0zYOozauyEBs4G0bsz+fYDi6N/ozjw92Wg5ZLtuy9DiAxQgcw5lQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793491196; b=Y+sfN6NaVOwiuFLwKnEr73RZeXVyn5Q1PN8x85TsC/iNZpsPTeos5265Xf4ZGoxo6V2JIz Zu1d60Mq7flhH48M4euwZ2deSHKZvEc5eS6lph2tV+V+/H/aI62mxTIxUB06HGPOtRci7D BCgcXzqUwUDScMvwPvzbHhn7XPYX1/Hki9RPOAN4yWejrR+MqHHu6rwbNioRaFjdgxV2UK lBW+d791xak6tR41RtpWnEP5dfBzr6sjyM1SSTi3VcH2rR+mRXotFaL/yViEBLhxB5oKFO F7wwLbBwhjUr7VABBUX41dmAZoI9xG+tW6BKUG2PYzS85BSvezgwiR7S+bjnVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793491196; 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=mX2d3IhR62bJbOg0uyu4xirMc+Zy2Oiq3bb/t1rTuAwsUnI63GRoTnSleYnedNvdLEBG1p 0YV+y0sxr/+I5UMNN5mgl9jwWiFR1nw/7yl47aQ0f4huKSezREfZ30tKoE2AuadVdC3tmM lgJ0CUhHHJw0MtVBKSG3AD4hIr8qF2L3T2zLE8yaP/WrMORSzi7VBd4gnR2DgDUip75eXV KBzVubOhauD2gqjOWa8yfaRQuUxQA0V+eL0K1A20IBh+S9gAFtKagixqz2WydpUe+5A/9Q NTOokLvqi+3UVnnfvzwaB/8wLO8AqJftkDnBRRtWL1tnIrPHYXKHTwsaqkhFSA== 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 4jHFMJ4dtDzbgQ for ; Sat, 31 Oct 2026 23:59:56 +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-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/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; } -