RE: [PATCH net-next 04/11] net: fec: add fec_build_skb() to build a skb
From: Wei Fang <wei.fang@nxp.com>
Date: 2026-01-14 02:32:58
Also in:
bpf, imx, lkml
quoted
-1796,7 +1849,6 @@ fec_enet_rx_queue(struct net_device *ndev, u16queue_id, int budget)quoted
struct sk_buff *skb; ushort pkt_len; int pkt_received = 0; - struct bufdesc_ex *ebdp = NULL; int index = 0; bool need_swap = fep->quirks & FEC_QUIRK_SWAP_FRAME; u32 data_start = FEC_ENET_XDP_HEADROOM + fep->rx_shift; @@-1866,24quoted
+1918,6 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, intbudget)quoted
goto rx_processing_done; } - /* The packet length includes FCS, but we don't want to - * include that when passing upstream as it messes up - * bridging applications. - */ - skb = build_skb(page_address(page), - PAGE_SIZE << fep->pagepool_order); - if (unlikely(!skb)) { - page_pool_recycle_direct(rxq->page_pool, page); - ndev->stats.rx_dropped++; - - netdev_err_once(ndev, "build_skb failed!\n"); - goto rx_processing_done; - } - - skb_reserve(skb, data_start); - skb_put(skb, pkt_len - sub_len); - skb_mark_for_recycle(skb); - if (unlikely(need_swap)) { u8 *data;@@ -1891,34 +1925,14 @@ fec_enet_rx_queue(struct net_device *ndev,u16 queue_id, int budget)quoted
swap_buffer(data, pkt_len); }Missed swap_buffer() in helper funciton()?
No, fec_build_skb() is also used for the XDP copy mode, and we do not support FEC_QUIRK_SWAP_FRAME in the XDP copy mode. So I keep the swap_buffer() in fec_enet_rx_queue().