* [PATCH net V2] net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size
@ 2025-02-10 13:43 Huacai Chen
2025-02-13 4:06 ` Jakub Kicinski
2025-02-13 4:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Huacai Chen @ 2025-02-10 13:43 UTC (permalink / raw)
To: Huacai Chen, Andrew Lunn, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: Yanteng Si, Feiyang Chen, Alexandre Torgue, Jose Abreu,
Serge Semin, loongarch, netdev, linux-kernel, Huacai Chen, stable,
Simon Horman, Chong Qiao
Now for dwmac-loongson {tx,rx}_fifo_size are uninitialised, which means
zero. This means dwmac-loongson doesn't support changing MTU because in
stmmac_change_mtu() it requires the fifo size be no less than MTU. Thus,
set the correct tx_fifo_size and rx_fifo_size for it (16KB multiplied by
queue counts).
Here {tx,rx}_fifo_size is initialised with the initial value (also the
maximum value) of {tx,rx}_queues_to_use. So it will keep as 16KB if we
don't change the queue count, and will be larger than 16KB if we change
(decrease) the queue count. However stmmac_change_mtu() still work well
with current logic (MTU cannot be larger than 16KB for stmmac).
Note: the Fixes tag picked here is the oldest commit and key commit of
the dwmac-loongson series "stmmac: Add Loongson platform support".
Cc: stable@vger.kernel.org
Fixes: ad72f783de06 ("net: stmmac: Add multi-channel support")
Acked-by: Yanteng Si <si.yanteng@linux.dev>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Chong Qiao <qiaochong@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
V2: Update commit message and CC list.
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index bfe6e2d631bd..79acdf38c525 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -574,6 +574,9 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
if (ret)
goto err_disable_device;
+ plat->tx_fifo_size = SZ_16K * plat->tx_queues_to_use;
+ plat->rx_fifo_size = SZ_16K * plat->rx_queues_to_use;
+
if (dev_of_node(&pdev->dev))
ret = loongson_dwmac_dt_config(pdev, plat, &res);
else
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net V2] net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size
2025-02-10 13:43 [PATCH net V2] net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size Huacai Chen
@ 2025-02-13 4:06 ` Jakub Kicinski
2025-02-13 4:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2025-02-13 4:06 UTC (permalink / raw)
To: Huacai Chen
Cc: Huacai Chen, Andrew Lunn, David S . Miller, Eric Dumazet,
Paolo Abeni, Yanteng Si, Feiyang Chen, Alexandre Torgue,
Jose Abreu, Serge Semin, loongarch, netdev, linux-kernel, stable,
Simon Horman, Chong Qiao
On Mon, 10 Feb 2025 21:43:28 +0800 Huacai Chen wrote:
> Now for dwmac-loongson {tx,rx}_fifo_size are uninitialised, which means
> zero. This means dwmac-loongson doesn't support changing MTU because in
> stmmac_change_mtu() it requires the fifo size be no less than MTU. Thus,
> set the correct tx_fifo_size and rx_fifo_size for it (16KB multiplied by
> queue counts).
Not all drivers support changing MTU. Supporting jumbo frames
is a feature, so this commit enables the use of a feature.
As such it is not a fix. I'm applying this to net-next.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net V2] net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size
2025-02-10 13:43 [PATCH net V2] net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size Huacai Chen
2025-02-13 4:06 ` Jakub Kicinski
@ 2025-02-13 4:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-02-13 4:10 UTC (permalink / raw)
To: Huacai Chen
Cc: chenhuacai, andrew+netdev, davem, edumazet, kuba, pabeni,
si.yanteng, chris.chenfeiyang, alexandre.torgue, joabreu,
fancer.lancer, loongarch, netdev, linux-kernel, stable, horms,
qiaochong
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 10 Feb 2025 21:43:28 +0800 you wrote:
> Now for dwmac-loongson {tx,rx}_fifo_size are uninitialised, which means
> zero. This means dwmac-loongson doesn't support changing MTU because in
> stmmac_change_mtu() it requires the fifo size be no less than MTU. Thus,
> set the correct tx_fifo_size and rx_fifo_size for it (16KB multiplied by
> queue counts).
>
> Here {tx,rx}_fifo_size is initialised with the initial value (also the
> maximum value) of {tx,rx}_queues_to_use. So it will keep as 16KB if we
> don't change the queue count, and will be larger than 16KB if we change
> (decrease) the queue count. However stmmac_change_mtu() still work well
> with current logic (MTU cannot be larger than 16KB for stmmac).
>
> [...]
Here is the summary with links:
- [net,V2] net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size
https://git.kernel.org/netdev/net-next/c/8dbf0c755645
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-13 4:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 13:43 [PATCH net V2] net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size Huacai Chen
2025-02-13 4:06 ` Jakub Kicinski
2025-02-13 4:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).