Re: [PATCH net-next 3/6] net: bcmgenet: add basic XDP support (PASS/DROP)
From: Nicolai Buchwitz
Date: Sat Mar 14 2026 - 15:48:54 EST
On 13.3.2026 23:48, Florian Fainelli wrote:
On 3/13/26 02:20, Nicolai Buchwitz wrote:
Add XDP program attachment via ndo_bpf and execute XDP programs in the
RX path. Supported actions:
- XDP_PASS: build SKB from the (possibly modified) xdp_buff and pass
to the network stack, handling xdp_adjust_head/tail correctly
- XDP_DROP: return the page to page_pool, no SKB allocated
- XDP_ABORTED: same as DROP with trace_xdp_exception
XDP_TX and XDP_REDIRECT are not yet supported and will return
XDP_ABORTED.
The XDP hook runs after the HW error checks but before SKB construction,
so dropped packets avoid all SKB allocation overhead.
Advertise NETDEV_XDP_ACT_BASIC in xdp_features.
Signed-off-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
---
[snip]
@@ -2345,12 +2397,6 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
hard_start = page_address(rx_page) + rx_off;
status = (struct status_64 *)hard_start;
dma_length_status = status->length_status;
- if (dev->features & NETIF_F_RXCSUM) {
- rx_csum = (__force __be16)(status->rx_csum & 0xffff);
- if (rx_csum) {
- /* defer csum setup to after skb is built */
- }
- }
Did you intend for that hunk to be deleted?
Yes, (kinda) intentional. Patch 1 moved the csum setup after SKB construction
(since we no longer have an SKB at that point), but left the early read
as a dead no-op - patch 3 then removed it. I'll clean this up in v2 by
dropping the dead block directly in patch 1 instead.
Nicolai