Replies: 2 comments 1 reply
-
Attention @lmajewski @jukkar @rlubos |
Beta Was this translation helpful? Give feedback.
0 replies
-
@JiafeiPan - thank you for sharing the detailed plan for DSA extension. I would like to point out some problems / issues to be aware of regarding your work:
My biggest concern is that DSA driver for Zephyr would be too large to use it on a tiny uC (as this is the main use case for now). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is DSA and why need DSA
Currently we have different networking switch solutions, some SoC provides onchip networking switch, such as i,MX943 and ls1028 provides the onchip tsn switch, and for the SoC has no on-chip switch, they could connect external networking switch chip for example SJA1105. Another solution from NXP is Heterogeneous Multi-SoC Architecture, it use MPU plus a MCU with networking switch, for example, use i.MX93 together with RT1180, it provides more IO ports compared with using SJA1105 such switch chip. And for each solution, we could cascade more switch chips to build up a switch tree.
So we can find so many switch ports in single or multiple switch chips, and each vendors or each SoC may define different switch protocol and private design.
Distributed Switch Architecture (DSA) is a framework originally designed in Linux networking, it provides a standardized or unified way to configure and control these switches ports from Linux, treating them as part of the overall network stack. The advantage of DSA is to map each networking switch ports to be a networking interface, so that it can leverage unified configuration tools to configure and manage the hardware switch tree, and unified socket API to receive or transmit frames for both switch ports and regular networking interface.
Problems
Currently a simple DSA architecture is provided in Zephyr, it only provides a single common driver: subsys/net/l2/ethernet/dsa/dsa.c to provides few DSA common APIs, and some related code( for exmaple tag protocol) is still in vendors device driver, and verndors device driver is still mixing endpoint port driver and switch ports driver, the limitation is still exiting in device tree binding, no unified dts binding to build switch tree. Compared with Linux DSA, currently it is difficult to build flexible networking switch setup, for example combine bridge and vlan protocol with DSA archtecuture.
New Zephyr DSA Architecture Proposal
The new Zephyr DSA architecutre as follows diagram:

And the frame RX TX flow will be like the following diagram:

Update for the new DSA Architecture
dsa_core.c: APIs for DSA tree, on top of master ports and slave ports, according to dts to build DSA tree, Common APIs for DSA configurations.
dsa_switch.c: APIs for switch object to maintain the configuration for the single switch
master_port.c: APIs for maintain master ports
slave_port.c: APIs for maintaining slave ports
dsa_bridge.c: APIs to build bridge for networking switch
dsa_tag.c, dsa_tag_sja1105 … : TAG protocol for common DSA TAG and verdor specific TAG manipulations.
Update bridge stack to add DSA offload support: subsys/net/l2/ethernet/bridge.c
Update vlan stack to add DSA offload support: subsys/net/l2/ethernet/vlan.c
Add DSA support in common network shell commands: zephyr/subsys/net/lib/shell
Add DSA bridge support in bridge shell: zephyr/subsys/net/l2/ethernet/bridge_shell.c
DSA Common dts binding in zephyr/dts/bindings/dsa
dsa.yaml: define common dsa dts binding for building DSA tree.
Define Vender specified DSA operations APIs to cover: brindge ops, vlan ops, fdb ops, timestamp ops, …
Update frames RX/TX flow according to new design.
Plan
Yangbo submitted a PR to initial and clean up the DSA Core code and simple document update:
#87045
Provide enhanced DSA Core code to buildup the DSA tree, enhanced DSA TAG protocol, enhanced bridge and vlan protocol
More and unified networking shell commands for the new DSA architecutue.
Beta Was this translation helpful? Give feedback.
All reactions