[PATCH net v2 6/6] net: stmmac: selftests: Account for alignment shift on dwmac1000 for Jumbo test

Nicolai Buchwitz nb at tipi-net.de
Thu Sep 10 11:13:50 PDT 2026


On 10.9.2026 17:14, Maxime Chevallier wrote:
> On dwmac1000, we currently only support single-descriptor frames. The
> Jumbo test started failing when NET_IP_ALIGN was added to align the IP
> header, as this tests tries to send the biggest possible frame.
> 
> On dwmac1000 the DMA transfer is aligned on 4-bytes, so adding a 2-byte
> shift at the start-of-buffer address means it takes a whole extra 
> 4-byte
> DMA burst to receive the Jumbo packet, causing it to spill over the 
> next
> descriptor.
> 
> This doesn't seem to happen on dwmac4 and xgmac that appear to 
> correctly
> handle unaligned xfers (only tested on dwmac4)
> 
> Let's account for that in the Jumbo test, reduce the size of our big
> packet by the align size.
> 
> Fixes: 23680bf5f8c6 ("net: stmmac: restore NET_IP_ALIGN in the RX DMA 
> offset")
> Signed-off-by: Maxime Chevallier <maxime.chevallier at bootlin.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c 
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
> index ec56ee0031ab..fc8d69260f43 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
> @@ -1776,6 +1776,9 @@ static int __stmmac_test_jumbo(struct stmmac_priv 
> *priv, u16 queue)
>  	struct stmmac_packet_attrs attr = { };
>  	int size = priv->dma_conf.dma_buf_sz;
> 
> +	if (!dwmac_is_xmac(priv->plat->core_type))
> +		size -= NET_IP_ALIGN;
> +
>  	attr.dst = priv->dev->dev_addr;
>  	attr.max_size = size - ETH_FCS_LEN;
>  	attr.queue_mapping = queue;

Reviewed-by: Nicolai Buchwitz <nb at tipi-net.de>

Thanks,
Nicolai



More information about the linux-arm-kernel mailing list