Skip to content

Commit e669ce4

Browse files
nbd168davem330
authored andcommitted
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: f63959c ("net: ethernet: mtk_eth_soc: implement multi-queue support for per-port queues") Tested-By: Frank Wunderlich <[email protected]> Reported-by: Frank Wunderlich <[email protected]> Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 089b91a commit e669ce4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,7 @@ static void mtk_mac_link_up(struct phylink_config *config,
753753
MAC_MCR_FORCE_RX_FC);
754754

755755
/* Configure speed */
756+
mac->speed = speed;
756757
switch (speed) {
757758
case SPEED_2500:
758759
case SPEED_1000:
@@ -3235,6 +3236,9 @@ static int mtk_device_event(struct notifier_block *n, unsigned long event, void
32353236
if (dp->index >= MTK_QDMA_NUM_QUEUES)
32363237
return NOTIFY_DONE;
32373238

3239+
if (mac->speed > 0 && mac->speed <= s.base.speed)
3240+
s.base.speed = 0;
3241+
32383242
mtk_set_queue_speed(eth, dp->index + 3, s.base.speed);
32393243

32403244
return NOTIFY_DONE;

0 commit comments

Comments
 (0)