RE: [PATCH net-next 04/11] net: fec: add fec_build_skb() to build a skb
From: Wei Fang
Date: Tue Jan 13 2026 - 21:32:58 EST
> > -1796,7 +1849,6 @@ fec_enet_rx_queue(struct net_device *ndev, u16
> queue_id, int budget)
> > 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,24
> > +1918,6 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int
> budget)
> > 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)
> > 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().