support direct read from region
Status from this message: This series was applied to netdev/net-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest9 patches 1 replyApplied 9/9
- v29 patches 16 repliesSuperseded
- v18 patches 17 repliesSuperseded
Changes in v3 from the cover letter
* Picked up ack/review tags
* Added DEVLINK_ATTR_REGION_DIRECT so userspace must be explicit
* Fixed the capitalization of netlink error messages
Patches in v3 All 9 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | devlink: use min_t to calculate data_sizenet/ | +2 | 0 replies | Applied |
| 2/9 | devlink: report extended error message in region_read_dumpit()net/ | +12 | 0 replies | Applied |
| 3/9 | devlink: find snapshot in devlink_nl_cmd_region_read_dumpitnet/ | +14 | 0 replies | Applied |
| 4/9 | devlink: remove unnecessary parameter from chunk_fill functionnet/ | +2 | 0 replies | Applied |
| 5/9 | devlink: refactor region_read_snapshot_fill to use a callback functionnet/ | +35 | 0 replies | Applied |
| 6/9 | devlink: support directly reading from region memoryDocumentation/ include/ include/ +1 more | +94 | 1 reply | Applied |
| 7/9 | ice: use same function to snapshot both NVM and Shadow RAMdrivers/ | +23 | 0 replies | Applied |
| 8/9 | ice: document 'shadow-ram' devlink regionDocumentation/ | +5 | 0 replies | Applied |
| 9/9 | ice: implement direct read for NVM and Shadow RAM regionsDocumentation/ drivers/ | +75 | 0 replies | Applied |
Reviews trailers per patch
All 9 patches have a Reviewed-by or Acked-by.
| Patch | Jakub Kicinski | Jiri Pirko |
|---|---|---|
| 1/9 | A-b | R-b |
| 2/9 | A-b | R-b |
| 3/9 | A-b | R-b |
| 4/9 | A-b | R-b |
| 5/9 | A-b | R-b |
| 6/9 | R-b | |
| 7/9 | A-b | |
| 8/9 | A-b | |
| 9/9 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next v3 0/9] support direct read from region
Changes since v2:
* Picked up ack/review tags
* Added DEVLINK_ATTR_REGION_DIRECT so userspace must be explicit
* Fixed the capitalization of netlink error messages
Changes since v1:
* Re-ordered patches at the beginning slightly, pulling min_t change and reporting of extended error messages to the start of the series.
* use NL_SET_ERR_MSG_ATTR for reporting invalid attributes
* Use kmalloc instead of kzalloc
* Cleanup spacing around data_size
* Fix the __always_unused positioning
* Update documentation for direct reads to clearly explain they are not atomic for larger reads.
* Add a patch to fix missing documentation for ice.rst
* Mention the direct read support in ice.rst documentation
A long time ago when initially implementing devlink regions in ice I proposed the ability to allow reading from a region without taking a snapshot [1]. I eventually dropped this work from the original series due to size. Then I eventually lost track of submitting this follow up.
This can be useful when interacting with some region that has some definitive "contents" from which snapshots are made. For example the ice driver has regions representing the contents of the device flash.
If userspace wants to read the contents today, it must first take a snapshot and then read from that snapshot. This makes sense if you want to read a large portion of data or you want to be sure reads are consistently from the same recording of the flash.
However if user space only wants to read a small chunk, it must first generate a snapshot of the entire contents, perform a read from the snapshot, and then delete the snapshot after reading.
For such a use case, a direct read from the region makes more sense. This can be achieved by allowing the devlink region read command to work without a snapshot. Instead the portion to be read can be forwarded directly to the driver via a new .read callback.
This avoids the need to read the entire region contents into memory first and avoids the software overhead of creating a snapshot and then deleting it.
This series implements such behavior and hooks up the ice NVM and shadow RAM regions to allow it.
[1] https://lore.kernel.org/netdev/[email protected]/
Jacob Keller (9):
devlink: use min_t to calculate data_size
devlink: report extended error message in region_read_dumpit()
devlink: find snapshot in devlink_nl_cmd_region_read_dumpit
devlink: remove unnecessary parameter from chunk_fill function
devlink: refactor region_read_snapshot_fill to use a callback function
devlink: support directly reading from region memory
ice: use same function to snapshot both NVM and Shadow RAM
ice: document 'shadow-ram' devlink region
ice: implement direct read for NVM and Shadow RAM regions
.../networking/devlink/devlink-region.rst | 13 ++ Documentation/networking/devlink/ice.rst | 13 +- drivers/net/ethernet/intel/ice/ice_devlink.c | 112 ++++++++------ include/net/devlink.h | 16 ++ include/uapi/linux/devlink.h | 2 + net/core/devlink.c | 139 ++++++++++++++---- 6 files changed, 215 insertions(+), 80 deletions(-)
base-commit: c672e37279896f570cfa44926d57497e8d16033b
Signature · 1 line
2.38.1.420.g319605f8f00e