Re: [PATCH net-next v4 4/6] net: bcmgenet: add XDP_TX support

From: Nicolai Buchwitz

Date: Sat Mar 28 2026 - 16:37:13 EST


On 25.3.2026 05:03, Jakub Kicinski wrote:
On Mon, 23 Mar 2026 13:05:33 +0100 Nicolai Buchwitz wrote:
Implement XDP_TX using ring 16 (DESC_INDEX), the hardware default
descriptor ring, dedicated to XDP TX for isolation from SKB TX queues.

Ring 16 gets 32 BDs carved from ring 0's allocation. TX completion is
piggybacked on RX NAPI poll since ring 16's INTRL2_1 bit collides with
RX ring 0, similar to how bnxt, ice, and other XDP drivers handle TX
completion within the RX poll path.

The GENET MAC has TBUF_64B_EN set globally, requiring every TX buffer
to start with a 64-byte struct status_64 (TSB). For local XDP_TX, the
TSB is prepended by backing xdp->data into the RSB area (unused after
BPF execution) and zeroing it. For foreign frames redirected from other
devices, the TSB is written into the xdp_frame headroom.

The page_pool DMA direction is changed from DMA_FROM_DEVICE to
DMA_BIDIRECTIONAL to allow TX reuse of the existing DMA mapping.

drivers/net/ethernet/broadcom/genet/bcmgenet.c:2420:27: warning: variable 'tx_ring' set but not used [-Wunused-but-set-variable]
2420 | struct bcmgenet_tx_ring *tx_ring;
| ^

Missed during the refactoring (should be part of patch 5). I will address this in the next version of this series.

Thanks
Nicolai