[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67e46c939bb3eb000c6e032b0b49c0ed58bd04a7.camel@mediatek.com>
Date: Wed, 29 May 2024 05:36:06 +0000
From: Bc-bocun Chen (陳柏村)
<bc-bocun.chen@...iatek.com>
To: Mark-MC Lee (李明昌) <Mark-MC.Lee@...iatek.com>,
"linux@...web.de" <linux@...web.de>, "nbd@....name" <nbd@....name>,
"lorenzo@...nel.org" <lorenzo@...nel.org>, Sean Wang
<Sean.Wang@...iatek.com>, "kuba@...nel.org" <kuba@...nel.org>,
"edumazet@...gle.com" <edumazet@...gle.com>, "pabeni@...hat.com"
<pabeni@...hat.com>, "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Mason-cw Chang (張哲維)
<Mason-cw.Chang@...iatek.com>, "linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
Chak-kei Lam (林澤基) <Chak-kei.Lam@...iatek.com>,
"john@...ozen.org" <john@...ozen.org>, "frank-w@...lic-files.de"
<frank-w@...lic-files.de>, Neal Yen (嚴仕佳)
<Neal.Yen@...iatek.com>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "daniel@...rotopia.org"
<daniel@...rotopia.org>
Subject: Re: [net v2] net: ethernet: mtk_eth_soc: handle dma buffer size soc
specific
On Mon, 2024-05-27 at 16:21 +0200, Frank Wunderlich wrote:
> From: Frank Wunderlich <frank-w@...lic-files.de>
>
> The mainline MTK ethernet driver suffers long time from rarly but
> annoying tx queue timeouts. We think that this is caused by fixed
> dma sizes hardcoded for all SoCs.
>
> Use the dma-size implementation from SDK in a per SoC manner.
>
> Fixes: 656e705243fd ("net-next: mediatek: add support for MT7623
> ethernet")
> Suggested-by: Daniel Golle <daniel@...rotopia.org>
> Signed-off-by: Frank Wunderlich <frank-w@...lic-files.de>
> ---
> sorry for multiple posting in first version
>
> based on SDK:
>
https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/fac194d6253d339e15c651c052b532a449a04d6e
>
> v2:
> - fix unused variable 'addr' in 32bit build
> ---
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 105 +++++++++++++----
> --
> drivers/net/ethernet/mediatek/mtk_eth_soc.h | 9 +-
> 2 files changed, 78 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index cae46290a7ae..f1ff1be73926 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
..............
> @@ -5176,6 +5201,8 @@ static const struct mtk_soc_data mt7981_data =
> {
> .desc_size = sizeof(struct mtk_tx_dma_v2),
> .dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
> .dma_len_offset = 8,
> + .dma_size = MTK_DMA_SIZE(4K),
> + .fq_dma_size = MTK_DMA_SIZE(2K),
> },
> .rx = {
> .desc_size = sizeof(struct mtk_rx_dma),
> @@ -5183,6 +5210,7 @@ static const struct mtk_soc_data mt7981_data =
> {
> .dma_l4_valid = RX_DMA_L4_VALID_V2,
> .dma_max_len = MTK_TX_DMA_BUF_LEN,
> .dma_len_offset = 16,
> + .dma_size = MTK_DMA_SIZE(1K),
> },
> };
>
> @@ -5202,6 +5230,8 @@ static const struct mtk_soc_data mt7986_data =
> {
> .desc_size = sizeof(struct mtk_tx_dma_v2),
> .dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
> .dma_len_offset = 8,
> + .dma_size = MTK_DMA_SIZE(4K),
> + .fq_dma_size = MTK_DMA_SIZE(2K),
> },
> .rx = {
> .desc_size = sizeof(struct mtk_rx_dma),
> @@ -5209,6 +5239,7 @@ static const struct mtk_soc_data mt7986_data =
> {
> .dma_l4_valid = RX_DMA_L4_VALID_V2,
> .dma_max_len = MTK_TX_DMA_BUF_LEN,
> .dma_len_offset = 16,
> + .dma_size = MTK_DMA_SIZE(1K),
> },
> };
>
> @@ -5228,6 +5259,8 @@ static const struct mtk_soc_data mt7988_data =
> {
> .desc_size = sizeof(struct mtk_tx_dma_v2),
> .dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
> .dma_len_offset = 8,
> + .dma_size = MTK_DMA_SIZE(4K),
> + .fq_dma_size = MTK_DMA_SIZE(4K),
> },
> .rx = {
> .desc_size = sizeof(struct mtk_rx_dma_v2),
> @@ -5235,6 +5268,7 @@ static const struct mtk_soc_data mt7988_data =
> {
> .dma_l4_valid = RX_DMA_L4_VALID_V2,
> .dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
> .dma_len_offset = 8,
> + .dma_size = MTK_DMA_SIZE(1K),
> },
> };
..............
Thank you for assisting in upstreaming this patch from the mainline MTK
driver.
Currently, the RSS feature has not been upstreamed. It is recommanded
to use 2048 DMADs for both TX and RX Rings on the MT7981/86/88.
Powered by blists - more mailing lists