Page MenuHomeFreeBSD

Support for MT7531 Switch Driver
Needs ReviewPublic

Authored by freebsd_sysctl.cz on Sat, Jan 31, 3:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 23, 9:57 PM
Unknown Object (File)
Mon, Feb 23, 9:57 PM
Unknown Object (File)
Tue, Feb 17, 3:46 PM
Unknown Object (File)
Tue, Feb 17, 3:46 PM
Unknown Object (File)
Mon, Feb 16, 11:10 PM
Unknown Object (File)
Mon, Feb 16, 8:59 PM
Unknown Object (File)
Mon, Feb 16, 3:48 AM
Unknown Object (File)
Mon, Feb 16, 3:48 AM

Details

Summary

The MT7531 Ethernet switch driver has been successfully tested on the Banana Pi R2 Pro platform.
All 5 switch ports are fully operational.

Perf3 test:

Accepted connection from 192.168.1.55, port 15580
[ 6] local 192.168.1.54 port 5201 connected to 192.168.1.55 port 10830
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 6] 0.00-1.01 sec 36.4 MBytes 301 Mbits/sec 0.059 ms 0/26126 (0%)
[ 6] 1.01-2.00 sec 35.8 MBytes 304 Mbits/sec 0.058 ms 0/25717 (0%)
[ 6] 2.00-3.00 sec 36.2 MBytes 304 Mbits/sec 0.058 ms 0/25977 (0%)
[ 6] 3.00-4.00 sec 26.5 MBytes 222 Mbits/sec 0.076 ms 0/19014 (0%)
[ 6] 4.00-5.00 sec 26.2 MBytes 220 Mbits/sec 0.076 ms 0/18829 (0%)
[ 6] 5.00-6.00 sec 26.2 MBytes 220 Mbits/sec 0.076 ms 0/18843 (0%)
[ 6] 6.00-7.00 sec 26.2 MBytes 220 Mbits/sec 0.076 ms 0/18833 (0%)
[ 6] 7.00-8.00 sec 26.2 MBytes 220 Mbits/sec 0.076 ms 0/18824 (0%)
[ 6] 8.00-9.00 sec 26.2 MBytes 220 Mbits/sec 0.076 ms 0/18837 (0%)
[ 6] 9.00-10.00 sec 26.2 MBytes 220 Mbits/sec 0.076 ms 0/18821 (0%)
[ 6] 10.00-10.02 sec 469 KBytes 218 Mbits/sec 0.076 ms 0/329 (0%)


[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 6] 0.00-10.02 sec 293 MBytes 245 Mbits/sec 0.076 ms 0/210150 (0%) receiver

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/arm64/conf/ROCKCHIP
27 ↗(On Diff #170856)

This shouldn't be in the commit

otis added inline comments.
sys/modules/mtkswitch/Makefile
2

We don't use RCS tags any longer.

update diff, remove unnecessary code

mmel requested changes to this revision.Sun, Feb 1, 9:57 AM

At first look only:

    • the '#ifndef MT7531' is clearly incompatible with GENERIC kernel.
  • the defined FDT bindings between the NIC and the switch are not followed. Instead, a "brutal" hack (fdt_find_ethernet_prop_switch) is used.
  • the eqos driver changes is improper. All of these are should be in attached the phy driver.

I also think this breaks eqos driver on other boards (without switch), but I'm not 100% sure. The diff doesn't contain context, so it's difficult to read it.
In any case, these three points must be solved first.

This revision now requires changes to proceed.Sun, Feb 1, 9:57 AM
freebsd_sysctl.cz marked 2 inline comments as done.

I updated source code for mt7531, remoced #ifdedf from implementation mt7531

I update source code and removed #ifdefs

Just got into it and found a number of style issues.

sys/dev/eqos/if_eqos.c
273–276

These need to be indented 1 level

1296–1297

We prefer bool to int for this.

1367–1368

indentation looks weird.

sys/dev/etherswitch/mtkswitch/mtkswitch.c
114

continued indent is same level + 4 space, not whever this is trying to line up with

116

We snug the { at the end of the prior line.

119

You don't need 'else' after return. Also the return looks like it should be indented another level.

749–759

why have this?