Re: [PATCH net-next 13/15] eth: bnxt: Receive into XDP-only memory providers
From: Björn Töpel
Date: Wed Nov 25 2026 - 15:34:11 EST
netdev-bot+sashiko@xxxxxxxxxx writes:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 0
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [Medium] eth: bnxt: permanent RX queue stall when XDP-only FILL ring is
> empty at setup
>
> --
>
>> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
>> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
>> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
>> @@ -3969,7 +3951,8 @@ static int bnxt_alloc_rx_page_pool(struct bnxt *bp,
>> pp.dma_dir = bp->rx_dir;
>> pp.max_len = PAGE_SIZE << pp.order;
>> pp.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV |
>> - PP_FLAG_ALLOW_UNREADABLE_NETMEM;
>> + PP_FLAG_ALLOW_UNREADABLE_NETMEM |
>> + PP_FLAG_ALLOW_XDP_ONLY_NETMEM;
>> pp.queue_idx = rxr->bnapi->index;
>>
>> pool = page_pool_create(&pp);
>
> [Severity: Medium]
> With PP_FLAG_ALLOW_XDP_ONLY_NETMEM, rxr->page_pool can now be backed
> by the AF_XDP sink, and the sink takes its buffers from the userspace
> FILL ring. What happens if that ring is empty when bnxt fills the RX
> ring?
>
> bnxt_alloc_one_rx_ring_skb() breaks out of its loop on the first
> bnxt_alloc_rx_data() failure. With an empty FILL ring, rx_prod is
> left at 0, and rx_agg_prod is left at 0 by
> bnxt_alloc_one_rx_ring_netmem(). bnxt_queue_mem_alloc() still returns
> success, and bnxt_queue_start() rings the doorbell with nothing
> posted.
>
> As far as I can tell, bnxt only refills RX buffers from bnxt_rx_pkt()
> while it handles a completion. With no descriptors posted, the NIC
> never produces a completion. When userspace later fills the ring and
> xsk_sink_wakeup() schedules NAPI, __bnxt_poll_work() finds no work
> and returns without allocating, so the queue stays wedged.
>
> This is the normal AF_XDP order: bind first, then populate FILL.
> xsk_sink_bind() expects it by setting need_wakeup, and
> testapp_stats_fill_empty() in this series exercises it. It can also
> happen on netdev_rx_queue_reconfig(). There, new_mem is allocated
> before the old queue's buffers go back to the sink, so FILL can be
> dry at that point even if userspace keeps it topped up.
>
> Does bnxt need a refill pass at the end of NAPI poll when the RX ring
> is short, like mlx5 and fbnic have? Or did you have another way in
> mind to prime the ring for an XDP-only provider?
This is how bnxt fills its rings today. Rings stop at the first failed
allocation with a warning, and after that refills one buffer per
completion.
devmem and iouring zcrx feed works the same way. A ring that starts
empty never fills, wakeup or not. If it starts short, it stays short (I
think!)
But... a sink makes an empty start likely as FILL can be dry when the
queue restarts while bound. The docs says FILL before bind, but that
only cover bind.
I'll add a refill pass for rings with page pool providers, so it covers
devmem and iouring zcrx as well.