[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8bb00052-2e12-9767-27b9-f5a33a93fcc8@nbd.name>
Date: Wed, 29 Mar 2023 14:04:48 +0200
From: Felix Fietkau <nbd@....name>
To: Frank Wunderlich <frank-w@...lic-files.de>
Cc: netdev@...r.kernel.org, Daniel Golle <daniel@...rotopia.org>
Subject: Re: Aw: Re: Re: Re: [PATCH net] net: ethernet: mtk_eth_soc: fix tx
throughput regression with direct 1G links
On 27.03.23 19:28, Frank Wunderlich wrote:
>
>> Gesendet: Sonntag, 26. März 2023 um 22:09 Uhr
>> Von: "Felix Fietkau" <nbd@....name>
>> On 26.03.23 19:49, Frank Wunderlich wrote:
>> >> Gesendet: Sonntag, 26. März 2023 um 19:27 Uhr
>> >> Von: "Felix Fietkau" <nbd@....name>
>
>> >> On 26.03.23 19:10, Frank Wunderlich wrote:
>> >> >> Gesendet: Sonntag, 26. März 2023 um 17:56 Uhr
>> >> >> Von: "Felix Fietkau" <nbd@....name>
>
>> >> >> On 25.03.23 10:28, Frank Wunderlich wrote:
>> >> >> >> Gesendet: Freitag, 24. März 2023 um 15:04 Uhr
>> >> >> >> Von: "Felix Fietkau" <nbd@....name>
>
>> >> >> > thx for the fix, as daniel already checked it on mt7986/bpi-r3 i tested bpi-r2/mt7623
>> >> >> >
>> >> >> > but unfortunately it does not fix issue on bpi-r2 where the gmac0/mt7530 part is affected.
>> >> >> >
>> >> >> > maybe it needs a special handling like you do for mt7621? maybe it is because the trgmii mode used on this path?
>> >> >> Could you please test if making it use the MT7621 codepath brings back
>> >> >> performance? I don't have any MT7623 hardware for testing right now.
>
>> > used the CONFIG_MACH_MT7623 (which is set in my config) boots up fine, but did not fix the 622Mbit-tx-issue
>> >
>> > and i'm not sure i have tested it before...all ports of mt7531 are affected, not only wan (i remembered you asked for this)
>> Does the MAC that's connected to the switch use flow control? Can you
>> test if changing that makes a difference?
>
> it does use flow control/pause on mac and switch-port, disabled it, but it does not change anything (still ~620Mbit on tx)
I finally found a MT7623 device in my stash, so I could run some
experiments with it. For some reason I could only reproduce your tx
throughput values after switching off TRGMII. With TRGMII enabled, I got
around 864 Mbit/s, which is of course still lower than what I get with
shaping disabled.
I also experimented with bumping the shaping rate to higher values, but
got no changes in throughput at all.
Based on that, I'm beginning to think that the shaper simply can't
handle rates close to the MAC rate and runs into a fundamental limit
somehow.
Now that I think about it, I do remember that shaping to 2.5 Gbps on
MT7622 also reduced link throughput.
I think we should simply use this patch to deal with it. Do you agree?
- Felix
---
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -753,6 +753,7 @@ static void mtk_mac_link_up(struct phylink_config *config,
MAC_MCR_FORCE_RX_FC);
/* Configure speed */
+ mac->speed = speed;
switch (speed) {
case SPEED_2500:
case SPEED_1000:
@@ -3235,6 +3236,9 @@ static int mtk_device_event(struct notifier_block *n, unsigned long event, void
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;
Powered by blists - more mailing lists