1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 29 Mar 2023 16:02:54 +0200
3 Subject: [PATCH] net: ethernet: mtk_eth_soc: fix remaining throughput
6 Based on further tests, it seems that the QDMA shaper is not able to
7 perform shaping close to the MAC link rate without throughput loss.
8 This cannot be compensated by increasing the shaping rate, so it seems
9 to be an internal limit.
11 Fix the remaining throughput regression by detecting that condition and
12 limiting shaping to ports with lower link speed.
14 This patch intentionally ignores link speed gain from TRGMII, because
15 even on such links, shaping to 1000 Mbit/s incurs some throughput
18 Fixes: f63959c7eec3 ("net: ethernet: mtk_eth_soc: implement multi-queue support for per-port queues")
19 Reported-by: Frank Wunderlich <frank-w@public-files.de>
20 Signed-off-by: Felix Fietkau <nbd@nbd.name>
23 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
24 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
25 @@ -766,6 +766,7 @@ static void mtk_mac_link_up(struct phyli
33 @@ -3344,6 +3345,9 @@ found:
34 if (dp->index >= MTK_QDMA_NUM_QUEUES)
37 + if (mac->speed > 0 && mac->speed <= s.base.speed)
40 mtk_set_queue_speed(eth, dp->index + 3, s.base.speed);