[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231219140754.7a7a8dbd@device-28.home>
Date: Tue, 19 Dec 2023 14:07:54 +0100
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: Romain Gantois <romain.gantois@...tlin.com>, Alexandre Torgue
<alexandre.torgue@...s.st.com>, Jose Abreu <joabreu@...opsys.com>, "David
S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub
Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Maxime
Coquelin <mcoquelin.stm32@...il.com>, Miquel Raynal
<miquel.raynal@...tlin.com>, Sylvain Girard <sylvain.girard@...com>, Pascal
EBERHARD <pascal.eberhard@...com>, Richard Tresidder
<rtresidd@...ctromag.com.au>, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, stable@...r.kernel.org, Linus Walleij
<linus.walleij@...aro.org>
Subject: Re: [PATCH net 1/1] net: stmmac: Prevent DSA tags from breaking COE
Hi Vlad,
+ Linus Walleij
On Tue, 19 Dec 2023 14:20:34 +0200
Vladimir Oltean <olteanv@...il.com> wrote:
> Hi Romain,
>
> On Mon, Dec 18, 2023 at 05:23:23PM +0100, Romain Gantois wrote:
> > Some stmmac cores have Checksum Offload Engines that cannot handle DSA tags
> > properly. These cores find the IP/TCP headers on their own and end up
> > computing an incorrect checksum when a DSA tag is inserted between the MAC
> > header and IP header.
> >
> > Add an additional check on stmmac link up so that COE is deactivated
> > when the stmmac device is used as a DSA conduit.
> >
> > Add a new dma_feature flag to allow cores to signal that their COEs can't
> > handle DSA tags on TX.
> >
> > Fixes: 6b2c6e4a938f ("net: stmmac: propagate feature flags to vlan")
> > Cc: stable@...r.kernel.org
> > Reported-by: Richard Tresidder <rtresidd@...ctromag.com.au>
> > Closes: https://lore.kernel.org/netdev/e5c6c75f-2dfa-4e50-a1fb-6bf4cdb617c2@electromag.com.au/
> > Reported-by: Romain Gantois <romain.gantois@...tlin.com>
> > Closes: https://lore.kernel.org/netdev/c57283ed-6b9b-b0e6-ee12-5655c1c54495@bootlin.com/
> > Signed-off-by: Romain Gantois <romain.gantois@...tlin.com>
> > ---
>
> DSA_TAG_PROTO_LAN9303, DSA_TAG_PROTO_SJA1105 and DSA_TAG_PROTO_SJA1110
> construct tags with ETH_P_8021Q as EtherType. Do you still think it
> would be correct to say that all DSA tags break COE on the stmmac, as
> this patch assumes?
>
> The NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM convention is not about
> statically checking whether the interface using DSA, but about looking
> at each packet before deciding whether to use the offload engine or to
> call skb_checksum_help().
So it looks like an acceptable solution would be something along the
lines of what Linus is suggesting here :
https://lore.kernel.org/netdev/20231216-new-gemini-ethernet-regression-v2-2-64c269413dfa@linaro.org/
If so, maybe it's worth adding a new helper for that check ?
Maxime
Powered by blists - more mailing lists