Skip to content

bridge: Check relevant options in VLAN range grouping

Danielle Ratson bridge linux-kselftest lkml netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesApplied 2/2
  2. v12 patches 4 repliesSuperseded

Changes in v2 from the cover letter

* Address shellcheck-reported issues.

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bridge: Check relevant per-VLAN options in VLAN range groupingnet/bridge/br_private.h net/bridge/br_vlan_options.c+33 -30 repliesApplied
2/2selftests: net: Add bridge VLAN range grouping teststools/testing/selftests/net/Makefile tools/testing/selftests/net/bridge_vlan_dump.sh+205 -00 repliesApplied

Reviews trailers per patch

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

PatchIdo SchimmelNikolay AleksandrovPetr Machata
1/2R-b A-b
2/2R-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 v2 thread

Cover letter [PATCH net v2 0/2] bridge: Check relevant options in VLAN range grouping

The br_vlan_opts_eq_range() function determines if consecutive VLANs can be grouped together in a range for compact netlink notifications. It currently checks state, tunnel info, and multicast router configuration, but misses two categories of per-VLAN options that affect the output:
1. User-visible priv_flags (neigh_suppress, mcast_enabled)
2. Port multicast context options (mcast_max_groups, mcast_n_groups)

When VLANs have different settings for these options, they are incorrectly grouped into ranges, causing netlink notifications to report only one VLAN's settings for the entire range.

Fix by checking priv_flags equality, but only for flags that affect netlink output (BR_VLFLAG_NEIGH_SUPPRESS_ENABLED and BR_VLFLAG_MCAST_ENABLED), and comparing multicast context options (mcast_max_groups, mcast_n_groups).

Add a test with four test cases for each option, to ensure that VLANs with different values are not grouped into ranges and VLANs with matching values are properly grouped together.

Patchset overview:
Patch #1: fix
Patch #2: test

v2:
* Address shellcheck-reported issues.

Danielle Ratson (2):
bridge: Check relevant per-VLAN options in VLAN range grouping
selftests: net: Add bridge VLAN range grouping tests

 net/bridge/br_private.h                       |  10 +
 net/bridge/br_vlan_options.c                  |  26 ++-
 tools/testing/selftests/net/Makefile          |   1 +
 .../testing/selftests/net/bridge_vlan_dump.sh | 204 ++++++++++++++++++
 4 files changed, 238 insertions(+), 3 deletions(-)
 create mode 100755 tools/testing/selftests/net/bridge_vlan_dump.sh
Signature · 1 line
2.51.0