From: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: "Alexander Duyck" <alexanderduyck@fb.com>,
"Jakub Kicinski" <kuba@kernel.org>,
kernel-team@meta.com, "Andrew Lunn" <andrew+netdev@lunn.ch>,
"Eric Dumazet" <edumazet@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Shuah Khan" <shuah@kernel.org>,
"Mohsin Bashir" <hmohsin@meta.com>,
"Mike Marciniszyn (Meta)" <mike.marciniszyn@gmail.com>,
"Stanislav Fomichev" <sdf@fomichev.me>,
"Bobby Eshleman" <bobbyeshleman@meta.com>,
"Björn Töpel" <bjorn@kernel.org>,
"Breno Leitao" <leitao@debian.org>,
"Simon Horman" <horms@kernel.org>,
"Mina Almasry" <almasrymina@google.com>,
"Vadim Fedorenko" <vadim.fedorenko@linux.dev>,
"Dimitri Daskalakis" <daskald@meta.com>,
netdev@vger.kernel.org,
"Dimitri Daskalakis" <dimitri.daskalakis1@gmail.com>
Subject: [PATCH net 1/4] eth: fbnic: wait on the correct queues in fbnic_queue_stop()
Date: Mon, 16 Nov 2026 12:29:54 -0800 [thread overview]
Message-ID: <20261116202957.3601684-2-dimitri.daskalakis1@gmail.com> (raw)
In-Reply-To: <20261116202957.3601684-1-dimitri.daskalakis1@gmail.com>
From: Dimitri Daskalakis <daskald@meta.com>
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) <- wrong rxq
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,
rxq's alaways get a XDP Tx queue during init)
Fixes: da43127a8edc ("eth: fbnic: support queue ops / zero-copy Rx")
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
---
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 07d4b2e92362..5efed21e5932 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
@@ -1772,7 +1772,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--;
@@ -3047,8 +3047,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);
}
@@ -3089,13 +3092,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.52.1
next prev parent reply other threads:[~2026-11-16 20:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 20:29 [PATCH net 0/4] eth: fbnic: miscellaneous driver fixes Dimitri Daskalakis
2026-11-16 20:29 ` Dimitri Daskalakis [this message]
2026-11-16 20:29 ` [PATCH net 2/4] eth: fbnic: skip disabled Tx rings when setting the queue NAPI Dimitri Daskalakis
2026-11-16 20:29 ` [PATCH net 3/4] eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats() Dimitri Daskalakis
2026-11-16 20:29 ` [PATCH net 4/4] selftests: drv-net: stats: query timestamping stats while down Dimitri Daskalakis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116202957.3601684-2-dimitri.daskalakis1@gmail.com \
--to=dimitri.daskalakis1@gmail.com \
--cc=alexanderduyck@fb.com \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=bjorn@kernel.org \
--cc=bobbyeshleman@meta.com \
--cc=daskald@meta.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hmohsin@meta.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=mike.marciniszyn@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox