linux/drivers/net/dsa
Vladimir Oltean b79d7c14f4 net: dsa: introduce preferred_default_local_cpu_port and use on MT7530
Since the introduction of the OF bindings, DSA has always had a policy that
in case multiple CPU ports are present in the device tree, the numerically
smallest one is always chosen.

The MT7530 switch family, except the switch on the MT7988 SoC, has 2 CPU
ports, 5 and 6, where port 6 is preferable on the MT7531BE switch because
it has higher bandwidth.

The MT7530 driver developers had 3 options:
- to modify DSA when the MT7531 switch support was introduced, such as to
  prefer the better port
- to declare both CPU ports in device trees as CPU ports, and live with the
  sub-optimal performance resulting from not preferring the better port
- to declare just port 6 in the device tree as a CPU port

Of course they chose the path of least resistance (3rd option), kicking the
can down the road. The hardware description in the device tree is supposed
to be stable - developers are not supposed to adopt the strategy of
piecemeal hardware description, where the device tree is updated in
lockstep with the features that the kernel currently supports.

Now, as a result of the fact that they did that, any attempts to modify the
device tree and describe both CPU ports as CPU ports would make DSA change
its default selection from port 6 to 5, effectively resulting in a
performance degradation visible to users with the MT7531BE switch as can be
seen below.

Without preferring port 6:

[ ID][Role] Interval           Transfer     Bitrate         Retr
[  5][TX-C]   0.00-20.00  sec   374 MBytes   157 Mbits/sec  734    sender
[  5][TX-C]   0.00-20.00  sec   373 MBytes   156 Mbits/sec    receiver
[  7][RX-C]   0.00-20.00  sec  1.81 GBytes   778 Mbits/sec    0    sender
[  7][RX-C]   0.00-20.00  sec  1.81 GBytes   777 Mbits/sec    receiver

With preferring port 6:

[ ID][Role] Interval           Transfer     Bitrate         Retr
[  5][TX-C]   0.00-20.00  sec  1.99 GBytes   856 Mbits/sec  273    sender
[  5][TX-C]   0.00-20.00  sec  1.99 GBytes   855 Mbits/sec    receiver
[  7][RX-C]   0.00-20.00  sec  1.72 GBytes   737 Mbits/sec   15    sender
[  7][RX-C]   0.00-20.00  sec  1.71 GBytes   736 Mbits/sec    receiver

Using one port for WAN and the other ports for LAN is a very popular use
case which is what this test emulates.

As such, this change proposes that we retroactively modify stable kernels
(which don't support the modification of the CPU port assignments, so as to
let user space fix the problem and restore the throughput) to keep the
mt7530 driver preferring port 6 even with device trees where the hardware
is more fully described.

Fixes: c288575f78 ("net: dsa: mt7530: Add the support of MT7531 switch")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-06-20 09:40:26 +01:00
..
b53 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-03-30 14:43:03 -07:00
hirschmann net: dsa: hellcreek: Get rid of custom led_init_default_state_get() 2023-03-16 17:02:56 -07:00
microchip Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-04-20 16:29:51 -07:00
mv88e6xxx net: dsa: mv88e6xxx: Increase wait after reset deactivation 2023-06-01 15:46:46 +02:00
ocelot net: dsa: felix: fix taprio guard band overflow at 10Mbps with jumbo frames 2023-06-14 23:05:48 -07:00
qca net: dsa: qca8k: add CONFIG_LEDS_TRIGGERS dependency 2023-06-02 10:55:41 +01:00
realtek Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-03-30 14:43:03 -07:00
sja1105 net: Remove C45 check in C22 only MDIO bus drivers 2023-01-20 18:12:45 -08:00
xrs700x net: dsa: xrs700x: Convert to i2c's .probe_new() 2022-11-23 12:50:06 -08:00
bcm_sf2_cfp.c net: dsa: introduce dsa_port_get_master() 2022-09-20 10:32:35 +02:00
bcm_sf2_regs.h
bcm_sf2.c net: dsa: bcm_sf2: remove unnecessary platform_set_drvdata() 2022-09-22 19:30:35 -07:00
bcm_sf2.h
dsa_loop_bdinfo.c
dsa_loop.c net: dsa: Fix possible memory leaks in dsa_loop_init() 2022-10-28 10:32:59 +01:00
dsa_loop.h
Kconfig net: dsa: mt7530: introduce driver for MT7988 built-in switch 2023-04-03 10:13:01 +01:00
lan9303_i2c.c net: dsa: lan9303: drop of_match_ptr for ID table 2023-03-15 08:11:01 +00:00
lan9303_mdio.c net: dsa: lan9303: drop of_match_ptr for ID table 2023-03-15 08:11:01 +00:00
lan9303-core.c net: dsa: lan9303: allow vid != 0 in port_fdb_{add|del} methods 2023-06-01 21:45:22 -07:00
lan9303.h
lantiq_gswip.c net: dsa: lantiq_gswip: mark OF related data as maybe unused 2023-03-15 08:11:01 +00:00
lantiq_pce.h
Makefile net: dsa: mt7530: introduce driver for MT7988 built-in switch 2023-04-03 10:13:01 +01:00
mt7530-mdio.c net: dsa: mt7530: fix support for MT7531BE 2023-04-19 17:37:45 -07:00
mt7530-mmio.c net: dsa: mt7530: introduce driver for MT7988 built-in switch 2023-04-03 10:13:01 +01:00
mt7530.c net: dsa: introduce preferred_default_local_cpu_port and use on MT7530 2023-06-20 09:40:26 +01:00
mt7530.h net: dsa: mt7530: fix handling of LLDP frames 2023-06-20 09:40:26 +01:00
mv88e6060.c net: dsa: mv88e6060: remove unnecessary dev_set_drvdata() 2022-09-22 19:30:37 -07:00
mv88e6060.h
rzn1_a5psw.c net: dsa: rzn1-a5psw: disable learning for standalone ports 2023-05-13 17:06:38 +01:00
rzn1_a5psw.h net: dsa: rzn1-a5psw: fix STP states handling 2023-05-13 17:06:38 +01:00
vitesse-vsc73xx-core.c
vitesse-vsc73xx-platform.c net: dsa: vitesse-vsc73xx: remove unnecessary set_drvdata() 2022-09-22 19:30:39 -07:00
vitesse-vsc73xx-spi.c net: dsa: vitesse-vsc73xx: remove unnecessary set_drvdata() 2022-09-22 19:30:39 -07:00
vitesse-vsc73xx.h