Skip to contentSkip to conversation

stmmac: Revert "stmmac: align RX buffers"

PATCH In review Marc Zyngier 2 participants 3 messages Aug 20, 2021 – Aug 21, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stmmac: Revert "stmmac: align RX buffers"

This reverts commit a955318fe67e ("stmmac: align RX buffers"), which breaks at least one platform (Nvidia Jetson-X1), causing packet corruption. This is 100% reproducible, and reverting the patch results in a working system again.

Given that it is "only" a performance optimisation, let's return to a known working configuration until we can have a good understanding of what is happening here.

Cc Matteo Croce <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Giuseppe Cavallaro <[email protected]>
Cc Alexandre Torgue <[email protected]>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac.h +2 -2
index fcdb1d20389b..43eead726886 100644
@@ -339,9 +339,9 @@ static inline bool stmmac_xdp_is_enabled(struct stmmac_priv *priv)
 static inline unsigned int stmmac_rx_offset(struct stmmac_priv *priv)
 {
 	if (stmmac_xdp_is_enabled(priv))
-		return XDP_PACKET_HEADROOM + NET_IP_ALIGN;
+		return XDP_PACKET_HEADROOM;
 
-	return NET_SKB_PAD + NET_IP_ALIGN;
+	return 0;
 }
 
 void stmmac_disable_rx_queue(struct stmmac_priv *priv, u32 queue);
Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 8 lines · On Fri, 20 Aug 2021 19:30:02 +0100 Marc Zyngier wrote:

This reverts commit a955318fe67e ("stmmac: align RX buffers"), which breaks at least one platform (Nvidia Jetson-X1), causing packet corruption. This is 100% reproducible, and reverting the patch results in a working system again.

Given that it is "only" a performance optimisation, let's return to a known working configuration until we can have a good understanding of what is happening here.

Seems reasonable. Hopefully it wont discourage Matteo from revisiting the optimization. Applied, thanks!

#2 lore raw
Quoted 7 lines · Jakub Kicinski
Quoted 5 lines · On Fri, 20 Aug 2021 19:30:02 +0100 Marc Zyngier wrote:

This reverts commit a955318fe67e ("stmmac: align RX buffers"), which breaks at least one platform (Nvidia Jetson-X1), causing packet corruption. This is 100% reproducible, and reverting the patch results in a working system again.

Quoted 6 lines
Quoted 3 lines

Given that it is "only" a performance optimisation, let's return to a known working configuration until we can have a good understanding of what is happening here.

Seems reasonable. Hopefully it wont discourage Matteo from revisiting the optimization. Applied, thanks!

That's my hope too. As I pointed out at the end of the towards the end of the discussion I linked to, this buys us time to work out exactly where is the gap in our understanding of the buffer allocation for this particular driver.

Once we clearly understand why it fails on some systems and not some others (which on its own could cover a multitude of sins), I'd be glad to see this optimisation brought back in, and I'm willing to help with it.

Thanks,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.