* [PATCH net-next] net: bridge: switchdev: fix shim definition for br_switchdev_mdb_notify
@ 2021-10-29 22:36 Vladimir Oltean
2021-10-30 4:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2021-10-29 22:36 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Roopa Prabhu, Nikolay Aleksandrov, Jiri Pirko,
Ido Schimmel, Jakub Kicinski, kernel test robot
br_switchdev_mdb_notify() is conditionally compiled only when
CONFIG_NET_SWITCHDEV=y and CONFIG_BRIDGE_IGMP_SNOOPING=y. It is called
from br_mdb.c, which is conditionally compiled only when
CONFIG_BRIDGE_IGMP_SNOOPING=y.
The shim definition of br_switchdev_mdb_notify() is therefore needed for
the case where CONFIG_NET_SWITCHDEV=n, however we mistakenly put it
there for the case where CONFIG_BRIDGE_IGMP_SNOOPING=n. This results in
build failures when CONFIG_BRIDGE_IGMP_SNOOPING=y and
CONFIG_NET_SWITCHDEV=n.
To fix this, put the shim definition right next to
br_switchdev_fdb_notify(), which is properly guarded by NET_SWITCHDEV=n.
Since this is called only from br_mdb.c, we need not take any extra
safety precautions, when NET_SWITCHDEV=n and BRIDGE_IGMP_SNOOPING=n,
this shim definition will be absent but nobody will be needing it.
Fixes: 9776457c784f ("net: bridge: mdb: move all switchdev logic to br_switchdev.c")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
net/bridge/br_private.h | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 5552c00ed9c4..3fe0961dbd12 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -956,11 +956,6 @@ int br_multicast_toggle_vlan_snooping(struct net_bridge *br, bool on,
struct netlink_ext_ack *extack);
bool br_multicast_toggle_global_vlan(struct net_bridge_vlan *vlan, bool on);
-void br_switchdev_mdb_notify(struct net_device *dev,
- struct net_bridge_mdb_entry *mp,
- struct net_bridge_port_group *pg,
- int type);
-
int br_rports_fill_info(struct sk_buff *skb,
const struct net_bridge_mcast *brmctx);
int br_multicast_dump_querier_state(struct sk_buff *skb,
@@ -1396,13 +1391,6 @@ static inline bool br_multicast_toggle_global_vlan(struct net_bridge_vlan *vlan,
return false;
}
-static inline void br_switchdev_mdb_notify(struct net_device *dev,
- struct net_bridge_mdb_entry *mp,
- struct net_bridge_port_group *pg,
- int type)
-{
-}
-
static inline bool
br_multicast_ctx_options_equal(const struct net_bridge_mcast *brmctx1,
const struct net_bridge_mcast *brmctx2)
@@ -1983,6 +1971,10 @@ int br_switchdev_set_port_flag(struct net_bridge_port *p,
struct netlink_ext_ack *extack);
void br_switchdev_fdb_notify(struct net_bridge *br,
const struct net_bridge_fdb_entry *fdb, int type);
+void br_switchdev_mdb_notify(struct net_device *dev,
+ struct net_bridge_mdb_entry *mp,
+ struct net_bridge_port_group *pg,
+ int type);
int br_switchdev_port_vlan_add(struct net_device *dev, u16 vid, u16 flags,
struct netlink_ext_ack *extack);
int br_switchdev_port_vlan_del(struct net_device *dev, u16 vid);
@@ -2069,6 +2061,13 @@ br_switchdev_fdb_notify(struct net_bridge *br,
{
}
+static inline void br_switchdev_mdb_notify(struct net_device *dev,
+ struct net_bridge_mdb_entry *mp,
+ struct net_bridge_port_group *pg,
+ int type)
+{
+}
+
static inline void br_switchdev_frame_unmark(struct sk_buff *skb)
{
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: bridge: switchdev: fix shim definition for br_switchdev_mdb_notify
2021-10-29 22:36 [PATCH net-next] net: bridge: switchdev: fix shim definition for br_switchdev_mdb_notify Vladimir Oltean
@ 2021-10-30 4:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-30 4:40 UTC (permalink / raw)
To: Vladimir Oltean; +Cc: netdev, davem, roopa, nikolay, jiri, idosch, kuba, lkp
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 30 Oct 2021 01:36:06 +0300 you wrote:
> br_switchdev_mdb_notify() is conditionally compiled only when
> CONFIG_NET_SWITCHDEV=y and CONFIG_BRIDGE_IGMP_SNOOPING=y. It is called
> from br_mdb.c, which is conditionally compiled only when
> CONFIG_BRIDGE_IGMP_SNOOPING=y.
>
> The shim definition of br_switchdev_mdb_notify() is therefore needed for
> the case where CONFIG_NET_SWITCHDEV=n, however we mistakenly put it
> there for the case where CONFIG_BRIDGE_IGMP_SNOOPING=n. This results in
> build failures when CONFIG_BRIDGE_IGMP_SNOOPING=y and
> CONFIG_NET_SWITCHDEV=n.
>
> [...]
Here is the summary with links:
- [net-next] net: bridge: switchdev: fix shim definition for br_switchdev_mdb_notify
https://git.kernel.org/netdev/net-next/c/ae0393500e3b
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] 2+ messages in thread
end of thread, other threads:[~2021-10-30 4:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 22:36 [PATCH net-next] net: bridge: switchdev: fix shim definition for br_switchdev_mdb_notify Vladimir Oltean
2021-10-30 4:40 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.