net: bridge: switchdev: fix shim definition for br_switchdev_mdb_notify
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 29 Oct 2021 22:36:06 +0000 (01:36 +0300)
committerJakub Kicinski <kuba@kernel.org>
Sat, 30 Oct 2021 04:32:39 +0000 (21:32 -0700)
commitae0393500e3b0139210749d52d22b29002c20e16
treee5915ac0c7cc6ed4c502f00dd4fab3a599f2f0fd
parent6d40edcf4ee16a296f06e4ede604473dbad99ebf
net: bridge: switchdev: fix shim definition for br_switchdev_mdb_notify

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>
Link: https://lore.kernel.org/r/20211029223606.3450523-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/bridge/br_private.h