[SRU][J][PATCH 1/1] UBUNTU: SAUCE: net: switchdev: fix compilation error for CONFIG_NET_SWITCHDEV=n
Koichiro Den
koichiro.den at canonical.com
Thu Mar 27 13:56:48 UTC 2025
BugLink: https://bugs.launchpad.net/bugs/2104380
Since jammy:linux commit 0158242f01a0 ("net: bridge: switchdev: Skip MDB
replays of deferred events on offload"), the kernel build fails when
CONFIG_NET_SWITCHDEV=n, as observed in e.g. jammy:linux-kvm.
/build/jammy/net/bridge/br_mdb.c: In function 'br_mdb_queue_one':
/build/jammy/net/bridge/br_mdb.c:640:13: error: implicit declaration of function
'switchdev_port_obj_act_is_deferred'; did you mean 'switchdev_port_obj_add'? \
[-Werror=implicit- function-declaration]
640 | switchdev_port_obj_act_is_deferred(dev, action, &mdb.obj)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| switchdev_port_obj_add
Fix this by adding dummy switchdev_port_obj_act_is_deferred() for the
CONFIG_NET_SWITCHDEV=n case.
Fixes: 0158242f01a0 ("net: bridge: switchdev: Skip MDB replays of deferred events on offload") # jammy:linux
Signed-off-by: Koichiro Den <koichiro.den at canonical.com>
---
include/net/switchdev.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 161bdd1d9645..16ea63b1c656 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -376,6 +376,13 @@ static inline int switchdev_port_attr_set(struct net_device *dev,
return -EOPNOTSUPP;
}
+static bool switchdev_port_obj_act_is_deferred(struct net_device *dev,
+ enum switchdev_notifier_type nt,
+ const struct switchdev_obj *obj)
+{
+ return false;
+}
+
static inline int switchdev_port_obj_add(struct net_device *dev,
const struct switchdev_obj *obj,
struct netlink_ext_ack *extack)
--
2.45.2
More information about the kernel-team
mailing list