From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A226D1E9B1A for ; Mon, 23 Feb 2026 11:24:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771845901; cv=none; b=CojLQXq+4vnNm2pxzu6xLgHapG/tsTsXnUrl7kUfkGqsDX/a0QKS3cQawECUh8u2mSaBQyWF9sCAs0jh5cffa0zzBi/EoTQdBSOEGJmJWnOtuOG0E71+t3WRIF6jMp1K29hSljcvkML7x7QXYTFJMcPPZsFDACsvueOfn3V0EdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771845901; c=relaxed/simple; bh=guScEY3dPd7AmDH3BtW0PqB1E7MBGZSoHvJU7aNptLA=; h=From:To:Cc:Subject:MIME-Version:Content-Disposition:Content-Type: Message-Id:Date; b=QfmzhqKKdxXXVjyA1KW7gg/Iw/4+L/21W+RAt/AhS6kkQDukk9o2uuer5PDb40zK7aUXieaOeObf7j+hIiIU57jFnMCGw10cuo0ETOt+KnH69Ss93tu2iuWXy3xogqVdbxKKrJ5KIeNsfgxtNbmxLQmzXe/PYE0cpq5nkZCu0+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=ldmf4dqb; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="ldmf4dqb" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4TUBah16GDdhtaKN61j6qNC6e187hWuNZSPnIGunkaw=; b=ldmf4dqbIJ3Gox+YeX2Xt8Y5LB +wDBfhh0dm00zjJym+zp2X9/5D/n5ylJWylwro9vWWWZ6RXZxj6blJK3CYbwlrGuuthCl2o60NiSE eAz+7iKEGEbIs7oCXiv79ZahT0/4YmTXh9MBpGkt6WOHaPfKMKnIk1vy0CU2lBWpI4zyK9L7Ea7CF RkRfL+gzsVAcN8iXeB9lp6sXZehZQKZtI1NZOWSJDjRJwSmy3oEJw3mxjsEvjkbFEp1b2j/9Mjxe6 j3clX/cpymOnCuJKSGKg2gvGm6En3y3JKtOd9WaaG0uQYJfj1emqukt3vRP181jgrl7jwSU82UkwQ 6tjaeHEg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:45166 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vuU3Y-000000003xp-04Ul; Mon, 23 Feb 2026 11:24:52 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vuU3X-0000000Ae9G-1Er8; Mon, 23 Feb 2026 11:24:51 +0000 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next] net: stmmac: fix .ndo_fix_features() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Mon, 23 Feb 2026 11:24:51 +0000 netdev features documentation requires that .ndo_fix_features() is stateless: it shouldn't modify driver state. Yet, stmmac_fix_features() does exactly that, changing whether GSO frames are processed by the driver. Move this code to stmmac_set_features() instead, which is the correct place for it. We don't need to check whether TSO is supported; this is already handled via the setup of netdev->hw_features, and we are guaranteed that if netdev->hw_features indicates that a feature is not supported, .ndo_set_features() won't be called with it set. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 82375d34ad57..a2a0985e8c37 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6105,14 +6105,6 @@ static netdev_features_t stmmac_fix_features(struct net_device *dev, if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN)) features &= ~NETIF_F_CSUM_MASK; - /* Disable tso if asked by ethtool */ - if ((priv->plat->flags & STMMAC_FLAG_TSO_EN) && (priv->dma_cap.tsoen)) { - if (features & NETIF_F_TSO) - priv->tso = true; - else - priv->tso = false; - } - return features; } @@ -6144,6 +6136,8 @@ static int stmmac_set_features(struct net_device *netdev, else priv->hw->hw_vlan_en = false; + priv->tso = !!(features & NETIF_F_TSO); + phylink_rx_clk_stop_block(priv->phylink); stmmac_set_hw_vlan_mode(priv, priv->hw); phylink_rx_clk_stop_unblock(priv->phylink); -- 2.47.3