OSDN Git Service

net: bridge: mdb: move all switchdev logic to br_switchdev.c
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 27 Oct 2021 16:21:18 +0000 (19:21 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Oct 2021 03:05:57 +0000 (20:05 -0700)
commit9776457c784f6549d43f80eb96d4122b51558258
tree541d22d2d5c87b25879ff3f4b19794d72c0c1200
parent9ae9ff994b0e42eefcc33f8adda1ec498f79338e
net: bridge: mdb: move all switchdev logic to br_switchdev.c

The following functions:

br_mdb_complete
br_switchdev_mdb_populate
br_mdb_replay_one
br_mdb_queue_one
br_mdb_replay
br_mdb_switchdev_host_port
br_mdb_switchdev_host
br_switchdev_mdb_notify

are only accessible from code paths where CONFIG_NET_SWITCHDEV is
enabled. So move them to br_switchdev.c, in order for that code to be
compiled out if that config option is disabled.

Note that br_switchdev.c gets build regardless of whether
CONFIG_BRIDGE_IGMP_SNOOPING is enabled or not, whereas br_mdb.c only got
built when CONFIG_BRIDGE_IGMP_SNOOPING was enabled. So to preserve
correct compilation with CONFIG_BRIDGE_IGMP_SNOOPING being disabled, we
must now place an #ifdef around these functions in br_switchdev.c.
The offending bridge data structures that need this are
br->multicast_lock and br->mdb_list, these are also compiled out of
struct net_bridge when CONFIG_BRIDGE_IGMP_SNOOPING is turned off.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/bridge/br_mdb.c
net/bridge/br_private.h
net/bridge/br_switchdev.c