[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <624fc854-a8cf-43d5-9be0-6c2c0dccad1f@electromag.com.au>
Date: Sat, 16 Dec 2023 14:15:32 +0800
From: Richard Tresidder <rtresidd@...ctromag.com.au>
To: Romain Gantois <romain.gantois@...tlin.com>, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
Maxime Chevallier <maxime.chevallier@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: DSA tags seem to break checksum offloading on DWMAC100
On 15/12/2023 5:54 pm, Romain Gantois wrote:
> A similar issue was just reported for a different MAC driver:
>
> https://lore.kernel.org/netdev/20231215-new-gemini-ethernet-regression-v1-2-93033544be23@linaro.org/T/#u
>
> Hello everyone,
>
> I was rebasing on net-next an out-of-tree stmmac driver for the RZN1 GMAC
> IP, and I noticed that something broke all TCP transmissions going through the
> GMAC1 Ethernet controller. This MAC controller was connected to a 88E6352
> Marvell switch through its CPU port. Further investigation revealed that
> egressing packets had an invalid TCP checksum, which caused them to be dropped
> at the receiving side's kernel.
>
> A bisection on the transmitting side's kernel showed that the commit that caused
> the bug was:
>
> 6b2c6e4a938f (net: stmmac: propagate feature flags to vlan, 2023-04-17)
>
> This stmmac patch makes it so that most of the feature flags of stmmac net
> devices are copied to its vlan features. Some of these flags are then
> transmitted to DSA user devices. The NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM flags
> that control checksum offloading, are responsible for the bug.
>
> Relevant call chain:
> dsa_user_xmit -> ...[packet is tagged] -> __dev_queue_xmit \
> -> validate_xmit_skb and stmmac_xmit
>
> If checksum offloading is enabled, stmmac will set it in hardware at the
> following location:
>
> https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/stmicro/stmmac/enh_desc.c#L322
>
> Then the hardware computes an incorrect checksum. I believe that this is caused
> by the presence of DSA tags in the frames, although I can't be 100% sure of
> this.
>
> So it seems like a solution is needed to prevent checksum offloading by Ethernet
> drivers when DSA tags are in used. I'm not sure how this would be done, since
> DSA is purposefully kept quite separate from CPU port drivers. What are your
> thoughts on this?
>
> Best Regards,
I'm working through a very similar issue in this conversation:
https://lore.kernel.org/netdev/e5c6c75f-2dfa-4e50-a1fb-6bf4cdb617c2@electromag.com.au/
It's the same commit that I found when bisecting that caused the issue.
We have this same stmmac interfacing with a 88E6352 running with the DSA
driver.
Cheers
Richard Tresidder
Powered by blists - more mailing lists