From: "Linus Lüssing" <linus.luessing@c0d3.blue>
To: bridge@lists.linux.dev
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org,
"Nikolay Aleksandrov" <razor@blackwall.org>,
"Ido Schimmel" <idosch@nvidia.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"Simon Horman" <horms@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Eric Dumazet" <edumazet@google.com>,
"David S . Miller" <davem@davemloft.net>,
"Kuniyuki Iwashima" <kuniyu@google.com>,
"Stanislav Fomichev" <sdf@fomichev.me>,
"Xiao Liang" <shaw.leon@gmail.com>,
shuah@kernel.org, petrm@nvidia.com,
"Linus Lüssing" <linus.luessing@c0d3.blue>
Subject: [PATCH net-next v4 02/14] net: bridge: mcast: track active state, adding tests
Date: Sat, 7 Mar 2026 05:45:36 +0100 [thread overview]
Message-ID: <20260307044548.5230-3-linus.luessing@c0d3.blue> (raw)
In-Reply-To: <20260307044548.5230-1-linus.luessing@c0d3.blue>
Before making any significant changes to the internals of the Linux
bridge add some tests regarding the multicast activity. This is
also to verify that we have the semantics of the new
*_MCAST_ACTIVE_{V4,V6} netlink attributes as expected.
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
.../testing/selftests/net/forwarding/Makefile | 1 +
.../net/forwarding/bridge_mdb_active.sh | 742 ++++++++++++++++++
2 files changed, 743 insertions(+)
create mode 100755 tools/testing/selftests/net/forwarding/bridge_mdb_active.sh
diff --git a/tools/testing/selftests/net/forwarding/Makefile b/tools/testing/selftests/net/forwarding/Makefile
index bbaf4d937dd8..6692751b24d5 100644
--- a/tools/testing/selftests/net/forwarding/Makefile
+++ b/tools/testing/selftests/net/forwarding/Makefile
@@ -7,6 +7,7 @@ TEST_PROGS := \
bridge_igmp.sh \
bridge_locked_port.sh \
bridge_mdb.sh \
+ bridge_mdb_active.sh \
bridge_mdb_host.sh \
bridge_mdb_max.sh \
bridge_mdb_port_down.sh \
diff --git a/tools/testing/selftests/net/forwarding/bridge_mdb_active.sh b/tools/testing/selftests/net/forwarding/bridge_mdb_active.sh
new file mode 100755
index 000000000000..3c93c55ffa61
--- /dev/null
+++ b/tools/testing/selftests/net/forwarding/bridge_mdb_active.sh
@@ -0,0 +1,742 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+# shellcheck disable=SC2317
+#
+# Disabling SC2317 because:
+# 1) shellcheck does not seem to like a trap together with a final exit call
+# 2) shellcheck does not seem to understand that tests_run calls all functions
+# listed in ALL_TESTS
+
+# +-------+ +---------+
+# | brq0 | | br0 |
+# | + $h1 | | + $swp1 |
+# +----|--+ +----|----+
+# | |
+# \--------------/
+#
+#
+# This script checks if we have the expected mcast_active_v{4,6} state
+# on br0 in a variety of scenarios. This state determines if ultimately
+# multicast snooping is applied to multicast data packets
+# (multicast snooping active) or if they are (by default) flooded instead
+# (multicast snooping inactive).
+#
+# Notably, multicast snooping can be enabled but still be inactive if not all
+# requirements to safely apply multicast snooping to multicast data packets
+# are met.
+#
+# Depending on the test case an IGMP/MLD querier might be on brq0, on br0
+# or neither.
+
+
+ALL_TESTS="
+ test_inactive
+ test_active_other_querier
+ test_active_own_querier
+ test_inactive_brdown
+ test_inactive_nov6
+ test_inactive_snooping_off
+ test_inactive_querier_off
+ test_inactive_other_querier_norespdelay
+ test_inactive_own_querier_norespdelay
+ test_inactive
+ test_vlan_inactive
+ test_vlan_active_other_querier
+ test_vlan_active_own_querier
+ test_vlan_inactive_brdown
+ test_vlan_inactive_nov6
+ test_vlan_inactive_snooping_off
+ test_vlan_inactive_vlans_snooping_off
+ test_vlan_inactive_vlan_snooping_off
+ test_vlan_inactive_other_querier_norespdelay
+ test_vlan_inactive_own_querier_norespdelay
+"
+
+NUM_NETIFS=2
+MCAST_MAX_RESP_IVAL_SEC=1
+MCAST_VLAN_ID=42
+source lib.sh
+
+switch_create()
+{
+ ip link add dev br0 type bridge\
+ vlan_filtering 0 \
+ mcast_query_response_interval $((MCAST_MAX_RESP_IVAL_SEC*100))\
+ mcast_snooping 0 \
+ mcast_vlan_snooping 0
+ ip link add dev brq0 type bridge\
+ vlan_filtering 0 \
+ mcast_query_response_interval $((MCAST_MAX_RESP_IVAL_SEC*100))\
+ mcast_snooping 0 \
+ mcast_vlan_snooping 0
+
+ echo 1 > /proc/sys/net/ipv6/conf/br0/disable_ipv6
+ echo 1 > /proc/sys/net/ipv6/conf/brq0/disable_ipv6
+
+ ip link set dev "$swp1" master br0
+ ip link set dev "$h1" master brq0
+
+ ip link set dev "$h1" up
+ ip link set dev "$swp1" up
+}
+
+switch_destroy()
+{
+ ip link set dev "$swp1" down
+ ip link set dev "$h1" down
+
+ ip link del dev brq0
+ ip link del dev br0
+}
+
+setup_prepare()
+{
+ h1=${NETIFS[p1]}
+ swp1=${NETIFS[p2]}
+
+ switch_create
+}
+
+cleanup()
+{
+ pre_cleanup
+ switch_destroy
+}
+
+mcast_active_check_failed()
+{
+ local af="$1"
+ local vlan="$2"
+ local active="$3"
+ local lineno="$4"
+
+ check_err 1 "$lineno: Mcast ${vlan}${active} check failed ($af)"
+}
+
+mcast_active_check_ret()
+{
+ local ret="$1"
+ local af="$2"
+ local state="$3"
+ local vlan="$4"
+ local lineno="$5"
+
+ if [ "$state" -eq 0 ]; then
+ if [ "$ret" -eq 0 ]; then
+ mcast_active_check_failed \
+ "$af" "$vlan" "inactive" "$lineno"
+ fi
+ elif [ "$state" -eq 1 ]; then
+ if [ "$ret" -ne 0 ]; then
+ mcast_active_check_failed \
+ "$af" "$vlan" "active" "$lineno"
+ fi
+ fi
+}
+
+jq_check_mcast_active()
+{
+ local af="$1"
+
+ jq -e ".[] | select(.linkinfo.info_data.mcast_active_$af == 1)"
+}
+
+mcast_active_check()
+{
+ local af="$1"
+ local state="$2"
+ local lineno="$3"
+
+ ip -d -j link show dev br0\
+ | jq_check_mcast_active "$af" &> /dev/null
+ mcast_active_check_ret "$?" "$af" "$state" "" "$lineno"
+}
+
+jq_check_vlan_mcast_active()
+{
+ local vid="$1"
+ local af="$2"
+
+ jq -e ".[].vlans.[] | select(.vlan == $vid and .mcast_active_$af == 1)"
+}
+
+mcast_vlan_active_check()
+{
+ local af="$1"
+ local state="$2"
+ local lineno="$3"
+ local vid="${MCAST_VLAN_ID}"
+
+ bridge -j vlan global show dev br0\
+ | jq_check_vlan_mcast_active "$vid" "$af" &> /dev/null
+ mcast_active_check_ret "$?" "$af" "$state" "VLAN " "$lineno"
+}
+
+mcast_assert_active_v4()
+{
+ mcast_active_check "v4" "1" "$1"
+}
+
+mcast_assert_active_v6()
+{
+ mcast_active_check "v6" "1" "$1"
+}
+
+mcast_assert_inactive_v4()
+{
+ mcast_active_check "v4" "0" "$1"
+}
+
+mcast_assert_inactive_v6()
+{
+ mcast_active_check "v6" "0" "$1"
+}
+
+mcast_vlan_assert_active_v4()
+{
+ mcast_vlan_active_check "v4" "1" "$1"
+}
+
+mcast_vlan_assert_active_v6()
+{
+ mcast_vlan_active_check "v6" "1" "$1"
+}
+
+mcast_vlan_assert_inactive_v4()
+{
+ mcast_vlan_active_check "v4" "0" "$1"
+}
+
+mcast_vlan_assert_inactive_v6()
+{
+ mcast_vlan_active_check "v6" "0" "$1"
+}
+
+test_inactive_nolog()
+{
+ local lineno="$1"
+
+ ip link set dev br0 down
+ ip link set dev brq0 down
+ ip link set dev br0 type bridge mcast_snooping 0
+ ip link set dev brq0 type bridge mcast_snooping 0
+ ip link set dev br0 type bridge mcast_querier 0
+ ip link set dev brq0 type bridge mcast_querier 0
+ ip link set dev br0 type bridge mcast_vlan_snooping 0
+ ip link set dev br0 type bridge vlan_filtering 0
+
+ echo 1 > /proc/sys/net/ipv6/conf/br0/disable_ipv6
+ echo 1 > /proc/sys/net/ipv6/conf/brq0/disable_ipv6
+
+ mcast_assert_inactive_v4 "$lineno"
+ mcast_assert_inactive_v6 "$lineno"
+}
+
+test_inactive()
+{
+ RET=0
+
+ test_inactive_nolog "$LINENO"
+ log_test "Mcast inactive test"
+}
+
+wait_lladdr_dad() {
+ local jq_select
+ local jq_tentative
+
+ jq_select="select(.scope == \"link\" and ((.tentative == true) | not))"
+ jq_tentative="map(${jq_select}) | .[]"
+
+ ip -6 -j a s dev "$1"\
+ | jq -e ".[].addr_info | ${jq_tentative}" &> /dev/null
+}
+
+test_active_setup_bridge()
+{
+ [ -n "$1" ] && echo 0 > /proc/sys/net/ipv6/conf/br0/disable_ipv6
+ [ -n "$2" ] && echo 0 > /proc/sys/net/ipv6/conf/brq0/disable_ipv6
+
+ [ -n "$3" ] && ip link set dev br0 up
+ [ -n "$4" ] && ip link set dev brq0 up
+ [ -n "$5" ] && slowwait 3 wait_lladdr_dad br0
+ [ -n "$6" ] && slowwait 3 wait_lladdr_dad brq0
+}
+
+test_active_setup_config()
+{
+ [ -n "$1" ] && ip link set dev br0 type bridge mcast_snooping 1
+ [ -n "$2" ] && ip link set dev brq0 type bridge mcast_snooping 1
+ [ -n "$3" ] && ip link set dev br0 type bridge mcast_querier 1
+ [ -n "$4" ] && ip link set dev brq0 type bridge mcast_querier 1
+}
+
+test_active_setup_wait()
+{
+ sleep $((MCAST_MAX_RESP_IVAL_SEC * 2))
+}
+
+test_active_setup_reset_own_querier()
+{
+ ip link set dev br0 type bridge mcast_querier 0
+ ip link set dev br0 type bridge mcast_querier 1
+
+ test_active_setup_wait
+}
+
+test_vlan_active_setup_config()
+{
+ [ -n "$1" ] && ip link set dev br0 type bridge vlan_filtering 1
+ [ -n "$2" ] && ip link set dev brq0 type bridge vlan_filtering 1
+ [ -n "$3" ] && ip link set dev br0 type bridge mcast_vlan_snooping 1
+ [ -n "$4" ] && ip link set dev brq0 type bridge mcast_vlan_snooping 1
+}
+
+test_vlan_active_setup_add_vlan()
+{
+ bridge vlan add vid "${MCAST_VLAN_ID}" dev "$swp1"
+ bridge vlan add vid "${MCAST_VLAN_ID}" dev "$h1"
+ bridge vlan global set vid "${MCAST_VLAN_ID}" dev br0\
+ mcast_query_response_interval $((MCAST_MAX_RESP_IVAL_SEC*100))
+ bridge vlan global set vid "${MCAST_VLAN_ID}" dev brq0\
+ mcast_query_response_interval $((MCAST_MAX_RESP_IVAL_SEC*100))
+ bridge vlan global set vid "${MCAST_VLAN_ID}" dev br0 mcast_snooping 0
+ bridge vlan global set vid "${MCAST_VLAN_ID}" dev brq0 mcast_snooping 0
+ bridge vlan global set vid "${MCAST_VLAN_ID}" dev br0 mcast_querier 0
+ bridge vlan global set vid "${MCAST_VLAN_ID}" dev brq0 mcast_querier 0
+}
+
+test_vlan_active_setup_config_vlan()
+{
+ [ -n "$1" ] && bridge vlan global set \
+ vid "${MCAST_VLAN_ID}" dev br0 mcast_snooping 1
+ [ -n "$2" ] && bridge vlan global set \
+ vid "${MCAST_VLAN_ID}" dev brq0 mcast_snooping 1
+ [ -n "$3" ] && bridge vlan global set \
+ vid "${MCAST_VLAN_ID}" dev br0 mcast_querier 1
+ [ -n "$4" ] && bridge vlan global set \
+ vid "${MCAST_VLAN_ID}" dev brq0 mcast_querier 1
+}
+
+test_vlan_teardown()
+{
+ bridge vlan del vid "${MCAST_VLAN_ID}" dev "$swp1"
+ bridge vlan del vid "${MCAST_VLAN_ID}" dev "$h1"
+ mcast_assert_inactive_v4 "$1"
+ mcast_assert_inactive_v6 "$1"
+ mcast_vlan_assert_inactive_v4 "$1"
+ mcast_vlan_assert_inactive_v6 "$1"
+}
+
+test_vlan_active_setup_reset_own_querier()
+{
+ bridge vlan global set vid "${MCAST_VLAN_ID}" dev br0 mcast_querier 0
+ bridge vlan global set vid "${MCAST_VLAN_ID}" dev br0 mcast_querier 1
+
+ test_active_setup_wait
+}
+
+test_active_other_querier_nolog()
+{
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "" "4"
+ test_active_setup_wait
+
+ mcast_assert_active_v4 "$1"
+ mcast_assert_active_v6 "$1"
+}
+
+test_active_other_querier()
+{
+ RET=0
+
+ test_active_other_querier_nolog "$LINENO"
+ test_inactive_nolog "$LINENO"
+ log_test "Mcast active with other querier test"
+}
+
+test_active_own_querier_nolog()
+{
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "3" ""
+ test_active_setup_wait
+
+ mcast_assert_active_v4 "$1"
+ mcast_assert_active_v6 "$1"
+}
+
+test_active_own_querier()
+{
+ RET=0
+
+ test_active_own_querier_nolog "$LINENO"
+ test_inactive_nolog "$LINENO"
+ log_test "Mcast active with own querier test"
+}
+
+test_active_final()
+{
+ mcast_assert_active_v4 "$1"
+ mcast_assert_active_v6 "$1"
+
+ test_inactive_nolog "$1"
+}
+
+test_inactive_brdown()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "" "4" "" "6"
+ test_active_setup_config "1" "2" "3" ""
+ test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_bridge "" "" "3" "" "" ""
+ mcast_assert_active_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_bridge "" "" "" "" "5" ""
+ test_active_setup_reset_own_querier
+ test_active_final "$LINENO"
+
+ log_test "Mcast inactive, bridge down test"
+}
+
+test_inactive_nov6()
+{
+ RET=0
+
+ test_active_setup_bridge "" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "3" ""
+ test_active_setup_wait
+
+ mcast_assert_active_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_bridge "1" "" "" "" "5" ""
+ test_active_setup_reset_own_querier
+ test_active_final "$LINENO"
+
+ log_test "Mcast inactive, own querier, no IPv6 address test"
+}
+
+test_inactive_snooping_off()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "" "2" "3" ""
+ test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_config "1" "" "" ""
+ test_active_setup_reset_own_querier
+ test_active_final "$LINENO"
+
+ log_test "Mcast inactive, snooping disabled test"
+}
+
+test_inactive_querier_off()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "" ""
+ test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_config "" "" "3" ""
+ test_active_setup_wait
+ test_active_final "$LINENO"
+
+ log_test "Mcast inactive, no querier test"
+}
+
+test_inactive_other_querier_norespdelay()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "3" ""
+ # skipping: test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_wait
+ test_active_final "$LINENO"
+
+ log_test "Mcast inactive, other querier, no response delay test"
+}
+
+test_inactive_own_querier_norespdelay()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "" "4"
+ # skipping: test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_wait
+ test_active_final "$LINENO"
+
+ log_test "Mcast inactive, own querier, no response delay test"
+}
+
+test_vlan_inactive()
+{
+ RET=0
+
+ test_inactive_nolog "$LINENO"
+ mcast_vlan_assert_inactive_v4 "$LINENO"
+ mcast_vlan_assert_inactive_v6 "$LINENO"
+
+ ip link set dev br0 type bridge vlan_filtering 1
+ ip link set dev br0 type bridge mcast_vlan_snooping 1
+ mcast_vlan_assert_inactive_v4 "$LINENO"
+ mcast_vlan_assert_inactive_v6 "$LINENO"
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+
+ ip link set dev br0 type bridge mcast_vlan_snooping 0
+ ip link set dev br0 type bridge vlan_filtering 0
+ test_active_own_querier_nolog "$LINENO"
+ ip link set dev br0 type bridge vlan_filtering 1
+ mcast_assert_active_v4 "$LINENO"
+ mcast_assert_active_v6 "$LINENO"
+
+ ip link set dev br0 type bridge mcast_vlan_snooping 1
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+
+ test_inactive_nolog "$LINENO"
+ log_test "Mcast VLAN inactive test"
+}
+
+test_vlan_active_final()
+{
+ mcast_assert_inactive_v4 "$1"
+ mcast_assert_inactive_v6 "$1"
+ mcast_vlan_assert_active_v4 "$1"
+ mcast_vlan_assert_active_v6 "$1"
+
+ test_vlan_teardown "$1"
+ test_inactive_nolog "$1"
+}
+
+test_vlan_active_other_querier()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "" ""
+ test_vlan_active_setup_config "1" "2" "3" "4"
+ test_vlan_active_setup_add_vlan
+ test_vlan_active_setup_config_vlan "1" "2" "" "4"
+ test_active_setup_wait
+ test_vlan_active_final "$LINENO"
+
+ log_test "Mcast VLAN active, other querier test"
+}
+
+test_vlan_active_own_querier()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "" ""
+ test_vlan_active_setup_config "1" "2" "3" "4"
+ test_vlan_active_setup_add_vlan
+ test_vlan_active_setup_config_vlan "1" "2" "3" ""
+ test_active_setup_wait
+ test_vlan_active_final "$LINENO"
+
+ log_test "Mcast VLAN active, own querier test"
+}
+
+test_vlan_inactive_brdown()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "" "4" "" "6"
+ test_active_setup_config "1" "2" "" ""
+ test_vlan_active_setup_config "1" "2" "3" "4"
+ test_vlan_active_setup_add_vlan
+ test_vlan_active_setup_config_vlan "1" "2" "3" ""
+ test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+ mcast_vlan_assert_inactive_v4 "$LINENO"
+ mcast_vlan_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_bridge "" "" "3" "" "" ""
+ test_active_setup_wait
+ mcast_vlan_assert_active_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_bridge "" "" "" "" "5" ""
+ test_vlan_active_setup_reset_own_querier
+ test_vlan_active_final "$LINENO, RET: $RET"
+
+ log_test "Mcast VLAN inactive, bridge down test"
+}
+
+test_vlan_inactive_nov6()
+{
+ RET=0
+
+ test_active_setup_bridge "" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "" ""
+ test_vlan_active_setup_config "1" "2" "3" "4"
+ test_vlan_active_setup_add_vlan
+ test_vlan_active_setup_config_vlan "1" "2" "3" ""
+ test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+ mcast_vlan_assert_active_v4 "$LINENO"
+ mcast_vlan_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_bridge "1" "" "" "" "5" ""
+ test_vlan_active_setup_reset_own_querier
+ test_vlan_active_final "$LINENO"
+
+ log_test "Mcast VLAN inactive, own querier, no IPv6 address test"
+}
+
+test_vlan_inactive_snooping_off()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "" "2" "" ""
+ test_vlan_active_setup_config "1" "2" "3" "4"
+ test_vlan_active_setup_add_vlan
+ test_vlan_active_setup_config_vlan "1" "2" "3" ""
+ test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+ mcast_vlan_assert_inactive_v4 "$LINENO"
+ mcast_vlan_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_config "1" "" "" ""
+ test_vlan_active_setup_reset_own_querier
+ test_vlan_active_final "$LINENO"
+
+ log_test "Mcast VLAN inactive, snooping disabled test"
+}
+
+test_vlan_inactive_vlans_snooping_off()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "" ""
+ test_vlan_active_setup_config "1" "2" "" "4"
+ test_vlan_active_setup_add_vlan
+ test_vlan_active_setup_config_vlan "1" "2" "3" ""
+ test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+ mcast_vlan_assert_inactive_v4 "$LINENO"
+ mcast_vlan_assert_inactive_v6 "$LINENO"
+
+ test_vlan_active_setup_config "" "" "3" ""
+ test_vlan_active_setup_reset_own_querier
+ test_vlan_active_final "$LINENO"
+
+ log_test "Mcast VLAN inactive, snooping for VLANs disabled test"
+}
+
+test_vlan_inactive_vlan_snooping_off()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "" ""
+ test_vlan_active_setup_config "1" "2" "3" "4"
+ test_vlan_active_setup_add_vlan
+ test_vlan_active_setup_config_vlan "" "2" "3" ""
+ test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+ mcast_vlan_assert_inactive_v4 "$LINENO"
+ mcast_vlan_assert_inactive_v6 "$LINENO"
+
+ test_vlan_active_setup_config_vlan "1" "" "" ""
+ test_vlan_active_setup_reset_own_querier
+ test_vlan_active_final "$LINENO"
+
+ log_test "Mcast VLAN inactive, snooping for this VLAN disabled test"
+}
+
+test_vlan_inactive_other_querier_norespdelay()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "" ""
+ test_vlan_active_setup_config "1" "2" "3" "4"
+ test_vlan_active_setup_add_vlan
+ test_vlan_active_setup_config_vlan "1" "2" "" "4"
+ # skipping: test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+ mcast_vlan_assert_inactive_v4 "$LINENO"
+ mcast_vlan_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_wait
+ test_vlan_active_final "$LINENO"
+
+ log_test "Mcast VLAN inactive, other querier, no response delay test"
+}
+
+test_vlan_inactive_own_querier_norespdelay()
+{
+ RET=0
+
+ test_active_setup_bridge "1" "2" "3" "4" "5" "6"
+ test_active_setup_config "1" "2" "" ""
+ test_vlan_active_setup_config "1" "2" "3" "4"
+ test_vlan_active_setup_add_vlan
+ test_vlan_active_setup_config_vlan "1" "2" "3" ""
+ # skipping: test_active_setup_wait
+
+ mcast_assert_inactive_v4 "$LINENO"
+ mcast_assert_inactive_v6 "$LINENO"
+ mcast_vlan_assert_inactive_v4 "$LINENO"
+ mcast_vlan_assert_inactive_v6 "$LINENO"
+
+ test_active_setup_wait
+ test_vlan_active_final "$LINENO"
+
+ log_test "Mcast VLAN inactive, own querier, no response delay test"
+}
+
+trap cleanup EXIT
+
+setup_prepare
+
+if ! ip -d link show dev br0 2>&1 | grep -q "mcast_active"; then
+ echo "SKIP: iproute2 too old, missing mcast_active support"
+ exit "$ksft_skip"
+fi
+
+setup_wait
+tests_run
+
+exit "$EXIT_STATUS"
--
2.53.0
next prev parent reply other threads:[~2026-03-07 4:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-07 4:45 [PATCH net-next v4 00/14] net: bridge: reduce multicast checks in fast path Linus Lüssing
2026-03-07 4:45 ` [PATCH net-next v4 01/14] net: bridge: mcast: export ip{4,6}_active state to netlink Linus Lüssing
2026-03-07 4:45 ` Linus Lüssing [this message]
2026-03-07 4:45 ` [PATCH net-next v4 03/14] net: bridge: mcast: avoid sleeping on bridge-down Linus Lüssing
2026-03-09 12:31 ` Ido Schimmel
2026-03-07 4:45 ` [PATCH net-next v4 04/14] net: bridge: mcast: track active state, IGMP/MLD querier appearance Linus Lüssing
2026-03-09 12:57 ` Ido Schimmel
2026-03-07 4:45 ` [PATCH net-next v4 05/14] net: bridge: mcast: track active state, foreign IGMP/MLD querier disappearance Linus Lüssing
2026-03-07 4:45 ` [PATCH net-next v4 06/14] net: bridge: mcast: track active state, IPv6 address availability Linus Lüssing
2026-03-07 4:45 ` [PATCH net-next v4 07/14] net: bridge: mcast: track active state, own MLD querier disappearance Linus Lüssing
2026-03-09 13:18 ` Ido Schimmel
2026-03-07 4:45 ` [PATCH net-next v4 08/14] net: bridge: mcast: track active state, if snooping is enabled Linus Lüssing
2026-03-09 13:44 ` Ido Schimmel
2026-03-07 4:45 ` [PATCH net-next v4 09/14] net: bridge: mcast: track active state, VLAN snooping Linus Lüssing
2026-03-08 20:12 ` Ido Schimmel
2026-03-07 4:45 ` [PATCH net-next v4 10/14] net: bridge: mcast: track active state, bridge up/down Linus Lüssing
2026-03-09 15:58 ` Ido Schimmel
2026-03-09 17:49 ` Ido Schimmel
2026-03-07 4:45 ` [PATCH net-next v4 11/14] net: bridge: mcast: track active state, prepare for outside lock reads Linus Lüssing
2026-03-09 16:17 ` Ido Schimmel
2026-03-07 4:45 ` [PATCH net-next v4 12/14] net: bridge: mcast: use combined active state in netlink Linus Lüssing
2026-03-07 4:45 ` [PATCH net-next v4 13/14] net: bridge: mcast: use combined active state in fast/data path Linus Lüssing
2026-03-09 16:51 ` Ido Schimmel
2026-03-07 4:45 ` [PATCH net-next v4 14/14] net: bridge: mcast: add inactive state assertions Linus Lüssing
2026-03-09 17:48 ` Ido Schimmel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260307044548.5230-3-linus.luessing@c0d3.blue \
--to=linus.luessing@c0d3.blue \
--cc=andrew+netdev@lunn.ch \
--cc=bridge@lists.linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=razor@blackwall.org \
--cc=sdf@fomichev.me \
--cc=shaw.leon@gmail.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox