devlink: send notifications only if there are listeners
authorJiri Pirko <jiri@nvidia.com>
Sat, 16 Dec 2023 12:29:55 +0000 (13:29 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 19 Dec 2023 14:31:40 +0000 (15:31 +0100)
commitcddbff470e3318834af518168d3a917b6e975062
tree2932277f4dfc374f098cf39b24f0b52b89efffbe
parent11280ddeae238e3ea27d153794472cfca5e8d121
devlink: send notifications only if there are listeners

Introduce devlink_nl_notify_need() helper and using it to check at the
beginning of notification functions to avoid overhead of composing
notification messages in case nobody listens.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/devlink/dev.c
net/devlink/devl_internal.h
net/devlink/health.c
net/devlink/linecard.c
net/devlink/param.c
net/devlink/port.c
net/devlink/rate.c
net/devlink/region.c
net/devlink/trap.c