Skip to content

net: vlan: fix bridge binding behavior and add selftests

Sevinj Aghayeva bridge lkml llvm netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: bridge: export br_vlan_upper_changeinclude/linux/if_bridge.h net/bridge/br_vlan.c+13 -30 replies
2/3net: 8021q: fix bridge binding behavior for vlan interfacesnet/8021q/vlan.h net/8021q/vlan_dev.c+19 -40 replies
3/3selftests: 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

All 3 patches have a Reviewed-by or Acked-by.

PatchStefano BrivioAndy RoulinRoopa Prabhu
1/3R-b R-b R-b
2/3R-b R-b R-b
3/3R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH net-next 0/3] 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 (3):
net: bridge: export br_vlan_upper_change
net: 8021q: fix bridge binding behavior for vlan interfaces
selftests: net: tests for bridge binding behavior

 include/linux/if_bridge.h                     |   9 ++
 net/8021q/vlan.h                              |   2 +-
 net/8021q/vlan_dev.c                          |  21 ++-
 net/bridge/br_vlan.c                          |   7 +-
 tools/testing/selftests/net/Makefile          |   1 +
 .../selftests/net/bridge_vlan_binding_test.sh | 143 ++++++++++++++++++
 6 files changed, 176 insertions(+), 7 deletions(-)
 create mode 100755 tools/testing/selftests/net/bridge_vlan_binding_test.sh
Signature · 1 line
2.25.1