aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2023-03-29 11:38:30 +0200
committerFelix Fietkau <nbd@nbd.name>2023-03-29 16:14:37 +0200
commit7472476aef263bbf49b19d084875caddb7fe8f2a (patch)
treefd464264d3789c40e4a27cb8e78c1a5359ccff65 /target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch
parent1c552eb44ddba4d8630eb3453b4f6dd8ef83b13a (diff)
downloadupstream-7472476aef263bbf49b19d084875caddb7fe8f2a.tar.gz
upstream-7472476aef263bbf49b19d084875caddb7fe8f2a.tar.bz2
upstream-7472476aef263bbf49b19d084875caddb7fe8f2a.zip
kernel: fix mtk_eth_soc throughput regressions on gigabit PHY ports
Fixes issues on MT7621 and MT7623 switch ports, and PHY ports on all SoC Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch')
-rw-r--r--target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch b/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch
new file mode 100644
index 0000000000..0aa9382b6b
--- /dev/null
+++ b/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch
@@ -0,0 +1,42 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Wed, 29 Mar 2023 16:02:54 +0200
+Subject: [PATCH] net: ethernet: mtk_eth_soc: fix remaining throughput
+ regression
+
+Based on further tests, it seems that the QDMA shaper is not able to
+perform shaping close to the MAC link rate without throughput loss.
+This cannot be compensated by increasing the shaping rate, so it seems
+to be an internal limit.
+
+Fix the remaining throughput regression by detecting that condition and
+limiting shaping to ports with lower link speed.
+
+This patch intentionally ignores link speed gain from TRGMII, because
+even on such links, shaping to 1000 Mbit/s incurs some throughput
+degradation.
+
+Fixes: f63959c7eec3 ("net: ethernet: mtk_eth_soc: implement multi-queue support for per-port queues")
+Reported-by: Frank Wunderlich <frank-w@public-files.de>
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -667,6 +667,7 @@ static void mtk_mac_link_up(struct phyli
+ MAC_MCR_FORCE_RX_FC);
+
+ /* Configure speed */
++ mac->speed = speed;
+ switch (speed) {
+ case SPEED_2500:
+ case SPEED_1000:
+@@ -3145,6 +3146,9 @@ found:
+ if (dp->index >= MTK_QDMA_NUM_QUEUES)
+ return NOTIFY_DONE;
+
++ if (mac->speed > 0 && mac->speed <= s.base.speed)
++ s.base.speed = 0;
++
+ mtk_set_queue_speed(eth, dp->index + 3, s.base.speed);
+
+ return NOTIFY_DONE;