netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: vlan: fix bridge binding behavior and add selftests
@ 2022-07-30 16:03 Sevinj Aghayeva
  2022-07-30 16:03 ` [PATCH net-next 1/3] net: bridge: export br_vlan_upper_change Sevinj Aghayeva
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Sevinj Aghayeva @ 2022-07-30 16:03 UTC (permalink / raw)
  To: aroulin
  Cc: sbrivio, roopa, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Nikolay Aleksandrov, netdev, linux-kernel, bridge,
	Sevinj Aghayeva

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

-- 
2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-07-31  1:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-30 16:03 [PATCH net-next 0/3] net: vlan: fix bridge binding behavior and add selftests Sevinj Aghayeva
2022-07-30 16:03 ` [PATCH net-next 1/3] net: bridge: export br_vlan_upper_change Sevinj Aghayeva
2022-07-30 16:03 ` [PATCH net-next 2/3] net: 8021q: fix bridge binding behavior for vlan interfaces Sevinj Aghayeva
2022-07-30 19:58   ` kernel test robot
2022-07-30 20:18   ` kernel test robot
2022-07-30 20:18   ` kernel test robot
2022-07-30 16:03 ` [PATCH net-next 3/3] selftests: net: tests for bridge binding behavior Sevinj Aghayeva
2022-07-30 16:21 ` [PATCH net-next 0/3] net: vlan: fix bridge binding behavior and add selftests Nikolay Aleksandrov
     [not found]   ` <CAMWRUK5j4UAwjw4UGN=SVbbDbut0zWg5e03wupAXCPwT8K8zzQ@mail.gmail.com>
2022-07-30 16:48     ` Sevinj Aghayeva
2022-07-31  1:54       ` Roopa Prabhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).