From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Daniel Golle <daniel@makrotopia.org>
Cc: Felix Fietkau <nbd@nbd.name>, Sean Wang <sean.wang@mediatek.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Elad Yifee <eladwf@gmail.com>,
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
Date: Sat, 3 May 2025 19:14:34 +0200 [thread overview]
Message-ID: <aBZO-nmFoKLx5E5w@lore-desk> (raw)
In-Reply-To: <27713d0004ead6e57d070f9e19c0d13709ba2512.1746285649.git.daniel@makrotopia.org>
[-- Attachment #1: Type: text/plain, Size: 2027 bytes --]
> 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.
>
> MediaTek developers pointed out that netdev_reset_queue would only
> resets queue 0 of the network device.
>
> Queues that are not reset may cause unexpected issues.
>
> Packets may stop being sent after reset and "transmit timeout" log may
> be displayed.
>
> Import fix from MediaTek's SDK to resolve this issue.
>
> Link: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/319c0d9905579a46dc448579f892f364f1f84818
> Fixes: f63959c7eec31 ("net: ethernet: mtk_eth_soc: implement multi-queue support for per-port queues")
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/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 = eth->soc;
> - int i;
> + int i, j, txqs = 1;
> +
> + if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
> + txqs = MTK_QDMA_NUM_QUEUES;
> +
> + for (i = 0; i < MTK_MAX_DEVS; i++) {
> + if (!eth->netdev[i])
> + continue;
> +
> + for (j = 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
> + }
>
> - for (i = 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,
> --
> 2.49.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2025-05-03 17:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-03 15:24 [PATCH net 1/2] net: ethernet: mtk_eth_soc: reset all TX queues on DMA free Daniel Golle
2025-05-03 15:24 ` [PATCH net 2/2] net: mediatek: do not reset PSE when seting FE register Daniel Golle
2025-05-03 17:14 ` Lorenzo Bianconi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aBZO-nmFoKLx5E5w@lore-desk \
--to=lorenzo@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eladwf@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sean.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox