Re: [PATCH net-next 4/5] net: fec: remove rx_align from fec_enet_private
From: Andrew Lunn
Date: Thu Nov 13 2025 - 08:10:28 EST
> Sorry, I misremembered the value of XDP_PACKET_HEADROOM. it should
> be 256 bytes.
>
> See fec_enet_alloc_rxq_buffers():
>
> phys_addr = page_pool_get_dma_addr(page) + FEC_ENET_XDP_HEADROOM;
> bdp->cbd_bufaddr = cpu_to_fec32(phys_addr);
>
> I will correct it in v2, thanks
So you could add a BUILD_BUG_ON() test which makes sure
FEC_ENET_XDP_HEADROOM gives you the needed alignment. That way it is
both "documented" and enforced. And it costs nothing at runtime.
Andrew