diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2022-11-28 23:36:43 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-12-01 07:54:30 +0300 |
commit | 2d4caf0988bd3e9663c300e95cead91f2f954fae (patch) | |
tree | 8b57063cb00c967cff34ff9e54f449aa6909f319 /tools | |
parent | 284e9d1ebbe2944d95120f85054d161a6fccbf7f (diff) | |
download | linux-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