summaryrefslogtreecommitdiffstats
path: root/net/devlink/region.c
Commit message (Collapse)AuthorAgeFilesLines
* devlink: introduce a helper for netlink multicast sendJiri Pirko2023-12-191-2/+1
| | | | | | | | | 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>
* devlink: send notifications only if there are listenersJiri Pirko2023-12-191-1/+1
| | | | | | | | | 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>
* devlink: introduce __devl_is_registered() helper and use it instead of ↵Jiri Pirko2023-12-191-1/+2
| | | | | | | | | | | xa_get_mark() Introduce __devl_is_registered() which does not assert on devlink instance lock and use it in notifications which may be called without devlink instance lock held. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
* devlink: Allow taking device lock in pre_doit operationsIdo Schimmel2023-11-181-1/+2
| | | | | | | | | | | | | | | | Introduce a new private flag ('DEVLINK_NL_FLAG_NEED_DEV_LOCK') to allow netlink commands to specify that they need to acquire the device lock in their pre_doit operation and release it in their post_doit operation. The reload command will use this flag in the subsequent patch. No functional changes intended. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* devlink: rename netlink callback to be aligned with the generated onesJiri Pirko2023-10-231-4/+4
| | | | | | | | | | | All remaining doit and dumpit netlink callback functions are going to be used by generated split ops. They expect certain name format. Rename the callback to be aligned with generated names. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20231021112711.660606-8-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* devlink: push region related code into separate fileJiri Pirko2023-08-281-0/+1260
Cut out another chunk from leftover.c and put region related code into a separate file. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/20230828061657.300667-9-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>