[PATCH net] net: stmmac: fix the crash issue for zero copy XDP_TX action

Wei Fang wei.fang at nxp.com
Wed Dec 17 04:49:19 PST 2025


> > -	res = stmmac_xdp_xmit_xdpf(priv, queue, xdpf, false);
> > -	if (res == STMMAC_XDP_TX)
> > +	/* For zero copy XDP_TX action, dma_map is true */
> > +	res = stmmac_xdp_xmit_xdpf(priv, queue, xdpf, zc);
> 	Seems stmmac_xdp_xmit_xdpf is using dma_map_single if we pass zc is
> true.
>         Ideally in case of zc, driver can use page_pool_get_dma_addr, may be
> you
>         need pass zc param as false. Please check
> 

No, the memory type of xdpf->data is MEM_TYPE_PAGE_ORDER0 rather
than MEM_TYPE_PAGE_POOL, so we should use dma_map_single().
Otherwise, it will lead to invalid mappings and cause the crash.




More information about the linux-arm-kernel mailing list