From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380257; b=LNVYiHeAkvNRAzgGRJPux5TASZivM6OB9+ik0c79HpofJFKrBKOOAVUwUfOmjFFDbnLy E7AqV/POS+IlOyyEK/L5Oca61QHVY0l6v6eo8cPamhbVRFPsbfpfuicvx0zVM4V6YPIdW 0B4lA/ylYWHVe56w7RLJDgXTy/zSS241rI2zUGVQirTPKHeY6HWo0SIYdL82gTTbkbWv3 qCEKQ0v4Z+f0rnJWi7hM1KOneLzwaRIeo7RV3S7ezQCcJ+49l7ZoUJmRRM1m8MQ87PgcG eEwS08yobG/muAzuGx6j+fAS8hyQ60wzk7V6k7/XGIokAjjX7EzMw4dOymewVUfYjcA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380257; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=tzAHbo5JuF9AHNiIUdVmQwfE+KQ+kKBtXEvaH2magHY=; b=NxYJ1RvT9t6gR2byVsVhkkrLzE2vdE+b4AF5GsQD1u2Rez4fdjTCzqWOQE8rR2hVLb9s XpnSorUCIXCHD3OAuqHdelyFSLR77sImhjpJkSfK1upHlqx7T+1g5pH+AejPcO2dM5hho NVng/rLwaFTxjDcXMXuxpW2gxHk9WBqDrP3weRgOFMIsOapJOktvvR0iHjBBgEW+lRg1k cUdLHoOtlDewItAvBEwCcbVLExyUmsopOqD+v30tXFC+SXEVA1vBo4qDDRkTaUIorNoxS QGQQIT2FiTO/6ZZuHTF2UN5hqEdSNetBHr5T0QLT+edrw6yCkPdp9Drb0cp4Y60gxzQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=uG+kmmNl; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65FB7606A322; Fri, 4 Dec 2026 10:30:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=uG+kmmNl Received: by smtp.kernel.org (Postfix) with ESMTPSA id D68EA1F000CE; Fri, 4 Dec 2026 10:30:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380257; bh=tzAHbo5JuF9AHNiIUdVmQwfE+KQ+kKBtXEvaH2magHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uG+kmmNlR4PSWZSLi/R1dJYmlDMnMEB8BbgDs2nt9B8LrmUWCxUJveeYp6Me5Xklv 7EQ33NEmy7gAvhRam0zaAOylZTLFTxM7/Fg6/VytsfeGuS2dTQe+KNBO40m1WAKgLE JRToMIPlvhcfTGIjQQm/jGOOMK1ASw0Ne/ZoekJE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dimitri Daskalakis , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Jakub Kicinski , Sasha Levin Subject: [PATCH 7.3 178/742] eth: fbnic: wait on the correct queues in fbnic_queue_stop() Date: Fri, 4 Dec 2026 19:00:42 +0900 Message-ID: <20261204100639.812853826@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: 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 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dimitri Daskalakis [ Upstream commit 7bc16d84facd37b44ff508d4970bac6636329eb9 ] fbnic_queue_stop() waits for every queue of the NAPI vector to go idle before tearing it down, using sub0.q_idx as the queue index. We set q_idx on submission queues for Tx, and completion queues on Rx, so this waits on queue 0 for every Rx queue. For non-combined channels, stopping an Rx queue always stops/wakes Tx queue 0. Set the queue id on Tx completion rings so we don't have to distinguish between ring types to get the correct queue id, and don't stop/wake disabled rings. This bug was found by AI and verified on HW. Reproduced by binding a devmem dmabuf to one Rx queue (netdev bind-rx). Added a printk to fbnic_wait_queue_idle(), and traced Tx queue stop/wake with bpftrace. combined 79, bind rxq 1: before: netif_stop_subqueue(1) fbnic_wait_queue_idle(tx, 1) fbnic_wait_queue_idle(rx, 0) netif_wake_subqueue(1) after: netif_stop_subqueue(1) fbnic_wait_queue_idle(tx, 1) fbnic_wait_queue_idle(rx, 1) netif_wake_subqueue(1) rx 34 tx 34, bind rxq 5: before: netif_stop_subqueue(0) fbnic_wait_queue_idle(tx, 0) fbnic_wait_queue_idle(rx, 0) netif_wake_subqueue(0) after: fbnic_wait_queue_idle(tx, 39) fbnic_wait_queue_idle(rx, 5) ^ no more stop/wake of Tx queue 0 (tx 39 is the XDP Tx queue of rxq 5's vector, Rx queues always get an XDP Tx queue) Fixes: da43127a8edc ("eth: fbnic: support queue ops / zero-copy Rx") Signed-off-by: Dimitri Daskalakis Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261117215416.1901246-2-dimitri.daskalakis1@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c index 17d75ec6e3342..4d78d5423d608 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c @@ -1739,7 +1739,7 @@ static int fbnic_alloc_napi_vector(struct fbnic_dev *fbd, struct fbnic_net *fbn, /* Configure Tx completion queue */ db = &uc_addr[FBNIC_QUEUE(txq_idx) + FBNIC_QUEUE_TCQ_HEAD]; - fbnic_ring_init(&qt->cmpl, db, 0, 0); + fbnic_ring_init(&qt->cmpl, db, txq_idx, 0); /* Update Tx queue index */ txt_count--; @@ -2974,8 +2974,11 @@ static void __fbnic_nv_restart(struct fbnic_net *fbn, fbnic_wr32(fbd, FBNIC_INTR_SET(nv->v_idx / 32), BIT(nv->v_idx % 32)); fbnic_wrfl(fbd); - for (i = 0; i < nv->txt_count; i++) + for (i = 0; i < nv->txt_count; i++) { + if (nv->qt[i].sub0.flags & FBNIC_RING_F_DISABLED) + continue; netif_wake_subqueue(fbn->netdev, nv->qt[i].sub0.q_idx); + } fbnic_dbg_nv_init(nv); } @@ -3016,13 +3019,16 @@ static int fbnic_queue_stop(struct net_device *dev, void *qmem, int idx) napi_disable_locked(&nv->napi); fbnic_nv_irq_disable(nv); - for (i = 0; i < nv->txt_count; i++) + for (i = 0; i < nv->txt_count; i++) { + if (nv->qt[i].sub0.flags & FBNIC_RING_F_DISABLED) + continue; netif_stop_subqueue(dev, nv->qt[i].sub0.q_idx); + } fbnic_nv_disable(fbn, nv); for (t = 0; t < nv->txt_count + nv->rxt_count; t++) { err = fbnic_wait_queue_idle(fbn, t >= nv->txt_count, - nv->qt[t].sub0.q_idx); + nv->qt[t].cmpl.q_idx); if (err) goto err_restart; } -- 2.53.0