linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] stmmac: Revert "stmmac: align RX buffers"
@ 2021-08-20 18:30 Marc Zyngier
  2021-08-20 21:46 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2021-08-20 18:30 UTC (permalink / raw)
  To: netdev
  Cc: kernel-team, linux-kernel, Matteo Croce, Jakub Kicinski,
	David S. Miller, Eric Dumazet, Giuseppe Cavallaro,
	Alexandre Torgue

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 <mcroce@linux.microsoft.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Link: https://lore.kernel.org/netdev/871r71azjw.wl-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index fcdb1d20389b..43eead726886 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -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);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] stmmac: Revert "stmmac: align RX buffers"
  2021-08-20 18:30 [PATCH net] stmmac: Revert "stmmac: align RX buffers" Marc Zyngier
@ 2021-08-20 21:46 ` Jakub Kicinski
  2021-08-21  9:50   ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2021-08-20 21:46 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: netdev, kernel-team, linux-kernel, Matteo Croce, David S. Miller,
	Eric Dumazet, Giuseppe Cavallaro, Alexandre Torgue

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!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] stmmac: Revert "stmmac: align RX buffers"
  2021-08-20 21:46 ` Jakub Kicinski
@ 2021-08-21  9:50   ` Marc Zyngier
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2021-08-21  9:50 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, kernel-team, linux-kernel, Matteo Croce, David S. Miller,
	Eric Dumazet, Giuseppe Cavallaro, Alexandre Torgue

On Fri, 20 Aug 2021 22:46:10 +0100,
Jakub Kicinski <kuba@kernel.org> wrote:
> 
> 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!

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.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-21  9:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20 18:30 [PATCH net] stmmac: Revert "stmmac: align RX buffers" Marc Zyngier
2021-08-20 21:46 ` Jakub Kicinski
2021-08-21  9:50   ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).