Re: [PATCH net] eth: fbnic: Keep real queue counts synchronized
Breno Leitao <[email protected]>
| Newsgroups | org.kernel.vger.netdev,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]>
> Link: https://lore.kernel.org/netdev/[email protected]/
> Signed-off-by: Björn Töpel <[email protected]>
Reviewed-by: Breno Leitao <[email protected]>
> + /* 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