2
0

732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From: Felix Fietkau <[email protected]>
  2. Date: Wed, 29 Mar 2023 16:02:54 +0200
  3. Subject: [PATCH] net: ethernet: mtk_eth_soc: fix remaining throughput
  4. regression
  5. Based on further tests, it seems that the QDMA shaper is not able to
  6. perform shaping close to the MAC link rate without throughput loss.
  7. This cannot be compensated by increasing the shaping rate, so it seems
  8. to be an internal limit.
  9. Fix the remaining throughput regression by detecting that condition and
  10. limiting shaping to ports with lower link speed.
  11. This patch intentionally ignores link speed gain from TRGMII, because
  12. even on such links, shaping to 1000 Mbit/s incurs some throughput
  13. degradation.
  14. Fixes: f63959c7eec3 ("net: ethernet: mtk_eth_soc: implement multi-queue support for per-port queues")
  15. Reported-by: Frank Wunderlich <[email protected]>
  16. Signed-off-by: Felix Fietkau <[email protected]>
  17. ---
  18. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  19. +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  20. @@ -767,6 +767,7 @@ static void mtk_mac_link_up(struct phyli
  21. MAC_MCR_FORCE_RX_FC);
  22. /* Configure speed */
  23. + mac->speed = speed;
  24. switch (speed) {
  25. case SPEED_2500:
  26. case SPEED_1000:
  27. @@ -3348,6 +3349,9 @@ found:
  28. if (dp->index >= MTK_QDMA_NUM_QUEUES)
  29. return NOTIFY_DONE;
  30. + if (mac->speed > 0 && mac->speed <= s.base.speed)
  31. + s.base.speed = 0;
  32. +
  33. mtk_set_queue_speed(eth, dp->index + 3, s.base.speed);
  34. return NOTIFY_DONE;