mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 19:16:02 +02:00
net: stmmac: selftests: Account for alignment shift on dwmac1000 for Jumbo test
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: 23680bf5f8 ("net: stmmac: restore NET_IP_ALIGN in the RX DMA offset")
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20260917215339.2022523-8-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
b8a26d46c0
commit
c4ac6e94eb
|
|
@ -1789,6 +1789,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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user