From: Petr Machata <petrm@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, <netdev@vger.kernel.org>
Cc: Nikolay Aleksandrov <razor@blackwall.org>,
Ido Schimmel <idosch@nvidia.com>, <bridge@lists.linux.dev>,
Yong Wang <yongwang@nvidia.com>, Andy Roulin <aroulin@nvidia.com>,
Petr Machata <petrm@nvidia.com>, <mlxsw@nvidia.com>
Subject: [PATCH net-next 0/3] bridge: multicast: per vlan query improvement when port or vlan state changes
Date: Thu, 17 Apr 2025 15:43:11 +0200 [thread overview]
Message-ID: <cover.1744896433.git.petrm@nvidia.com> (raw)
From: Yong Wang <yongwang@nvidia.com>
The current implementation of br_multicast_enable_port() only operates on
port's multicast context, which doesn't take into account in case of vlan
snooping, one downside is the port's igmp query timer will NOT resume when
port state gets changed from BR_STATE_BLOCKING to BR_STATE_FORWARDING etc.
Such code flow will briefly look like:
1.vlan snooping
--> br_multicast_port_query_expired with per vlan port_mcast_ctx
--> port in BR_STATE_BLOCKING state --> then one-shot timer discontinued
The port state could be changed by STP daemon or kernel STP, taking mstpd
as example:
2.mstpd --> netlink_sendmsg --> br_setlink --> br_set_port_state with non
blocking states, i.e. BR_STATE_LEARNING or BR_STATE_FORWARDING
--> br_port_state_selection --> br_multicast_enable_port
--> enable multicast with port's multicast_ctx
Here for per vlan snooping, the vlan context of the port should be used
instead of port's multicast_ctx. The first patch corrects such behavior.
Similarly, vlan state change also impacts multicast behavior, the 2nd patch
adds function to update the corresponding multicast context when vlan state
changes.
The 3rd patch adds the selftests to confirm that IGMP/MLD query does happen
when the STP state becomes forwarding.
Yong Wang (3):
net: bridge: mcast: re-implement br_multicast_{enable, disable}_port
functions
net: bridge: mcast: update multicast contex when vlan state is changed
selftests: net/bridge : add tests for per vlan snooping with stp state
changes
net/bridge/br_mst.c | 4 +-
net/bridge/br_multicast.c | 103 ++++++++++++++++--
net/bridge/br_private.h | 11 +-
.../selftests/net/forwarding/bridge_igmp.sh | 80 +++++++++++++-
.../selftests/net/forwarding/bridge_mld.sh | 81 +++++++++++++-
tools/testing/selftests/net/forwarding/config | 1 +
6 files changed, 261 insertions(+), 19 deletions(-)
--
2.49.0
next reply other threads:[~2025-04-17 13:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 13:43 Petr Machata [this message]
2025-04-17 13:43 ` [PATCH net-next 1/3] net: bridge: mcast: re-implement br_multicast_{enable, disable}_port functions Petr Machata
2025-04-19 6:38 ` Nikolay Aleksandrov
2025-04-19 14:33 ` Yong Wang
2025-04-22 12:20 ` Petr Machata
2025-04-17 13:43 ` [PATCH net-next 2/3] net: bridge: mcast: update multicast contex when vlan state is changed Petr Machata
2025-04-19 6:39 ` Nikolay Aleksandrov
2025-04-17 13:43 ` [PATCH net-next 3/3] selftests: net/bridge : add tests for per vlan snooping with stp state changes Petr Machata
2025-04-19 6:41 ` Nikolay Aleksandrov
2025-04-23 12:10 ` [PATCH net-next 0/3] bridge: multicast: per vlan query improvement when port or vlan " patchwork-bot+netdevbpf
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=cover.1744896433.git.petrm@nvidia.com \
--to=petrm@nvidia.com \
--cc=aroulin@nvidia.com \
--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=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=yongwang@nvidia.com \
/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;
as well as URLs for NNTP newsgroup(s).