[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240102162718.268271-1-romain.gantois@bootlin.com>
Date: Tue, 2 Jan 2024 17:27:14 +0100
From: Romain Gantois <romain.gantois@...tlin.com>
To: Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>
Cc: Romain Gantois <romain.gantois@...tlin.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>,
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
Subject: [PATCH net v2 0/1] Prevent DSA tags from breaking COE
Hello everyone,
This is the second version of my proposed fix for the stmmac checksum
offloading issue that has recently been reported.
significant changes in v2:
- replaced the stmmac_link_up-based fix with an ethertype check in the TX
and RX hotpaths.
The Checksum Offloading Engine of some stmmac cores (e.g. DWMAC1000)
computes an incorrect checksum when presented with DSA-tagged packets. This
causes all TCP/UDP transfers to break when the stmmac device is connected
to the CPU port of a DSA switch.
I ran some tests using different tagging protocols with DSA_LOOP, and all
of the protocols that set a custom ethertype field in the MAC header caused
the checksum offload engine to ignore the tagged packets. On TX, this
caused packets to egress with incorrect checksums. On RX, these packets
were similarly ignored by the COE, yet the stmmac driver set
CHECKSUM_UNNECESSARY, wrongly assuming that their checksums had been
verified in hardware.
Version 2 of this patch series fixes this issue by checking ethertype
fields in both the TX and RX hotpaths of the stmmac driver. On TX, if a
non-IP ethertype is detected, the packet is checksummed in software. On
RX, the same condition causes stmmac to avoid setting CHECKSUM_UNNECESSARY.
To measure the performance degradation to the TX/RX hotpaths, I did some
iperf3 runs with 512-byte unfragmented UDP packets.
measured degradation on TX: -670 pps (-2.9%) on RX: -485 pps (-1.7%)
original performances on TX: 22kpps on RX: 27kpps
The performance hit on the RX path can be partly explained by the fact that
the stmmac driver doesn't set CHECKSUM_UNNECESSARY anymore.
The slightly higher TX degradation is harder to explain but I should note
that the external PHYs used in my setup have been causing performance
issues on TX, which could be affecting the results.
Best Regards,
Romain
Romain Gantois (1):
net: stmmac: Prevent DSA tags from breaking COE on stmmac
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 21 ++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
--
2.43.0
Powered by blists - more mailing lists