linux/net
Yong Wang 6c131043ea net: bridge: mcast: update multicast contex when vlan state is changed
When the vlan STP state is changed, which could be manipulated by
"bridge vlan" commands, similar to port STP state, this also impacts
multicast behaviors such as igmp query. In the scenario of per-VLAN
snooping, there's a need to update the corresponding multicast context
to re-arm the port query timer when vlan state becomes "forwarding" etc.

Update br_vlan_set_state() function to enable vlan multicast context
in such scenario.

Before the patch, the IGMP query does not happen in the last step of the
following test sequence, i.e. no growth for tx counter:
 # ip link add name br1 up type bridge vlan_filtering 1 mcast_snooping 1 mcast_vlan_snooping 1 mcast_querier 1 mcast_stats_enabled 1
 # bridge vlan global set vid 1 dev br1 mcast_snooping 1 mcast_querier 1 mcast_query_interval 100 mcast_startup_query_count 0
 # ip link add name swp1 up master br1 type dummy
 # sleep 1
 # bridge vlan set vid 1 dev swp1 state 4
 # ip -j -p stats show dev swp1 group xstats_slave subgroup bridge suite mcast | jq '.[]["multicast"]["igmp_queries"]["tx_v2"]'
1
 # sleep 1
 # ip -j -p stats show dev swp1 group xstats_slave subgroup bridge suite mcast | jq '.[]["multicast"]["igmp_queries"]["tx_v2"]'
1
 # bridge vlan set vid 1 dev swp1 state 3
 # sleep 2
 # ip -j -p stats show dev swp1 group xstats_slave subgroup bridge suite mcast | jq '.[]["multicast"]["igmp_queries"]["tx_v2"]'
1

After the patch, the IGMP query happens in the last step of the test:
 # ip link add name br1 up type bridge vlan_filtering 1 mcast_snooping 1 mcast_vlan_snooping 1 mcast_querier 1 mcast_stats_enabled 1
 # bridge vlan global set vid 1 dev br1 mcast_snooping 1 mcast_querier 1 mcast_query_interval 100 mcast_startup_query_count 0
 # ip link add name swp1 up master br1 type dummy
 # sleep 1
 # bridge vlan set vid 1 dev swp1 state 4
 # ip -j -p stats show dev swp1 group xstats_slave subgroup bridge suite mcast | jq '.[]["multicast"]["igmp_queries"]["tx_v2"]'
1
 # sleep 1
 # ip -j -p stats show dev swp1 group xstats_slave subgroup bridge suite mcast | jq '.[]["multicast"]["igmp_queries"]["tx_v2"]'
1
 # bridge vlan set vid 1 dev swp1 state 3
 # sleep 2
 # ip -j -p stats show dev swp1 group xstats_slave subgroup bridge suite mcast | jq '.[]["multicast"]["igmp_queries"]["tx_v2"]'
3

Signed-off-by: Yong Wang <yongwang@nvidia.com>
Reviewed-by: Andy Roulin <aroulin@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2025-04-23 13:02:20 +01:00
..
6lowpan
9p 9p: Use hashtable.h for hash_errmap 2025-03-23 06:20:48 +09:00
802 net: 802: Remove unused p8022 code 2025-04-22 07:04:02 -07:00
8021q net: 802: Remove unused p8022 code 2025-04-22 07:04:02 -07:00
appletalk treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
atm treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
ax25 treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
batman-adv batman-adv: Fix double-hold of meshif when getting enabled 2025-04-15 17:56:47 -07:00
bluetooth Bluetooth: l2cap: Process valid commands in too long frame 2025-04-16 16:50:25 -04:00
bpf
bridge net: bridge: mcast: update multicast contex when vlan state is changed 2025-04-23 13:02:20 +01:00
caif rtnetlink: Pack newlink() params into struct 2025-02-21 15:28:02 -08:00
can can: fix missing decrement of j1939_proto.inuse_idx 2025-04-15 12:18:07 +02:00
ceph lib/crc: remove CONFIG_LIBCRC32C 2025-04-04 11:31:42 -07:00
core xdp: create locked/unlocked instances of xdp redirect target setters 2025-04-22 19:57:56 -07:00
dcb
devlink devlink: add value check to devlink_info_version_put() 2025-04-15 07:36:31 -07:00
dns_resolver
dsa net: dsa: avoid refcount warnings when ds->ops->tag_8021q_vlan_del() fails 2025-04-16 18:14:44 -07:00
ethernet
ethtool ethtool: cmis_cdb: use correct rpl size in ethtool_cmis_module_poll() 2025-04-11 18:41:19 -07:00
handshake
hsr net: hsr: sync hw addr of slave2 according to slave1 hw addr on PRP 2025-04-14 12:40:06 +01:00
ieee802154 inet: frags: save a pair of atomic operations in reassembly 2025-03-18 13:18:36 +01:00
ife
ipv4 ipv4: Use nlmsg_payload in ipmr file 2025-04-16 18:33:03 -07:00
ipv6 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-04-17 12:26:50 -07:00
iucv s390: Convert MACHINE_IS_[LPAR|VM|KVM], etc, machine_is_[lpar|vm|kvm]() 2025-03-04 17:18:07 +01:00
kcm
key
l2tp net: move misc netdev_lock flavors to a separate header 2025-03-08 09:06:50 -08:00
l3mdev net: fib_rules: Fix iif / oif matching on L3 master device 2025-04-15 17:54:56 -07:00
lapb treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
llc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mac80211 Just a handful of fixes, notably 2025-04-11 16:38:04 -07:00
mac802154 mac802154: Switch to use hrtimer_setup() 2025-02-18 10:35:44 +01:00
mctp net: mctp: Set SOCK_RCU_FREE 2025-04-11 18:42:34 -07:00
mpls mpls: Use nlmsg_payload in mpls_valid_getroute_req 2025-04-15 08:28:54 -07:00
mptcp mptcp: add MPJoinRejected MIB counter 2025-04-15 08:21:47 -07:00
ncsi net: ncsi: Fix GCPS 64-bit member variables 2025-04-15 15:19:55 +02:00
netfilter netfilter: conntrack: fix erronous removal of offload bit 2025-04-17 11:14:22 +02:00
netlabel
netlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-02-27 10:20:58 -08:00
netrom treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
nfc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
nsh
openvswitch net: openvswitch: fix nested key length validation in the set() action 2025-04-14 16:15:38 -07:00
packet treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
phonet
psample
qrtr
rds Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-02-27 10:20:58 -08:00
rfkill net: rfkill: gpio: allow booting in blocked state 2025-02-11 11:55:55 +01:00
rose treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
rxrpc rxrpc: rxgk: Set error code in rxgk_yfs_decode_ticket() 2025-04-22 13:42:27 +02:00
sched bpf-next-for-netdev 2025-04-21 18:51:08 -07:00
sctp Including fixes from netfilter. 2025-04-10 08:52:18 -07:00
shaper
smc smc: Fix lockdep false-positive for IPPROTO_SMC. 2025-04-11 14:14:26 -07:00
strparser
sunrpc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
switchdev net: switchdev: Convert blocking notification chain to a raw one 2025-03-11 11:30:28 +01:00
tipc tipc: Removing deprecated strncpy() 2025-04-15 13:37:14 +02:00
tls net: tls: explicitly disallow disconnect 2025-04-08 11:38:49 +02:00
unix af_unix: Remove unix_unhash() 2025-04-10 17:32:57 -07:00
vmw_vsock vsock: avoid timeout during connect() if the socket is closing 2025-04-02 17:19:30 -07:00
wireless treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
x25 treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
xdp net: designate XSK pool pointers in queues as "ops protected" 2025-04-09 17:01:51 -07:00
xfrm xfrm: Convert xfrmi_exit_batch_rtnl() to ->exit_rtnl(). 2025-04-14 17:08:43 -07:00
Kconfig net: Retire DCCP socket. 2025-04-11 18:58:10 -07:00
Kconfig.debug
Makefile net: Retire DCCP socket. 2025-04-11 18:58:10 -07:00
compat.c
devres.c
socket.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-03-26 09:32:10 -07:00
sysctl_net.c