Skip to content

RFC net: vlan: fix bridge binding behavior and add selftests

Sevinj Aghayeva bridge lkml netdev oe-lkp 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5net: core: export call_netdevice_notifiers_infoinclude/linux/netdevice.h net/core/dev.c+4 -30 replies
2/5net: core: introduce a new notifier for link-type-specific changesinclude/linux/if_vlan.h include/linux/netdevice.h include/linux/notifier_info.h +1 more+27 -10 replies
3/5net: 8021q: notify bridge module of bridge-binding flag changenet/8021q/vlan.h net/8021q/vlan_dev.c+18 -40 replies
4/5net: bridge: handle link-type-specific changes in the bridge modulenet/bridge/br.c net/bridge/br_private.h net/bridge/br_vlan.c+30 -00 replies
5/5selftests: net: tests for bridge binding behaviortools/testing/selftests/net/Makefile tools/testing/selftests/net/bridge_vlan_binding_test.sh+144 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC net-next 0/5] net: vlan: fix bridge binding behavior and add selftests

When bridge binding is enabled for a vlan interface, it is expected that the link state of the vlan interface will track the subset of the ports that are also members of the corresponding vlan, rather than that of all ports.

Currently, this feature works as expected when a vlan interface is created with bridge binding enabled:

  ip link add link br name vlan10 type vlan id 10 protocol 802.1q \
        bridge_binding on

However, the feature does not work when a vlan interface is created with bridge binding disabled, and then enabled later:

ip link add link br name vlan10 type vlan id 10 protocol 802.1q \
bridge_binding off
ip link set vlan10 type vlan bridge_binding on

After these two commands, the link state of the vlan interface continues to track that of all ports, which is inconsistent and confusing to users. This series fixes this bug and introduces two tests for the valid behavior.

Sevinj Aghayeva (5):
net: core: export call_netdevice_notifiers_info
net: core: introduce a new notifier for link-type-specific changes
net: 8021q: notify bridge module of bridge-binding flag change
net: bridge: handle link-type-specific changes in the bridge module
selftests: net: tests for bridge binding behavior

 include/linux/if_vlan.h                       |   4 +
 include/linux/netdevice.h                     |   3 +
 include/linux/notifier_info.h                 |  21 +++
 net/8021q/vlan.h                              |   2 +-
 net/8021q/vlan_dev.c                          |  20 ++-
 net/bridge/br.c                               |   5 +
 net/bridge/br_private.h                       |   7 +
 net/bridge/br_vlan.c                          |  18 +++
 net/core/dev.c                                |   7 +-
 tools/testing/selftests/net/Makefile          |   1 +
 .../selftests/net/bridge_vlan_binding_test.sh | 143 ++++++++++++++++++
 11 files changed, 223 insertions(+), 8 deletions(-)
 create mode 100644 include/linux/notifier_info.h
 create mode 100755 tools/testing/selftests/net/bridge_vlan_binding_test.sh
Signature · 1 line
2.34.1