summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2022-11-28 23:36:43 +0300
committerJakub Kicinski <kuba@kernel.org>2022-12-01 07:54:30 +0300
commit2d4caf0988bd3e9663c300e95cead91f2f954fae (patch)
tree8b57063cb00c967cff34ff9e54f449aa6909f319 /tools
parent284e9d1ebbe2944d95120f85054d161a6fccbf7f (diff)
downloadlinux-2d4caf0988bd3e9663c300e95cead91f2f954fae.tar.xz
devlink: refactor region_read_snapshot_fill to use a callback function
The devlink_nl_region_read_snapshot_fill is used to copy the contents of a snapshot into a message for reporting to userspace via the DEVLINK_CMG_REGION_READ netlink message. A future change is going to add support for directly reading from a region. Almost all of the logic for this new capability is identical. To help reduce code duplication and make this logic more generic, refactor the function to take a cb and cb_priv pointer for doing the actual copy. Add a devlink_region_snapshot_fill implementation that will simply copy the relevant chunk of the region. This does require allocating some storage for the chunk as opposed to simply passing the correct address forward to the devlink_nl_cmg_region_read_chunk_fill function. A future change to implement support for directly reading from a region without a snapshot will provide a separate implementation that calls the newly added devlink region operation. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions