[PATCH net v3 2/2] net: stmmac: Stop Tx queue when (en|dis)abling XSK pools
Nicolai Buchwitz
nb at tipi-net.de
Tue Oct 13 05:06:06 PDT 2026
Hi Kurt
On 13.10.2026 10:57, Kurt Kanzenbach wrote:
> When enabling or disabling XSK pools in parallel to Tx traffic, kernel
> crashes occur. For VLAN tagged frames that happens in stmmac_xmit() ->
> dwmac4_set_vlan_tag() and for normal frames in stmmac_xmit() ->
> dwmac4_set_addr(). Both of these functions access the Tx DMA
> descriptors.
>
> The XDP pool (en|dis)ablement frees and reallocates the Tx DMA
> resources:
>
> stmmac_disable_tx_queue:
> __free_dma_tx_desc_resources
>
> stmmac_enable_tx_queue:
> __alloc_dma_tx_desc_resources
> __init_dma_tx_desc_rings
>
> NAPI is disabled during that allocation window, but the Tx queue is not
> stopped. Therefore, add the stopping of the Tx queue during the
> enabling
> and disabling of XSK pools.
>
> The issue can be easily reproduced by:
>
> 1. Run iperf
> 2. Run application which opens an AF_XDP/ZC socket
>
> Also add a dedicated queue check for the XDP Tx paths.
>
> Fixes: 132c32ee5bc0 ("net: stmmac: Add TX via XDP zero-copy socket")
> Suggested-by: Nicolai Buchwitz <nb at tipi-net.de> # XDP Tx checks
> Signed-off-by: Kurt Kanzenbach <kurt at linutronix.de>
> [...]
Reviewed-by: Nicolai Buchwitz <nb at tipi-net.de>
Tested-by: Nicolai Buchwitz <nb at tipi-net.de> # stm32mp215
Thanks,
Nicolai
More information about the linux-arm-kernel
mailing list