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 905C4C3ABAA for ; Sat, 3 May 2025 17:16: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: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=AqLjDszkCs88e23lghcMuWdKdhG4ziY/zsyUntUvNR0=; b=vOxjCKG+YbQ+61B5sSTHpSySkS HhKuGRnUtwMkuNfTNvoJEIbh4Tz2jVwFPEq20utj1eRguCPk/3oX9gUORSucfdaGLU+ZxCWYMjsTQ M0OSm9eIVQKBrt8faSxBa3IJ+yiI+MXnF1jtGNdjhbighn108pmZx1pB0DcKPvddnQvve8W532j9T sD/sULV/hFyk097dh9tYNhGxIIQNex3BCQ0JDA4bB56VgE2/ZvbVg63V6R2bg4i2ZWMgIQ1nR3J2S euYgx7pEceA9u0pzB8DcgnXoQUztOC2rmpDoggZaT5SXpxpZpZnKIHDDwMlI2EomamECrFMioLBSK NFYiBDZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uBGTf-00000004IZt-1dfV; Sat, 03 May 2025 17:16:39 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uBGRi-00000004ISf-3e85; Sat, 03 May 2025 17:14:40 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 18459A4B621; Sat, 3 May 2025 17:09:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24DAEC4CEE3; Sat, 3 May 2025 17:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746292477; bh=TO0GFJ0GhL304hsOhpjSdH3o1D4SYQYquYsY9RZQ6fs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NVNRyeU/8qZCUHMRmqHsxd5g3wj3Um9s0fPqjmF5GJy0xnk6UdVnLE3sQFHlaeyhH zLZ2LMG7iSw1jV21YXZZIntyIOzxPIVxMPUBSeP6M4B3rWXGiRp2/RzgsSZ6GalLQ7 Fy2CysyqQe2BR4bVNvFHxoL5QdtV9qWiXhaX8xaBdAI9IQDCffFWTb2HqsGh2ifmSN YG9NdFDUC93Y3SiJs32tmhMhEF826K6+hsMzufCcNKwJCfnPIUeSQFi22IGCQ90we1 /jNiPrzHvFDLIANuISVIYQpEolSAIm3ZIV2cQ6pJDa0Wf06n1YYmOEUlgrK9Qg9E8A 4jEBTpDVdslKA== Date: Sat, 3 May 2025 19:14:34 +0200 From: Lorenzo Bianconi To: Daniel Golle Cc: Felix Fietkau , Sean Wang , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Elad Yifee , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH net 1/2] net: ethernet: mtk_eth_soc: reset all TX queues on DMA free Message-ID: References: <27713d0004ead6e57d070f9e19c0d13709ba2512.1746285649.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Rv+qQaaENS0fon55" Content-Disposition: inline In-Reply-To: <27713d0004ead6e57d070f9e19c0d13709ba2512.1746285649.git.daniel@makrotopia.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250503_101439_035265_0F80B9E9 X-CRM114-Status: GOOD ( 20.45 ) 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 --Rv+qQaaENS0fon55 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > The purpose of resetting the TX queue is to reset the > byte and packet count as well as to clear the software > flow control XOFF bit. >=20 > MediaTek developers pointed out that netdev_reset_queue would only > resets queue 0 of the network device. >=20 > Queues that are not reset may cause unexpected issues. >=20 > Packets may stop being sent after reset and "transmit timeout" log may > be displayed. >=20 > Import fix from MediaTek's SDK to resolve this issue. >=20 > Link: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwr= t-feeds/+/319c0d9905579a46dc448579f892f364f1f84818 > Fixes: f63959c7eec31 ("net: ethernet: mtk_eth_soc: implement multi-queue = support for per-port queues") > Signed-off-by: Daniel Golle > --- > drivers/net/ethernet/mediatek/mtk_eth_soc.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/et= hernet/mediatek/mtk_eth_soc.c > index 217355d79bbb7..d6d4c2daebab0 100644 > --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c > +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c > @@ -3274,11 +3274,19 @@ static int mtk_dma_init(struct mtk_eth *eth) > static void mtk_dma_free(struct mtk_eth *eth) > { > const struct mtk_soc_data *soc =3D eth->soc; > - int i; > + int i, j, txqs =3D 1; > + > + if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) > + txqs =3D MTK_QDMA_NUM_QUEUES; > + > + for (i =3D 0; i < MTK_MAX_DEVS; i++) { > + if (!eth->netdev[i]) > + continue; > + > + for (j =3D 0; j < txqs; j++) > + netdev_tx_reset_queue(netdev_get_tx_queue(eth->netdev[i], j)); nit: you can use netdev_tx_reset_subqueue() here. Regards, Lorenzo > + } > =20 > - for (i =3D 0; i < MTK_MAX_DEVS; i++) > - if (eth->netdev[i]) > - netdev_reset_queue(eth->netdev[i]); > if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && eth->scratch_ring) { > dma_free_coherent(eth->dma_dev, > MTK_QDMA_RING_SIZE * soc->tx.desc_size, > --=20 > 2.49.0 --Rv+qQaaENS0fon55 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCaBZO+gAKCRA6cBh0uS2t rE0aAQDxoKadhJgML6RMtuWFIuS6nXVqip1kMkzOx8SOecG8mAEAu48++YTfL3y+ spXzcEGZDYYHs2oCuQXYweAp4NW2YAI= =Q4YT -----END PGP SIGNATURE----- --Rv+qQaaENS0fon55--