Re: [PATCH net] eth: fbnic: Keep real queue counts synchronized
flat view
From: Breno Leitao <leitao@debian.org>
Date: 2026-09-18 11:00:58
Also in:
lkml
On Tue, Sep 15, 2026 at 08:08:57PM +0200, Björn Töpel wrote:
alloc_etherdev_mq() initializes the real queue counts to the
allocation maximum. fbnic selects smaller defaults and can change its
private queue counts while the device is down, but does not publish
either value until the next open.
Resume can also allocate fewer IRQs and silently clamp the private
queue counts. Queues can share NAPI vectors, so changing the
configured queue counts is unnecessary.
These mismatches can expose an inactive queue for memory-provider
binding or hide an existing binding. A later channel expansion can
allocate the queue without recognizing its memory provider.
Publish default and offline channel counts immediately. Reset RSS
indirection whenever the queue-count helper runs. Preserve queue
counts across resume and share the remaining NAPI vectors when fewer
IRQs are available. The RSS table remains valid because it indexes RX
queues rather than NAPI vectors.
Fixes: da43127a8edc ("eth: fbnic: support queue ops / zero-copy Rx")
Reported-by: Sashiko <netdev-bot+sashiko@kernel.org>
Link: https://lore.kernel.org/netdev/178915061000.219967.7726187707862333281@kernel.org/ (local)
Signed-off-by: Björn Töpel <bjorn@kernel.org>Reviewed-by: Breno Leitao <leitao@debian.org>
quoted hunk ↗ jump to hunk
+ /* Preserve queue counts, as RX queues may have memory providers bound. + * The RSS table indexes RX queues and remains valid. Rebuild only the + * NAPI layout, sharing vectors if fewer IRQs are available. + */ + max_napis = fbd->num_irqs - FBNIC_NON_NAPI_VECTORS; + max_queues = max(fbn->num_tx_queues, fbn->num_rx_queues); + fbn->num_napi = min(max_queues, max_napis);
It seems the comment does not match the code. num_napi is recomputed unconditionally from max(num_tx, num_rx), which is not what num_napi was, so isn't the NAPI layout is rebuilt even when the IRQ count is unchanged? --breno