🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by James Hilliard Mon, 16 Nov 2026 00:49
[PATCH net] net: stmmac: preserve RX checksum capability when offload is disabled
#16879
Author: James Hilliard
Date: Mon, 16 Nov 2026 00:49
42 lines
12776 bytes
The GMAC, GMAC4 and XGMAC rx_ipc callbacks return whether checksum offload
is enabled after programming the requested state. A zero return is
therefore expected when hw->rx_csum is zero.

stmmac_hw_setup() treats every zero return as a lack of hardware support
and clears plat->rx_coe. Disabling RX checksum offload with ethtool and
then reopening the interface loses the saved capability. Subsequent
attempts to enable offload are rejected by stmmac_fix_features(), which
uses plat->rx_coe to filter NETIF_F_RXCSUM.

Only clear the capability if offload was requested but could not be
enabled. Keep calling rx_ipc when offload is disabled so that the hardware
is still programmed with the requested state.

Fixes: 0f280e4d23c2 ("stmmac: fix the rx csum feature")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 25894771e9e9..e162976be2e6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3723,7 +3723,7 @@ static int stmmac_hw_setup(struct net_device *dev)
 	stmmac_safety_feat_configuration(priv);
 
 	ret = stmmac_rx_ipc(priv, priv->hw);
-	if (!ret) {
+	if (priv->hw->rx_csum && !ret) {
 		netdev_warn(priv->dev, "RX IPC Checksum Offload disabled\n");
 		priv->plat->rx_coe = STMMAC_RX_COE_NONE;
 		priv->hw->rx_csum = 0;

---
base-commit: aa40afa831ebfe45e40a23721711059f2ac584d4
change-id: 20261115-submit-stmmac-rx-checksum-capability-v1-ef6645788992

Best regards,
--  
James Hilliard <james.hilliard1@gmail.com>
Re: [PATCH net] net: stmmac: preserve RX checksum capability when offload is disabled
#18098
Author: Lorenzo Bianconi
Date: Tue, 17 Nov 2026 20:34
72 lines
17484 bytes
--uhqeACAWVMDeZ6jG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> Hi James,
>=20
> On 11/16/26 01:49, James Hilliard wrote:
> > The GMAC, GMAC4 and XGMAC rx_ipc callbacks return whether checksum offl=
oad
> > is enabled after programming the requested state. A zero return is
> > therefore expected when hw->rx_csum is zero.
> >=20
> > stmmac_hw_setup() treats every zero return as a lack of hardware support
> > and clears plat->rx_coe. Disabling RX checksum offload with ethtool and
> > then reopening the interface loses the saved capability. Subsequent
> > attempts to enable offload are rejected by stmmac_fix_features(), which
> > uses plat->rx_coe to filter NETIF_F_RXCSUM.
> >=20
> > Only clear the capability if offload was requested but could not be
> > enabled. Keep calling rx_ipc when offload is disabled so that the hardw=
are
> > is still programmed with the requested state.
> >=20
> > Fixes: 0f280e4d23c2 ("stmmac: fix the rx csum feature")
>=20
> This tag doesn't exist :
>=20
> https://netdev-ctrl.bots.linux.dev/logview.html?f=3D/logs/build/1212156/1=
4986330/verify_fixes/stdout
>=20
> Besides that, this is legit. Tested on AgileX5, CycloneV and stm32mp1:
>=20
> ip l s eth0 up
> ethtool -K eth0 rx off
> ip l s eth0 down;
> ip l s eth0 up
> ethtool -K eth0 rx on
>=20
> Without patch:
> ethtool -k eth0 =3D> rx-checksumming off
>=20
> With:
> ethtool -k eth0 =3D> rx-checksumming on
>=20
> Please respin with a correct Fixes, feel free to add :
>=20
> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
>=20
> Maxime
>=20
> pw-bot: cr
>=20
>=20

Reviewed-by:Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>


--uhqeACAWVMDeZ6jG
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCavy6WwAKCRA6cBh0uS2t
rF/MAQC94F9flu7V6ymO/GXi8P606jehIfn/ClLwmubRWdBLwgD+NBZl2irSTcCd
Ctt9MnmK8y9WyqY20+Ps+VFO9H9BxwU=
=Jn6z
-----END PGP SIGNATURE-----

--uhqeACAWVMDeZ6jG--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads