mbox series

[net-next,v3,0/6] net-next: dsa: mt7530: add support for MT7531

Message ID cover.1599228079.git.landen.chao@mediatek.com (mailing list archive)
Headers show
Series net-next: dsa: mt7530: add support for MT7531 | expand

Message

Landen Chao (趙皎宏) Sept. 4, 2020, 2:21 p.m. UTC
This patch series adds support for MT7531.

MT7531 is the next generation of MT7530 which could be found on Mediatek
router platforms such as MT7622 or MT7629.

It is also a 7-ports switch with 5 giga embedded phys, 2 cpu ports, and
the same MAC logic of MT7530. Cpu port 6 only supports SGMII interface.
Cpu port 5 supports either RGMII or SGMII in different HW SKU, but cannot
be muxed to PHY of port 0/4 like mt7530. Due to support for SGMII
interface, pll, and pad setting are different from MT7530.

MT7531 SGMII interface can be configured in following mode:
- 'SGMII AN mode' with in-band negotiation capability
    which is compatible with PHY_INTERFACE_MODE_SGMII.
- 'SGMII force mode' without in-band negotiation
    which is compatible with 10B/8B encoding of
    PHY_INTERFACE_MODE_1000BASEX with fixed full-duplex and fixed pause.
- 2.5 times faster clocked 'SGMII force mode' without in-band negotiation
    which is compatible with 10B/8B encoding of
    PHY_INTERFACE_MODE_2500BASEX with fixed full-duplex and fixed pause.

v2 -> v3
- Keep the same setup logic of mt7530/mt7621 because these series of
  patches is for adding mt7531 hardware.
- Do not adjust rgmii delay when vendor phy driver presents in order to
  prevent double adjustment by suggestion of Andrew Lunn.
- Remove redundant 'Example 4' from dt-bindings by suggestion of
  Rob Herring.
- Fix typo.

v1 -> v2
- change phylink_validate callback function to support full-duplex
  gigabit only to match hardware capability.
- add description of SGMII interface.
- configure mt7531 cpu port in fastest speed by default.
- parse SGMII control word for in-band negotiation mode.
- configure RGMII delay based on phy.rst.
- Rename the definition in the header file to avoid potential conflicts.
- Add wrapper function for mdio read/write to support both C22 and C45.
- correct fixed-link speed of 2500base-x in dts.
- add MT7531 port mirror setting.

Landen Chao (6):
  net: dsa: mt7530: Refine message in Kconfig
  net: dsa: mt7530: Extend device data ready for adding a new hardware
  dt-bindings: net: dsa: add new MT7531 binding to support MT7531
  net: dsa: mt7530: Add the support of MT7531 switch
  arm64: dts: mt7622: add mt7531 dsa to mt7622-rfb1 board
  arm64: dts: mt7622: add mt7531 dsa to bananapi-bpi-r64 board

 .../devicetree/bindings/net/dsa/mt7530.txt    |   10 +-
 .../dts/mediatek/mt7622-bananapi-bpi-r64.dts  |   44 +
 arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts  |   57 +-
 drivers/net/dsa/Kconfig                       |    6 +-
 drivers/net/dsa/mt7530.c                      | 1194 +++++++++++++++--
 drivers/net/dsa/mt7530.h                      |  259 +++-
 6 files changed, 1463 insertions(+), 107 deletions(-)

Comments

Frank Wunderlich Sept. 5, 2020, 8:45 a.m. UTC | #1
tested full series on Bananapi-r64 (mt7531) running iperf3-server

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   939 Mbits/sec    0             sender
[  5]   0.00-10.01  sec  1.09 GBytes   935 Mbits/sec                  receiver

reverse mode (-R)
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec  1.10 GBytes   941 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  1.09 GBytes   939 Mbits/sec                  receiver

similar to bananapi-r2 (mt7530)

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec    0             sender
[  5]   0.00-10.01  sec  1.09 GBytes   936 Mbits/sec                  receiver

reverse-mode:

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec  1.05 GBytes   905 Mbits/sec  14533             sender <<<<<<<<<<<
[  5]   0.00-10.00  sec  1.05 GBytes   905 Mbits/sec                  receiver

on last test i see iperf3 has ~30%cpu load and also ksoftirqd (using debian buster), so i tried opening server on my Laptop and running iperf -c on BPI-R2 with similar result

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.03 GBytes   886 Mbits/sec  13990             sender
[  5]   0.00-10.00  sec  1.03 GBytes   885 Mbits/sec                  receiver

in dmesg of both devices only DSA-Messages (nonfatal error -95 setting MTU on port) because of missing port_change_mtu callback. here i got a patch, but had not yet time to setup environment for testing jumbo-frames too. But this just as side-note

regards Frank
Frank Wunderlich Sept. 7, 2020, 8:49 a.m. UTC | #2
Hi

> Gesendet: Samstag, 05. September 2020 um 10:45 Uhr
> Von: "Frank Wunderlich" <frank-w@public-files.de>
> similar to bananapi-r2 (mt7530)
...
> reverse-mode:
>
> [ ID] Interval           Transfer     Bitrate         Retr
> [  5]   0.00-10.01  sec  1.05 GBytes   905 Mbits/sec  14533             sender <<<<<<<<<<<
> [  5]   0.00-10.00  sec  1.05 GBytes   905 Mbits/sec                  receiver

these retransmitts are caused by missing pause-statement in devicetree of bananapi-r2. I got them with mainline driver too.

After fixing it [1], i got the expected results with these mt7531-Patches:

iperf3-client on r2

normal mode:
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.10 GBytes   943 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  1.10 GBytes   941 Mbits/sec                  receiver

reverse mode:
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   939 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  1.09 GBytes   937 Mbits/sec                  receiver

Tested-By: Frank Wunderlich <frank-w@public-files.de>

[1] https://patchwork.kernel.org/patch/11760003/

regards Frank