Re: [PATCH net-next 4/5] net: bridge: mdb: move all switchdev logic to br_switchdev.c
From: Nikolay Aleksandrov <hidden>
Date: 2021-10-28 08:50:10
On 27/10/2021 19:21, Vladimir Oltean wrote:
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> --- net/bridge/br_mdb.c | 244 ------------------------------------ net/bridge/br_private.h | 17 +-- net/bridge/br_switchdev.c | 253 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 262 insertions(+), 252 deletions(-)
Acked-by: Nikolay Aleksandrov <redacted>