From patchwork Thu Jan 25 12:34:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 13530856 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 1D47FC47258 for ; Thu, 25 Jan 2024 13:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pDHSEcfp4++NO84og5cYkJvjC6zH/5Afts/a5R8cFVw=; b=soS9Hh9xq9nyia t6NiPZpCjxhpbiy9zQ4UEOaiAuyWY+JsNerYjzL+oVzz787P4goB0pBDlotl48Y3InFSaVH/K98jG Tbl6df/2s5ahPUy+bF3aSUgX49RvrisP6HtMVbVZHIdYGikF+v2CDbKZYG9On8xH5yJd5aemL7/VO 5wQdtrnDJmOAMdfx32Ijp8sbstO3kJljmHJc+5X5mYlaZvC9FD9pNdTYvrrkleFN8mr9GhXWAPji1 BnbxmhSCHkgYhhqmrtSmBJknHb1qTVcU6W63KgcK2jH0AK/1Aw6Aa1NzT0hDIxbExg9ys3yACsoWG qSLp2z+bVqfSg2YKgCNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT0FR-00000000BFt-1SYP; Thu, 25 Jan 2024 13:58:29 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT0FQ-00000000BF2-00zo for linux-arm-kernel@bombadil.infradead.org; Thu, 25 Jan 2024 13:58:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=O99d2OhA5yD9439wbiGDNw8gbQ6j47VNjuChaGpSepE=; b=P1rarklsPggPJTQwLlbEBSH+nZ hsuGXCJicT5H88F0ks+sslwNl1SOgPSn83kLH0qYUUcJ25kU1eXaWsMTceRtLIIe0W4bLWtGnHjz+ IXf643THvOwRjqbEaxj6FPFeUMyeCiGBGLOHs2Qe/fAU/ZjmExKABp0Gctp6z4cqlMJ668kJEYATP PFSUNN7u9sue+N0miMAkQ/ilRcxUwo5iFCW1juKfrAl0vG+XqL9HcZasZ/zJXO98hG8AtNhCJmcHq 1hT7Q+KCCQ0Kl6I/23/+1nOfuC3SqsZ7ZQlKRPnNbhUIJnnUV+U0/4+kzR9+aT7PUV1fm0DAmooEL mZAsvMVw==; Received: from www530.your-server.de ([188.40.30.78]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rSywN-00000005JQa-1RVU for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 12:34:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=O99d2OhA5yD9439wbiGDNw8gbQ6j47VNjuChaGpSepE=; b=sGzqxBb73IUlg1OF5UY4xH9Z5F AysdrkIa0xJpoLD8gMXgkc/z5ha1KwdVV70NGn5p3Dh+kUkcO77WgN+qRvnRcxFoMfOXPTHxuSBQH uVZVmh4+4NRKVv4XnENVG4mX0vp7nORlguxiznDauOvXjdY8I5wpV9o5+zwSaA5DBWAqdvHQdX/6E DzlIA7SjLnFbKzdxDh4LfscplRPCKXcbCl6sHBWda0fjBDge9cS4Po29celBW83U+Vy5Dth535GqM c60paXmj8wDQd5j4JcPSLw6by9EabOYS24CdkV3ildwunOpoQvv1rL4gKLgBNoXiSQu3e7SMPI8Je miA9LTbw==; Received: from sslproxy02.your-server.de ([78.47.166.47]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSywH-0007Q2-4N; Thu, 25 Jan 2024 13:34:37 +0100 Received: from [185.17.218.86] (helo=localhost) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rSywG-00028s-9l; Thu, 25 Jan 2024 13:34:36 +0100 From: Esben Haabendal To: netdev@vger.kernel.org, Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Christian Marangi Cc: stable@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] net: stmmac: do not clear TBS enable bit on link up/down Date: Thu, 25 Jan 2024 13:34:33 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Authenticated-Sender: esben@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27165/Thu Jan 25 10:51:15 2024) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240125_123443_464937_E3A83645 X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. 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 With the dma conf being reallocated on each call to stmmac_open(), any information in there is lost, unless we specifically handle it. The STMMAC_TBS_EN bit is set when adding an etf qdisc, and the etf qdisc therefore would stop working when link was set down and then back up. Fixes: ba39b344e924 ("net: ethernet: stmicro: stmmac: generate stmmac dma conf before open") Cc: stable@vger.kernel.org Signed-off-by: Esben Haabendal --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b334eb16da23..25519952f754 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3932,6 +3932,9 @@ static int __stmmac_open(struct net_device *dev, priv->rx_copybreak = STMMAC_RX_COPYBREAK; buf_sz = dma_conf->dma_buf_sz; + for (int i = 0; i < MTL_MAX_TX_QUEUES; i++) + if (priv->dma_conf.tx_queue[i].tbs & STMMAC_TBS_EN) + dma_conf->tx_queue[i].tbs = priv->dma_conf.tx_queue[i].tbs; memcpy(&priv->dma_conf, dma_conf, sizeof(*dma_conf)); stmmac_reset_queues_param(priv); From patchwork Thu Jan 25 12:34:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 13530857 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 8203CC47258 for ; Thu, 25 Jan 2024 13:58:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=emnCGoccOcDXk3n+BveRPtFw0NbyrJXjwk1qmK4l6Ig=; b=OS8Au8dFr3hmv+ uMF7QDMfvat6mLBE96qycongGoTJfbrE1po1ONr4f72GtL7c3CexwYe8k7Ayuq5ETYfkWthQiPQVN Rze1nPdUojKdn/OwYgsX8Ct4o1bXZIt9FKrY1WQ5HGuB1SRUOjnOuaHhTujM/A4J4ZONBuPmtze3L h7UHO9fz75BcOzR8GVSJT1l8JW7gARa/4bwP5FVsHPDqX8sm+wUEaGFauov7NyqNYYmxwnFUvEUts TbDYUUllOsgHZxpe72y96CotBHQPgKmElu0r+0jRWZNqPi10q5u2HxnJm8y7p5Vts90zPxF0IdBol 1F55NeRm8pcwFXZgOoGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT0Fc-00000000BJZ-1z1f; Thu, 25 Jan 2024 13:58:40 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT0Fa-00000000BIo-2cGQ for linux-arm-kernel@bombadil.infradead.org; Thu, 25 Jan 2024 13:58:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=RGm3cvG/FSHbu0unNfOng+T3r1yzerASsV1ePVGWH6w=; b=qdpP+wGyxp5CmfofiIaK8J17jO lbbHxrY2wH2yE9lO0WfpceAFgLw6erUG5scDy/rvAmyRmyZ2lBjp8lkbbQvZRRzVamfZNsmbdCZNZ SL07tUGvehguqqgGLcUwBPllw08mDOLIEDqHW47RJyZPgdsAVRCkgQ0sYh3c2NbhZaudhZEizxwXz KJqyLgxRbDZ+yZ6ZOwzMl/Q7er7zDluTQFr15mJ/rfDgj3PlJ9A0yeLvjVeGxC7JEgtSAGcsuXkm5 ZlHUU8NB1ymmrsf6f49GgQSzdWPP9Mwcn8UPUxiF7TEHQcxkt/5rgtcVOV47P1J7aAlz7/kA5kXR/ 8clCdL1w==; Received: from www530.your-server.de ([188.40.30.78]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rSywN-00000005JQZ-1Rg9 for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 12:34:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=RGm3cvG/FSHbu0unNfOng+T3r1yzerASsV1ePVGWH6w=; b=TJlznXiO0cIAK+jP6jbhWJsSJH krsnIMdXoKbYVw14uv1Den1gJgJLs14y6VMBaxKujr0M0eaKtSRsrIcuf+0MsWDPxjlq8QUM3JcyE 18eNxt3LT/nftstmpvXEi7xKXHS3x/hkBZvRl3Q1hUfivyojoSwbKt5uw2Ra4+siT+xCmLrs06QYm nO3RTqfaH/VU5MkBZyCevNv4dXJwKpuQzXUyuqwujYVMYQj4QbY5Mj+kIaxZipDnny+ishJKGxdFO RHYryUL20/e/0gcHBDOQvq8IbnKTvMxf247BAnlBtrlNoF105KN8VajjacSzeIN2YIZxLJuGuB3d4 yg4Krd6g==; Received: from sslproxy02.your-server.de ([78.47.166.47]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSywI-0007QC-2M; Thu, 25 Jan 2024 13:34:38 +0100 Received: from [185.17.218.86] (helo=localhost) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rSywH-0002CN-04; Thu, 25 Jan 2024 13:34:37 +0100 From: Esben Haabendal To: netdev@vger.kernel.org, Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] net: stmmac: dwmac-imx: set TSO/TBS TX queues default settings Date: Thu, 25 Jan 2024 13:34:34 +0100 Message-ID: <5606bb5f0b7566a20bb136b268dae89d22a48898.1706184304.git.esben@geanix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Authenticated-Sender: esben@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27165/Thu Jan 25 10:51:15 2024) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240125_123443_498915_209C963D X-CRM114-Status: GOOD ( 11.39 ) 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 TSO and TBS cannot coexist. For now we set i.MX Ethernet QOS controller to use TX queue with TSO and the rest for TBS. TX queues with TBS can support etf qdisc hw offload. Signed-off-by: Esben Haabendal --- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c index 8f730ada71f9..c42e8f972833 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c @@ -353,6 +353,12 @@ static int imx_dwmac_probe(struct platform_device *pdev) if (data->flags & STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY) plat_dat->flags |= STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY; + for (int i = 0; i < plat_dat->tx_queues_to_use; i++) { + /* Default TX Q0 to use TSO and rest TXQ for TBS */ + if (i > 0) + plat_dat->tx_queues_cfg[i].tbs_en = 1; + } + plat_dat->host_dma_width = dwmac->ops->addr_width; plat_dat->init = imx_dwmac_init; plat_dat->exit = imx_dwmac_exit;