[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e2250240-db19-4cb6-93ca-2384a382cdd5@gmail.com>
Date: Tue, 2 Jan 2024 12:26:36 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Romain Gantois <romain.gantois@...tlin.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>, Maxime Coquelin
<mcoquelin.stm32@...il.com>, Miquel Raynal <miquel.raynal@...tlin.com>,
Maxime Chevallier <maxime.chevallier@...tlin.com>,
Sylvain Girard <sylvain.girard@...com>, Vladimir Oltean <olteanv@...il.com>,
Andrew Lunn <andrew@...n.ch>, Pascal EBERHARD <pascal.eberhard@...com>,
Richard Tresidder <rtresidd@...ctromag.com.au>,
Linus Walleij <linus.walleij@...aro.org>, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, stable@...r.kernel.org
Subject: Re: [PATCH net v2 1/1] net: stmmac: Prevent DSA tags from breaking
COE on stmmac
On 1/2/24 08:27, Romain Gantois wrote:
> Some DSA tagging protocols change the EtherType field in the MAC header
> e.g. DSA_TAG_PROTO_(DSA/EDSA/BRCM/MTK/RTL4C_A/SJA1105). On TX these tagged
> frames are ignored by the checksum offload engine and IP header checker of
> some stmmac cores.
>
> On RX, the stmmac driver wrongly assumes that checksums have been computed
> for these tagged packets, and sets CHECKSUM_UNNECESSARY.
>
> Add an additional check in the stmmac tx and rx hotpaths so that COE is
> deactivated for packets with ethertypes that will not trigger the COE and
> ip header checks.
>
> 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/
Fairly sure those should be Link: and Closes: should be used for bug
tracker entries.
> Signed-off-by: Romain Gantois <romain.gantois@...tlin.com>
> ---
> .../net/ethernet/stmicro/stmmac/stmmac_main.c | 21 ++++++++++++++++---
> 1 file changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 37e64283f910..bb2ae6b32b2f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -4371,6 +4371,17 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
> return NETDEV_TX_OK;
> }
>
> +/* Check if ethertype will trigger IP
> + * header checks/COE in hardware
> + */
> +static inline bool stmmac_has_ip_ethertype(struct sk_buff *skb)
> +{
> + __be16 proto = eth_header_parse_protocol(skb);
> +
> + return (proto == htons(ETH_P_IP)) || (proto == htons(ETH_P_IPV6)) ||
> + (proto == htons(ETH_P_8021Q));
Do you need to include ETH_P_8021AD in that list as well or is not
stmmac capable of checksuming beyond a single VLAN tag?
Thanks!
--
Florian
Powered by blists - more mailing lists