From: "Arınç ÜNAL" <arinc.unal@arinc9.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Daniel Golle <daniel@makrotopia.org>,
DENG Qingfang <dqfext@gmail.com>,
Sean Wang <sean.wang@mediatek.com>, Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Russell King <linux@armlinux.org.uk>,
mithat.guner@xeront.com, erkin.bozoglu@xeront.com,
Bartel Eerdekens <bartel.eerdekens@constell8.be>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next v2 5/7] net: dsa: mt7530: simplify mt7530_setup_port6() and change to void
Date: Fri, 2 Feb 2024 13:30:02 +0300 [thread overview]
Message-ID: <5cb18ed0-784d-42d4-9462-9f7a149cb9a4@arinc9.com> (raw)
In-Reply-To: <20240201235704.6wxbkpli3dk4pn4w@skbuf>
On 2.02.2024 02:57, Vladimir Oltean wrote:
> On Tue, Jan 30, 2024 at 08:46:04PM +0300, Arınç ÜNAL wrote:
>> would supposedly achieve 2 Gbps TX & 2 Gbps RX
>
> Source? Commit 8efaa653a8a5 ("net: ethernet: mediatek: Add MT7621 TRGMII
> mode support") says "TRGMII speed is 1200MBit.".
That is for MT7621. It's claimed that TRGMII on MT7621 can only handle that
much. I already told you I'm doing the test on MT7623NI SoC.
MT7623 is ARM and more powerful. On that one, the PLL frequency can be set
all the way up to 362.5 MHz to provide 2900 Mbps (allegedly).
You can check the repository that the commit above links to for more
details:
https://github.com/BPI-SINOVOIP/BPI-R2-bsp/blob/591910e127cd9c811fe9e811ddb6c7278d8ed934/linux-mt/drivers/net/ethernet/raeth/Kconfig#L141
https://github.com/BPI-SINOVOIP/BPI-R2-bsp/blob/591910e127cd9c811fe9e811ddb6c7278d8ed934/linux-mt/drivers/net/ethernet/raeth/raeth_config.h#L201
https://github.com/BPI-SINOVOIP/BPI-R2-bsp/blob/591910e127cd9c811fe9e811ddb6c7278d8ed934/u-boot-mt/drivers/net/rt2880_eth.c#L2178
>
>> Unless the MediaTek SoC ethernet driver somehow caps TRGMII to 1 Gbps,
>> I consider this whole TRGMII shenanigans a scam
>
> I laughed :)
>
> You have to see whether the CPU isn't in fact at 100% already, becoming
> a bottleneck before the interface speed does.
I'm happy I'm entertaining you but you've got to give me a little credit.
:)
MT7621 won't even handle 1 Gbps RX & 1 Gbps TX. But if the IP traffic is
offloaded to the packet processing engine
(drivers/net/ethernet/mediatek/mtk_ppe_offload.c), there won't be any load
on the CPU.
table ip global {
flowtable f {
hook ingress priority 0
devices = { wan, lan1, lan2, lan3, lan4 }
flags offload
}
chain forward {
type filter hook forward priority 0
ip protocol { tcp, udp } flow offload @f
}
chain postrouting {
type nat hook postrouting priority 0
oifname "wan" masquerade
}
}
MT7623 can handle 1 Gbps RX & 1 Gbps without much CPU load. It performs the
same with or without hardware flow offloading, unlike MT7621.
The way I test this:
I do the test on a single computer. I have two gigabit ports on my
motherboard. I isolate a port by putting it on another network namespace to
do the test.
Client Network
iperf client: 192.168.2.2/24
router: 192.168.2.1/24
Server Network
router: 192.168.3.2/24
iperf server: 192.168.3.1/24
iperf Client
ip a add 192.168.2.2/24 dev enp9s0
ip l set up enp9s0
ip route add 192.168.3.1 via 192.168.2.1
iperf3 -c 192.168.3.1 --bidir -t 20
iperf Server
ip netns add iperfserver
ip link set dev eno1 netns iperfserver
ip netns exec iperfserver ip a add 192.168.3.1/24 dev eno1
ip netns exec iperfserver ip l set up eno1
ip netns exec iperfserver iperf3 -s
I did say I've done thorough testing.
>
> Also, mtk_eth_soc.c has an interesting comment "TRGMII is not permitted
> on MT7621 if using DDR2" - not sure if applicable to your setup or not.
My device has DDR3 memory. Also, with a device tree defining trgmii on a
link of MediaTek SoC MAC, that check should prevent the mtk_eth_soc driver
from configuring the MAC if the device has DDR2 memory, no?
>
> I just got myself an ASUS RT-AX1800U (uses the mt7621_asus_rt-ax53u.dts
> device tree AFAICT) which I'll be setting up with OpenWrt in the weeks
> to come, and on which I might also be able to run some tests from time
> to time.
Doing tests on MT7621 will be useless without utilising the PPE. To use it,
you can add these to /etc/config/firewall:
config defaults
...
option flow_offloading '1'
option flow_offloading_hw '1'
Or enable software flow offloading and hardware flow offloading options if
using LuCI. When both options are enabled, hardware flow offloading will be
used.
Make sure to change the PLL frequency on the MT7530 side to 150 MHz. It
operates at the standard RGMII frequency since commit 37c218d8021e ("net:
dsa: mt7530: fix corrupt frames using trgmii on 40 MHz XTAL MT7621").
For 40MHz XTAL:
0x0640 x 0d1,2 = 0x0780
For 25MHz XTAL:
0x0a00 x 0d1,2 = 0x0c00
Arınç
next prev parent reply other threads:[~2024-02-02 10:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 15:20 [PATCH net-next v2 0/7] MT7530 DSA Subdriver Improvements Act II Arınç ÜNAL via B4 Relay
2024-01-30 15:20 ` [PATCH net-next v2 1/7] net: dsa: mt7530: empty default case on mt7530_setup_port5() Arınç ÜNAL via B4 Relay
2024-01-30 15:20 ` [PATCH net-next v2 2/7] net: dsa: mt7530: call port 6 setup from mt7530_mac_config() Arınç ÜNAL via B4 Relay
2024-01-30 15:20 ` [PATCH net-next v2 3/7] net: dsa: mt7530: remove pad_setup function pointer Arınç ÜNAL via B4 Relay
2024-01-30 15:20 ` [PATCH net-next v2 4/7] net: dsa: mt7530: move XTAL check to mt7530_setup() Arınç ÜNAL via B4 Relay
2024-01-30 15:20 ` [PATCH net-next v2 5/7] net: dsa: mt7530: simplify mt7530_setup_port6() and change to void Arınç ÜNAL via B4 Relay
2024-01-30 15:59 ` Daniel Golle
2024-01-30 17:46 ` Arınç ÜNAL
2024-02-01 23:57 ` Vladimir Oltean
2024-02-02 10:30 ` Arınç ÜNAL [this message]
2024-01-30 15:20 ` [PATCH net-next v2 6/7] net: dsa: mt7530: correct port capabilities of MT7988 Arınç ÜNAL via B4 Relay
2024-02-02 0:05 ` Vladimir Oltean
2024-01-30 15:20 ` [PATCH net-next v2 7/7] net: dsa: mt7530: do not clear config->supported_interfaces Arınç ÜNAL via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5cb18ed0-784d-42d4-9462-9f7a149cb9a4@arinc9.com \
--to=arinc.unal@arinc9.com \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bartel.eerdekens@constell8.be \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=erkin.bozoglu@xeront.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=mithat.guner@xeront.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=sean.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox