netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: bridge: mcast: fix br_multicast_ctx_vlan_global_disabled helper
@ 2021-12-28 15:28 Nikolay Aleksandrov
  2021-12-28 15:31 ` [PATCH net v2] " Nikolay Aleksandrov
  0 siblings, 1 reply; 3+ messages in thread
From: Nikolay Aleksandrov @ 2021-12-28 15:28 UTC (permalink / raw)
  To: netdev; +Cc: roopa, davem, bridge, kuba, Nikolay Aleksandrov

We need to first check if the context is a vlan one, then we need to
check the global bridge multicast vlan snooping flag, and finally the
vlan's multicast flag, otherwise we will unnecessarily enable vlan mcast
processing (e.g. querier timers).

Fixes: 7b54aaaf53cb ("net: bridge: multicast: add vlan state initialization and control")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
---
 net/bridge/br_private.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 2187a0c3fd22..4c7e67d7a5b8 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -1153,9 +1153,9 @@ br_multicast_port_ctx_get_global(const struct net_bridge_mcast_port *pmctx)
 static inline bool
 br_multicast_ctx_vlan_global_disabled(const struct net_bridge_mcast *brmctx)
 {
-	return br_opt_get(brmctx->br, BROPT_MCAST_VLAN_SNOOPING_ENABLED) &&
-	       br_multicast_ctx_is_vlan(brmctx) &&
-	       !(brmctx->vlan->priv_flags & BR_VLFLAG_GLOBAL_MCAST_ENABLED);
+	return br_multicast_ctx_is_vlan(brmctx) &&
+	       (!br_opt_get(brmctx->br, BROPT_MCAST_VLAN_SNOOPING_ENABLED) ||
+	        !(brmctx->vlan->priv_flags & BR_VLFLAG_GLOBAL_MCAST_ENABLED));
 }
 
 static inline bool
-- 
2.33.1


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

* [PATCH net v2] net: bridge: mcast: fix br_multicast_ctx_vlan_global_disabled helper
  2021-12-28 15:28 [PATCH net] net: bridge: mcast: fix br_multicast_ctx_vlan_global_disabled helper Nikolay Aleksandrov
@ 2021-12-28 15:31 ` Nikolay Aleksandrov
  2021-12-30  2:00   ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 3+ messages in thread
From: Nikolay Aleksandrov @ 2021-12-28 15:31 UTC (permalink / raw)
  To: netdev; +Cc: roopa, davem, bridge, kuba, Nikolay Aleksandrov

We need to first check if the context is a vlan one, then we need to
check the global bridge multicast vlan snooping flag, and finally the
vlan's multicast flag, otherwise we will unnecessarily enable vlan mcast
processing (e.g. querier timers).

Fixes: 7b54aaaf53cb ("net: bridge: multicast: add vlan state initialization and control")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
---
v2: fix indentation warning by checkpatch

 net/bridge/br_private.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 2187a0c3fd22..e8c6ee322c71 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -1153,9 +1153,9 @@ br_multicast_port_ctx_get_global(const struct net_bridge_mcast_port *pmctx)
 static inline bool
 br_multicast_ctx_vlan_global_disabled(const struct net_bridge_mcast *brmctx)
 {
-	return br_opt_get(brmctx->br, BROPT_MCAST_VLAN_SNOOPING_ENABLED) &&
-	       br_multicast_ctx_is_vlan(brmctx) &&
-	       !(brmctx->vlan->priv_flags & BR_VLFLAG_GLOBAL_MCAST_ENABLED);
+	return br_multicast_ctx_is_vlan(brmctx) &&
+	       (!br_opt_get(brmctx->br, BROPT_MCAST_VLAN_SNOOPING_ENABLED) ||
+		!(brmctx->vlan->priv_flags & BR_VLFLAG_GLOBAL_MCAST_ENABLED));
 }
 
 static inline bool
-- 
2.33.1


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

* Re: [PATCH net v2] net: bridge: mcast: fix br_multicast_ctx_vlan_global_disabled helper
  2021-12-28 15:31 ` [PATCH net v2] " Nikolay Aleksandrov
@ 2021-12-30  2:00   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-30  2:00 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, davem, bridge, kuba

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 28 Dec 2021 17:31:42 +0200 you wrote:
> We need to first check if the context is a vlan one, then we need to
> check the global bridge multicast vlan snooping flag, and finally the
> vlan's multicast flag, otherwise we will unnecessarily enable vlan mcast
> processing (e.g. querier timers).
> 
> Fixes: 7b54aaaf53cb ("net: bridge: multicast: add vlan state initialization and control")
> Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
> 
> [...]

Here is the summary with links:
  - [net,v2] net: bridge: mcast: fix br_multicast_ctx_vlan_global_disabled helper
    https://git.kernel.org/netdev/net/c/168fed986b3a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-12-30  2:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28 15:28 [PATCH net] net: bridge: mcast: fix br_multicast_ctx_vlan_global_disabled helper Nikolay Aleksandrov
2021-12-28 15:31 ` [PATCH net v2] " Nikolay Aleksandrov
2021-12-30  2:00   ` patchwork-bot+netdevbpf

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).