Introduce DSA Ethernet switch class and Felix driver
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest6 patches 0 repliesNew
- v22 of 6 patches 0 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | net: introduce DSA class for Ethernet switches | +0 | 0 replies | |
| 1/6 | net: introduce DSA class for Ethernet switches | +0 | 1 reply | |
| 1/6 | net: introduce DSA class for Ethernet switches | +0 | 1 reply | |
| 4/6 | drivers: net: add Felix DSA switch driver | +0 | 0 replies | |
| 4/6 | drivers: net: add Felix DSA switch driver | +0 | 0 replies | |
| 6/6 | configs: ls1028a: enable the Ethernet switch driver in defconfig | +0 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 0/6] Introduce DSA Ethernet switch class and Felix driver
Quoted 150 lines · Vladimir Oltean
Quoted 135 lines · Alex Marginean
DSA stands for Distributed Switch Architecture and it is a subsystem introduced in the Linux kernel to support switches that:
- have an Ethernet link up to the CPU
- use some form of tagging to identify the source/destination port for Rx/Tx
- may be cascaded in tree-like structures.DSA is described in depth here:
https://www.kernel.org/doc/Documentation/networking/dsa/dsa.txtFrom the doc:
Summarized, this is basically how DSA looks like from a network device perspective: |--------------------------- | CPU network device (eth0)| ---------------------------- | <tag added by switch | | | | | | tag added by CPU> | |--------------------------------------------| | Switch driver | |--------------------------------------------| || || || |-------| |-------| |-------| | sw0p0 | | sw0p1 | | sw0p2 | |-------| |-------| |-------|This patch set introduces a DSA class in U-Boot to support drivers of such switches. DSA drivers have to implement the following ops:
- enable/disable of switch ports,
- insert a tag in frames being transmitted, used by the switch to select the egress port,
- parse a tag in frames being received, used for Rx traffic.DSA class code deals with presentation of switch ports as Ethernet interfaces, deals with the master Ethernet device for I/O and helps with parsing of the DT assuming the structure follows the DSA kernel binding.
Support for switch cascading is not included yet.
This patch set also introduces a driver for the Ethernet switch integrated into NXP LS1028A, called Felix. The switch has 4 front panel ports, I/O to/fom it is done though an ENETC Ethernet interface and meta-data is carried between the switch and the driver though an additional header pre-pended to the original frame.
Network commands like tftp can be used on these front panel ports. The ports are disabled unless used so they do not cause issues on network topologies that include loops.Felix as seen on LS1028A RDB:
=> dm tree
Class Index Probed Driver Name
-----------------------------------------------------------
......dsa 0 [ + ] felix-switch | |-- felix-switch eth 4 [ + ] dsa-port | | |-- swp0 eth 5 [ + ] dsa-port | | |-- swp1 eth 6 [ + ] dsa-port | | |-- swp2 eth 7 [ + ] dsa-port | | `-- swp3=> mdio list
......
10 - Vitesse VSC8514 <--> swp0
11 - Vitesse VSC8514 <--> swp1
12 - Vitesse VSC8514 <--> swp2
13 - Vitesse VSC8514 <--> swp3=> tftp 80000000 test
Using swp2 device
TFTP from server 192.168.100.1; our IP address is 192.168.100.100 Filename 'test'.
Load address:0x80000000
Loading: ################################################################################################################################## ######################################################## 6.8 MiB/sdone
Bytes transferred = 949880 (e7e78 hex)Changes in v3:
- fix Felix platdata size
- moveinclude/dsa.htoinclude/net/dsa.h
- updated TODO indsa.h
- other minor fixesChanges in v2:
- Don't use NULL PHY in Felix driver
- guarddsa.hwith #ifndef__DSA__H__, somehow I missed that in v1
- added a TODO for setting master Eth in promiscuous mode
- Minor fixes in patch descriptions, API comments
- Added address/size-cells to LS1028A DT ports nodeThis patch set replaces v2:
https://patchwork.ozlabs.org/project/uboot/list/?series=144912
and depends on:
https://patchwork.ozlabs.org/project/uboot/list/?series=144907
https://patchwork.ozlabs.org/project/uboot/list/?series=142879Alex Marginean (6):
net: introduce DSA class for Ethernet switches
drivers: net: add a DSA sandbox driver
test: dm: add a simple unit test for DSA class
drivers: net: add Felix DSA switch driver
arm: dts: ls1028a: adds Ethernet switch node and its dependencies
configs: ls1028a: enable the Ethernet switch driver in defconfigarch/Kconfig | 1 + arch/arm/dts/fsl-ls1028a-rdb.dts | 36 ++ arch/arm/dts/fsl-ls1028a.dtsi | 44 +- arch/sandbox/dts/test.dts | 49 ++ configs/ls1028aqds_tfa_SECURE_BOOT_defconfig | 3 +- configs/ls1028aqds_tfa_defconfig | 3 +- configs/ls1028ardb_tfa_SECURE_BOOT_defconfig | 3 +- configs/ls1028ardb_tfa_defconfig | 3 +- drivers/net/Kconfig | 21 + drivers/net/Makefile | 1 + drivers/net/dsa_sandbox.c | 272 +++++++++++ drivers/net/fsl_enetc.h | 5 + drivers/net/mscc_eswitch/Kconfig | 8 + drivers/net/mscc_eswitch/Makefile | 1 + drivers/net/mscc_eswitch/felix_switch.c | 454 +++++++++++++++++++ include/configs/sandbox.h | 4 + include/dm/uclass-id.h | 1 + include/dsa.h | 140 ++++++ net/Makefile | 1 + net/dsa-uclass.c | 369 +++++++++++++++ test/dm/Makefile | 1 + test/dm/dsa.c | 58 +++ test/dm/test-fdt.c | 2 +- 23 files changed, 1474 insertions(+), 6 deletions(-)Quoted 9 lines
create mode 100644
drivers/net/dsa_sandbox.ccreate mode 100644drivers/net/mscc_eswitch/felix_switch.ccreate mode 100644include/dsa.h
create mode 100644net/dsa-uclass.c
create mode 100644test/dm/dsa.c--
2.17.1For the entire series, you are free to add my:
Tested-by Vladimir Oltean <[email protected]>
Quoted 9 lines
I think this looks good enough for now. I've even been able to create another DSA driver based on this framework. Improvements (and getting rid of the TODOs) can come further along the way, but this has been lingering for a while now. Joe, if there aren't any complaints, do you think you could let this in?
Thanks,
-Vladimir
Yeah, this has been sitting here for some time and I didn't get to work on it more. One thing I think it would be worth including early is dealing with MAC addresses for switch ports. Linux DSA uses the MAC address of master Eth and we should do the same in U-Boot. That's not just for consistency with Linux but also to make this work on arbitrary mixes of switches and Eth ports without having to set master Eth in promisc mode.
It's not really a big change, I'll try to look into it in the next couple of weeks.
Thanks!
Alex