kernel: bump 5.15 to 5.15.132
[openwrt/staging/stintel.git] / target / linux / generic / pending-5.15 / 732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch
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
4 regression
5
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.
10
11 Fix the remaining throughput regression by detecting that condition and
12 limiting shaping to ports with lower link speed.
13
14 This patch intentionally ignores link speed gain from TRGMII, because
15 even on such links, shaping to 1000 Mbit/s incurs some throughput
16 degradation.
17
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>
21 ---
22
23 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
24 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
25 @@ -723,6 +723,7 @@ static void mtk_mac_link_up(struct phyli
26 MAC_MCR_FORCE_RX_FC);
27
28 /* Configure speed */
29 + mac->speed = speed;
30 switch (speed) {
31 case SPEED_2500:
32 case SPEED_1000:
33 @@ -3292,6 +3293,9 @@ found:
34 if (dp->index >= MTK_QDMA_NUM_QUEUES)
35 return NOTIFY_DONE;
36
37 + if (mac->speed > 0 && mac->speed <= s.base.speed)
38 + s.base.speed = 0;
39 +
40 mtk_set_queue_speed(eth, dp->index + 3, s.base.speed);
41
42 return NOTIFY_DONE;