From: sashiko-bot@kernel.org
To: "Nicolai Buchwitz" <nb@tipi-net.de>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next v9 5/7] net: bcmgenet: add XDP_REDIRECT and ndo_xdp_xmit support
Date: Thu, 07 May 2026 19:17:58 +0000 [thread overview]
Message-ID: <20260507191759.2A3D3C2BCB8@smtp.kernel.org> (raw)
In-Reply-To: <20260506095553.55357-6-nb@tipi-net.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The ndo_xdp_xmit implementation can permanently stall because the XDP TX ring (ring 16) is only reclaimed during RX NAPI polling, which may never run if the interface receives no packets.
--
commit 606bc29cba0382a693d9785fe2fe2ff9ee75e598
Author: Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: add XDP_REDIRECT and ndo_xdp_xmit support
This commit adds XDP_REDIRECT support and implements ndo_xdp_xmit for
receiving redirected frames from other devices.
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index f1e515526787a..4e4fe785f0bf5 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
[ ... ]
> @@ -2332,22 +2332,22 @@ static struct sk_buff *bcmgenet_xdp_build_skb(struct bcmgenet_rx_ring *ring,
> return skb;
> }
>
> +/* Submit a single XDP frame to the TX ring. Caller must hold ring->lock.
> + * Returns true on success. Does not ring the doorbell - caller must
> + * write TDMA_PROD_INDEX after batching.
> + */
> static bool bcmgenet_xdp_xmit_frame(struct bcmgenet_priv *priv,
> + struct bcmgenet_tx_ring *ring,
> struct xdp_frame *xdpf, bool dma_map)
> {
> - struct bcmgenet_tx_ring *ring = &priv->xdp_tx_ring;
> struct device *kdev = &priv->pdev->dev;
> struct enet_cb *tx_cb_ptr;
> dma_addr_t mapping;
> unsigned int dma_len;
> u32 len_stat;
>
> - spin_lock(&ring->lock);
> -
> - if (ring->free_bds < 1) {
> - spin_unlock(&ring->lock);
> + if (ring->free_bds < 1)
> return false;
Can this ring permanently stall if the interface is only used as a redirect
destination?
Because the XDP TX ring has no TX completion interrupts, it relies entirely
on the RX NAPI handler to reclaim completed TX buffers. If the interface
receives no incoming traffic, the RX NAPI handler will never run.
Once the ring descriptors are filled, this check will continuously return
false, permanently dropping all subsequent redirected frames from
ndo_xdp_xmit.
Does ndo_xdp_xmit need to proactively reclaim TX buffers when the ring is
full, or use another mechanism to ensure completion?
> - }
>
> tx_cb_ptr = bcmgenet_get_txcb(priv, ring);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260506095553.55357-1-nb@tipi-net.de?part=5
next prev parent reply other threads:[~2026-05-07 19:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 9:55 [PATCH net-next v9 0/7] net: bcmgenet: add XDP support Nicolai Buchwitz
2026-05-06 9:55 ` [PATCH net-next v9 1/7] net: bcmgenet: convert RX path to page_pool Nicolai Buchwitz
2026-05-07 19:17 ` sashiko-bot
2026-05-10 18:46 ` Jakub Kicinski
2026-05-06 9:55 ` [PATCH net-next v9 2/7] net: bcmgenet: register xdp_rxq_info for each RX ring Nicolai Buchwitz
2026-05-06 9:55 ` [PATCH net-next v9 3/7] net: bcmgenet: add basic XDP support (PASS/DROP) Nicolai Buchwitz
2026-05-07 19:17 ` sashiko-bot
2026-05-10 18:47 ` Jakub Kicinski
2026-05-06 9:55 ` [PATCH net-next v9 4/7] net: bcmgenet: add XDP_TX support Nicolai Buchwitz
2026-05-07 19:17 ` sashiko-bot
2026-05-10 18:52 ` Jakub Kicinski
2026-05-06 9:55 ` [PATCH net-next v9 5/7] net: bcmgenet: add XDP_REDIRECT and ndo_xdp_xmit support Nicolai Buchwitz
2026-05-07 19:17 ` sashiko-bot [this message]
2026-05-10 18:55 ` Jakub Kicinski
2026-05-06 9:55 ` [PATCH net-next v9 6/7] net: bcmgenet: add XDP statistics counters Nicolai Buchwitz
2026-05-07 19:17 ` sashiko-bot
2026-05-06 9:55 ` [PATCH net-next v9 7/7] net: bcmgenet: reject MTU changes incompatible with XDP Nicolai Buchwitz
2026-05-07 19:18 ` sashiko-bot
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=20260507191759.2A3D3C2BCB8@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=nb@tipi-net.de \
--cc=sashiko@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