From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E578F3D5FA for ; Sun, 29 Mar 2026 09:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9I9pWg1qiYfKGe+2u/Y2VqDef17Cucv2X9t5EHG/VHY=; b=ObtYcXg05fueh+U1wGct8AHuQG K/ADGSwdtMZYzyaJpzHLvW8teCbZLs2oEbUPa3YBh/SuCv/y7imX2MJWzFZhcVE5gyWsjT8c0EI9E oRMPHJNGfvxdf8kSjuzIe9rszGPj3Pz7i/Wz5Uka12koijftrpdbVGGXifUZY87z+CHX2NKLq75kE V2qCBZlWiCLXODNwY61Ex3FLa9GnPjYqJFqinpXHFAQhRydt8WwPK5gfzDI7dEBvd4sTu5645HHBc uBYglD3I/moHRLD+TlGP6b11+IucYul5DlEyNXjKkokkjePVLu8VOV1cjbBD93QHhF+JOto388Pnp kfNgXMjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w6mHG-00000009meW-08GN; Sun, 29 Mar 2026 09:17:50 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w6mHC-00000009me7-3J9g for linux-arm-kernel@lists.infradead.org; Sun, 29 Mar 2026 09:17:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9I9pWg1qiYfKGe+2u/Y2VqDef17Cucv2X9t5EHG/VHY=; b=KJhk2qyRb7hH9av5+qNwazNMTy /H/qCrwEypVy856dDzpTdNFAtkcNVVQQWMdtn7PtGZYzaC2M+en5DweQT9uriJql4SxDEPNXy1afc IytMSDELrmpfTx2w5SOY1FyFkgEOP36SNOVZ+6c0NPtSLbySQp4X2sqBWSsMYUKwnQVgm82tUpQBs Z+0NndiXiAcvInuKxbhUyAWkOxf184wn1GmoKnXd10wwoCrlsZWXbr1XnugFhNp2iWsmMocE8eNzN kFprirWTNz3gnTt0Cvn5AwxRcd+cgozm5qwxDdjJe5iYKCGu3FsQuQjxBm9jJrhicQAP0J6w3YjyF 4QLWLwLQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:47022) 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 1w6mH7-000000007oq-2vj2; Sun, 29 Mar 2026 10:17:42 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1w6mH6-000000001bg-0198; Sun, 29 Mar 2026 10:17:40 +0100 Date: Sun, 29 Mar 2026 10:17:39 +0100 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, Ong Boon Leong , Paolo Abeni Subject: Re: [PATCH net-next 06/10] net: stmmac: simplify GSO/TSO test in stmmac_xmit() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260329_021746_830719_EF792F49 X-CRM114-Status: GOOD ( 17.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Mar 28, 2026 at 09:37:07PM +0000, Russell King (Oracle) wrote: > +static void stmmac_set_gso_types(struct stmmac_priv *priv, bool tso) > +{ > + if (!tso) { > + priv->gso_enabled_types = 0; > + } else { > + /* Manage oversized TCP frames for GMAC4 device */ > + priv->gso_enabled_types = SKB_GSO_TCPV4 | SKB_GSO_TCPV6; > + if (priv->plat->core_type == DWMAC_CORE_GMAC4) > + priv->gso_enabled_types |= SKB_GSO_UDP_L4; I've been wondering whether keying all three of these off NETIF_F_TSO is correct. Shouldn't SKB_GSP_UDP_L4 be dependent on NETIF_F_GSO_UDP_L4? (The above code doesn't change the current driver behaviour, so this would be a separate fix.) > + } > +} > + > /** > * stmmac_tso_xmit - Tx entry point of the driver for oversized frames (TSO) > * @skb : the socket buffer > @@ -4671,7 +4683,6 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) > u32 queue = skb_get_queue_mapping(skb); > int nfrags = skb_shinfo(skb)->nr_frags; > unsigned int first_entry, tx_packets; > - int gso = skb_shinfo(skb)->gso_type; > struct stmmac_txq_stats *txq_stats; > struct dma_desc *desc, *first_desc; > struct stmmac_tx_queue *tx_q; > @@ -4683,14 +4694,9 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) > if (priv->tx_path_in_lpi_mode && priv->eee_sw_timer_en) > stmmac_stop_sw_lpi(priv); > > - /* Manage oversized TCP frames for GMAC4 device */ > - if (skb_is_gso(skb) && priv->tso) { > - if (gso & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) > - return stmmac_tso_xmit(skb, dev); > - if (priv->plat->core_type == DWMAC_CORE_GMAC4 && > - (gso & SKB_GSO_UDP_L4)) > - return stmmac_tso_xmit(skb, dev); > - } > + if (skb_is_gso(skb) && > + skb_shinfo(skb)->gso_type & priv->gso_enabled_types) > + return stmmac_tso_xmit(skb, dev); I'm also wondering whether we should check gso_type in our .ndo_features_check() method rather than here - if we get a GSO skb at this point for a type that we don't recognise, surely it is wrong to pass it via the normal skb transmission flow. Yet more worms in the stmmac can... :/ -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!