-
Notifications
You must be signed in to change notification settings - Fork 1.4k
net: add vlan support #17452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: add vlan support #17452
Conversation
And fix wrong `d_len` for IOBs from `upper->txq` in TX. Signed-off-by: Zhe Weng <[email protected]>
avoid continuing to access the released memory after the netdev_register error occurs. Signed-off-by: daichuan <[email protected]>
To prepare for VLAN device support, a VLAN device will share quota with its real device. Signed-off-by: Zhe Weng <[email protected]>
acassis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhhyu7 Amazing!!! Please don't forget to include the Documentation/ about VLAN here
|
This seems like a really great addition to NuttX! If you could share the results of your iperf/ping tests that would be appreciated! Otherwise I agree that the only thing to add here would be additional documentation about this new feature. |
I have added complete test logs. |
Inspired by Linux's way, we also create VLAN devices for managing VLAN, which will become interfaces like `eth0.58`. QinQ is also supported, we can create VLAN devices above another VLAN devices, like `eth0.100.101` (or even `eth0.1.2.3.4`, also supported on Linux). Signed-off-by: Zhe Weng <[email protected]>
Supporting ADD_VLAN_CMD and DEL_VLAN_CMD of SIOCSIFVLAN Ref: https://github.com/torvalds/linux/blob/v6.12/net/8021q/vlan.c#L621 Signed-off-by: Zhe Weng <[email protected]>
1. We add default PCP because some of our apps may not want to set PCP manually (e.g. Our user may just ping with pre-set PCP) 2. The `vlan_qos` is used as PCP when setting Linux's priority mapping: https://github.com/torvalds/linux/blob/v6.12/net/8021q/vlan.c#L590 Although `vlan_qos` is not used when creating VLAN on Linux, we can use it as PCP on creating VLAN (without changing its meaning), and keep compatible with Linux's creating (Exactly the same when `vlan_qos` is 0). Signed-off-by: Zhe Weng <[email protected]>
Release iob when dropping ethernet packets Signed-off-by: gaohedong <[email protected]>
avoid illegal address access caused by removing vlan network cards during the traversal of vlan network cards Signed-off-by: zhanghongyu <[email protected]>
add log output for error flow Signed-off-by: zhangkai25 <[email protected]>
A brief document description has been added. |
Summary
Inspired by Linux's way, we also create VLAN devices for managing VLAN,
which will become interfaces like
eth0.58.QinQ is also supported, we can create VLAN devices above another VLAN
devices, like
eth0.100.101(or eveneth0.1.2.3.4, also supported onLinux).
Supporting ADD_VLAN_CMD and DEL_VLAN_CMD of SIOCSIFVLAN
Ref: https://github.com/torvalds/linux/blob/v6.12/net/8021q/vlan.c#L621
We add default PCP because some of our apps may not want to set PCP
manually (e.g. Our user may just ping with pre-set PCP)
The
vlan_qosis used as PCP when setting Linux's priority mapping:https://github.com/torvalds/linux/blob/v6.12/net/8021q/vlan.c#L590
Although
vlan_qosis not used when creating VLAN on Linux, we canuse it as PCP on creating VLAN (without changing its meaning), and
keep compatible with Linux's creating (Exactly the same when
vlan_qosis 0).Impact
Users can create VLAN network device of various priorities through ioctl.
Testing
sim:matter with creates the VLAN network device on the sim eth0 device.
Then test the functionality and performance of the VLAN network card using tools such as ping and iperf2.