BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Björn Töpel" <bjorn@kernel.org>, bpf@vger.kernel.org
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next 13/15] eth: bnxt: Receive into XDP-only memory providers
Date: Wed, 25 Nov 2026 13:00:17 +0000	[thread overview]
Message-ID: <sashiko-outbox-233423@kernel.org> (raw)
In-Reply-To: <20261124125654.183091-13-bjorn@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] eth: bnxt: permanent RX queue stall when XDP-only FILL ring
  is empty at setup
--

commit 216a70ae81e1efc56a16448ea5bf41a5bbbd9619
Author: Björn Töpel <bjorn@kernel.org>

eth: bnxt: Receive into XDP-only memory providers

This commit converts RX page-mode heads and XDP fragments in bnxt to use
netmem and enables PP_FLAG_ALLOW_XDP_ONLY_NETMEM on the RX page pool.

> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 5c6c2219a481c..465465db53ba4 100644
> --- 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]
Can an RX queue stall permanently if the AF_XDP FILL ring is empty when the
queue is allocated or reconfigured with an XDP-only memory provider?

When userspace binds an AF_XDP sink before populating the FILL ring (or
reconfigures the queue while all UMEM chunks are in use),
bnxt_queue_mem_alloc() -> bnxt_alloc_one_rx_ring_skb() fails on the first
descriptor and starts the ring with rxr->rx_prod == 0:

drivers/net/ethernet/broadcom/bnxt/bnxt.c:bnxt_alloc_one_rx_ring_skb() {
    ...
	for (i = 0; i < bp->rx_ring_size; i++) {
		if (bnxt_alloc_rx_data(bp, rxr, prod, GFP_KERNEL)) {
			netdev_warn(bp->dev, "init'ed rx ring %d with %d/%d skbs only\n",
				    ring_nr, i, bp->rx_ring_size);
			break;
		}
		prod = NEXT_RX(prod);
	}
	rxr->rx_prod = prod;
    ...
}

Because bnxt only refills RX buffers inside bnxt_rx_pkt() when processing an
RX completion, waking NAPI via xsk_sink_wakeup() after populating the FILL
ring returns from __bnxt_poll_work() without allocating any descriptors,
leaving the RX queue wedged with zero posted buffers.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124112707.118678-1-bjorn@kernel.org?part=13

  reply	other threads:[~2026-11-25 13:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 11:26 [PATCH net-next 00/15] xsk: Receive in the device's buffer layout Björn Töpel
2026-11-24 12:56 ` [PATCH net-next 01/15] xdp: Let memory providers offer XDP a view of their net_iovs Björn Töpel
2026-11-25 13:00   ` sashiko-bot
2026-11-24 12:56 ` [PATCH net-next 02/15] xdp: Keep the shared info of a buffer in kernel memory Björn Töpel
2026-11-24 12:56 ` [PATCH net-next 03/15] net: Add memory providers that only feed XDP Björn Töpel
2026-11-24 12:56 ` [PATCH net-next 04/15] page_pool: Let memory providers take back net_iovs Björn Töpel
2026-11-24 12:56 ` [PATCH net-next 05/15] xdp: Run programs on buffers that must not hold kernel structures Björn Töpel
2026-11-25 13:00   ` sashiko-bot
2026-11-24 12:56 ` [PATCH net-next 06/15] xsk: Lend UMEM chunks to the page pools of a queue Björn Töpel
2026-11-24 14:34   ` Magnus Karlsson
2026-11-24 15:12     ` Björn Töpel
2026-11-25 13:00   ` sashiko-bot
2026-11-24 12:56 ` [PATCH net-next 07/15] xsk: Deliver to the socket in the device's buffer layout Björn Töpel
2026-11-25 13:00   ` sashiko-bot
2026-11-24 12:56 ` [PATCH net-next 08/15] xsk: Receive " Björn Töpel
2026-11-25 13:00   ` sashiko-bot
2026-11-24 12:56 ` [PATCH net-next 09/15] eth: fbnic: Support XDP redirect Björn Töpel
2026-11-24 12:56 ` [PATCH net-next 10/15] eth: fbnic: Receive into XDP-only memory providers Björn Töpel
2026-11-24 12:56 ` [PATCH net-next 11/15] net: Add netif_rxq_has_xdp_only_mp() Björn Töpel
2026-11-24 12:56 ` [PATCH net-next 12/15] eth: mlx5e: Receive into XDP-only memory providers Björn Töpel
2026-11-25 13:00   ` sashiko-bot
2026-11-24 12:56 ` [PATCH net-next 13/15] eth: bnxt: " Björn Töpel
2026-11-25 13:00   ` sashiko-bot [this message]
2026-11-24 12:56 ` [PATCH net-next 14/15] selftests: net: xsk: Test the device's RX buffer layout Björn Töpel
2026-11-25 13:00   ` sashiko-bot
2026-11-24 12:56 ` [PATCH net-next 15/15] Documentation: networking: Describe AF_XDP RX in the device's layout Björn Töpel

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=sashiko-outbox-233423@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.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