summaryrefslogtreecommitdiff
path: root/net/devlink/devl_internal.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-12-16 13:29:56 +0100
committerPaolo Abeni <pabeni@redhat.com>2023-12-19 15:31:40 +0100
commit5648de0b1f2b68bffce9bdd49a276607b9a3e3d4 (patch)
treea368a145818c5e5d8e1b20b42215b0af4c59e96b /net/devlink/devl_internal.h
parentcddbff470e3318834af518168d3a917b6e975062 (diff)
devlink: introduce a helper for netlink multicast send
Introduce a helper devlink_nl_notify_send() so each object notification function does not have to call genlmsg_multicast_netns() with the same arguments. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/devlink/devl_internal.h')
-rw-r--r--net/devlink/devl_internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h
index 510990de094e..84dc9628d3f2 100644
--- a/net/devlink/devl_internal.h
+++ b/net/devlink/devl_internal.h
@@ -191,6 +191,13 @@ static inline bool devlink_nl_notify_need(struct devlink *devlink)
DEVLINK_MCGRP_CONFIG);
}
+static inline void devlink_nl_notify_send(struct devlink *devlink,
+ struct sk_buff *msg)
+{
+ genlmsg_multicast_netns(&devlink_nl_family, devlink_net(devlink),
+ msg, 0, DEVLINK_MCGRP_CONFIG, GFP_KERNEL);
+}
+
/* Notify */
void devlink_notify_register(struct devlink *devlink);
void devlink_notify_unregister(struct devlink *devlink);