Skip to content

Conversation

@MaisenbacherD
Copy link

@ikegami-t Sorry I was not aware that I had to touch the nvme_zns_append parameters again when I did the reviews on your commits for the same function.

I am conflicting with these commits:
#30
nvme-experiments/nvme-cli#7

igaw and others added 30 commits September 19, 2025 09:28
The MI code has the alignment and length check which the the direct APIs
are missing. Without these checks the download tests for MI will fail
after using the generic APIs.

Signed-off-by: Daniel Wagner <[email protected]>
With the introduction of the link handle, it's possible to use the
generic nvme API. The transport selection happens on lower levels
depending on the link object type.

Note, the tests rely on using the ioctl interface and not the io_uring.

Signed-off-by: Daniel Wagner <[email protected]>
The v1 design used the POSIX way to return errors, return -1 with errno
set.

Replace this design by returning directly the error code. That means non
trivial function have to return any data via a pointer so the function
is able to return proper error codes.

Signed-off-by: Daniel Wagner <[email protected]>
MI doesn't access the complete identify data struct and thus
only transfers a port of it. Add a generic version of this
function.

Signed-off-by: Daniel Wagner <[email protected]>
Use the generic nvme_identify{_partial} interface and drop
the MI specific version.

Signed-off-by: Daniel Wagner <[email protected]>
Since the warning message output by kernel-doc-check.

Signed-off-by: Tokunori Ikegami <[email protected]>
[dennis: fix example]
Signed-off-by: Dennis Maisenbacher <[email protected]>
Signed-off-by: Daniel Wagner <[email protected]>
The next change will add a static inline implementation of nvme_get_log
which uses nvme_get_log_page. Thus move the nvme_get_log_page function
up so it can be used directly.

Signed-off-by: Daniel Wagner <[email protected]>
Refactor nvme_get_log and nvme_get_log_page to use struct
nvme_passthru_cmd directly and drop the struct nvme_get_log_args.

The struct args have are ABI thus it's hard to change it after a
release. The nvme_passthru_cmd buffer is a generic buffer and it's
possible to use the setters directly on the buffer in an inline
function. Besides a reduced API to maintain it also generates better
code and avoids one call less when issue a command.

[ikegami.t: update nvme_uring_cmd_amdin_passthru_async]
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Daniel Wagner <[email protected]>
The compiler warns with

../test/ioctl/logs.c: In function ‘test_get_log_reachability_groups’:
../test/ioctl/logs.c:725:28: warning: enum constant in boolean context [-Wint-in-bool-context]
  725 |                          (!!TEST_LSP << 8) | (!!TEST_RAE << 15) |
      |                            ^
../test/ioctl/logs.c:733:70: warning: enum constant in boolean context [-Wint-in-bool-context]
  733 |         err = nvme_get_log_reachability_groups(test_link, TEST_RAE, !!TEST_LSP,
      |                                                                      ^

Update the tests so the types are correctly handled. It also addresses
the problem with the wrong lsp value testing.

Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_format_nvm_args.

[dennis: merge lbafl and lbafu into one argument]
Signed-off-by: Dennis Maisenbacher <[email protected]>
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_ns_mgmt_args.

Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_ns_attach_args.

Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_fw_download_args.

Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_fw_commit_args.

Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_security_send_args.

[dennis: merge spsp0 and spsp1 into one argument]
Signed-off-by: Dennis Maisenbacher <[email protected]>
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_set_features_args.

Signed-off-by: Dennis Maisenbacher <[email protected]>
[wagi: remove libnvme.map entries
       reorder fid and sv argument]
Signed-off-by: Daniel Wagner <[email protected]>

nvme_set_features: fix argument order

Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_dsm_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: reorder arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_io_args.

Signed-off-by: Tokunori Ikegami <[email protected]>

ioctl: reorder nsid argument

Also order the pointer and its length member go to the end of the list.

Signed-off-by: Tokunori Ikegami <[email protected]>
This will be merged into the previous patch after reviewing.

Signed-off-by: Daniel Wagner <[email protected]>
To use the fields in nvme_io() and nvme_dsm() functions.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: update API due to nvme_io API rework]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_copy_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: reorder and adding missing arguments
       update storage/app tag interface]
Signed-off-by: Daniel Wagner <[email protected]>
this patch will be merged into the previous one after reviewing

Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_resv_acquire_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: reorder and missing arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_resv_register_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: reorder and added missing arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_resv_release_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
Drop struct nvme_resv_report_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: reorder and added missing arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_io_mgmt_recv_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: reorder arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_io_mgmt_send_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: reorder arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_zns_mgmt_send_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: reorderd and added missing arguments]
Signed-off-by: Daniel Wagner <[email protected]>
ikegami-t and others added 17 commits September 19, 2025 09:37
Drop struct nvme_get_lba_status_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: reordering arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_directive_send_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: updated nvme_directive_send_id_endir
       reordered arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_directive_recv_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: removed libnvme.map entry
       reordered arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_virtual_mgmt_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: remove libnvme.map entry]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_dev_self_test_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: removed libnvme.map entry]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_sanitize_nvm_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: remove libnvme.map entry
       reorder and rename arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_get_property_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: remove libnvme.map entry]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_set_property_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: remove libnvme.map entry]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_lockdown_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: remove libnvme.map entry]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_capacity_mgmt_args.

Signed-off-by: Tokunori Ikegami <[email protected]>
[wagi: remove libnvme.map entry
       reordered/renamed arguments]
Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_get_features_args.

Signed-off-by: Dennis Maisenbacher <[email protected]>
[wagi: reordered/renamed arguments]
Signed-off-by: Daniel Wagner <[email protected]>
There is no user left of this type in ioctl.c. Remove it.

Signed-off-by: Daniel Wagner <[email protected]>
This is to maintain nvme_get_log_partial easily.

Signed-off-by: Tokunori Ikegami <[email protected]>
Since the following warnings output.

$ ./scripts/kernel-doc-check test/zns.c
test/zns.c:3: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
test/zns.c:10: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Signed-off-by: Tokunori Ikegami <[email protected]>
examples/mi-mctp.c:3: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Signed-off-by: Tokunori Ikegami <[email protected]>
Since checked by kernel-doc-check then the warning message output.

Signed-off-by: Tokunori Ikegami <[email protected]>
To fix the warning message below.
  test/mi.c:3: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Signed-off-by: Tokunori Ikegami <[email protected]>
@MaisenbacherD
Copy link
Author

Fixes
#23
#24

@MaisenbacherD MaisenbacherD force-pushed the libnvme2-dennis-zns-shift-mask branch from 6bcadb6 to 6499e61 Compare September 19, 2025 08:21
Renaming NVME_NVM_CDW* SHIFT and MASK enum members to
NVME_IOCS_COMMON_CDW*.
The ZNS IO command set (IOCS) has the same fields and offsets for the CDWs
in question.
Replacing STCR with two enum entries for CDW12 bit 25 as this bit can only
be Reserved, DEAC or PIREMAP. STCR is part of the copy command which has
its own enum members for CDW12.

The NVME_IOCS_COMMON_CDW* entries cover now
nvme_read
nvme_write
nvme_compare
nvme_write_zeros
nvme_write_uncorrectable
nvme_zns_append

This is in preparation for the following commit which introduces the
shift masks for the zone append command.

Signed-off-by: Dennis Maisenbacher <[email protected]>
@MaisenbacherD MaisenbacherD force-pushed the libnvme2-dennis-zns-shift-mask branch from 6499e61 to e4960e5 Compare September 19, 2025 08:30
The ZNS end-to-end protection information tags are behaving analog to
the NVM command set. Use the same nvme_set_var_size_tags helper function
to parse PI tags into the relevant CDWs.

Signed-off-by: Dennis Maisenbacher <[email protected]>
Replace hardcoded MASK and SHIFT values with enum entries for
nvme_zns_append.

Signed-off-by: Dennis Maisenbacher <[email protected]>
@igaw
Copy link

igaw commented Sep 19, 2025

I've integrated this one. I reorder the nvme_zns_append arguments once more. It matches the order of the other commands, that is the labt, labtm, data and metadata order . For some reason I decided that we have first the data and then the metadata. We can change that if this sucks. For this intergration I have chosen to stick with the existing pattern.

@igaw igaw closed this Sep 19, 2025
@MaisenbacherD MaisenbacherD deleted the libnvme2-dennis-zns-shift-mask branch September 23, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants