Skip to content

Conversation

@MaisenbacherD
Copy link

No description provided.

ikegami-t and others added 30 commits October 27, 2025 18:28
Just added only functions frequently used in nvme-cli.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
[wagi: - addded documentation]
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
igaw and others added 18 commits October 27, 2025 18:29
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Replace the struct args approach by providing init function for
initializing the passthru commands. This reduces the dependency between
callside and library.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
There is no user left of this type in ioctl.c. Remove it.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Refactore so we maintain nvme_get_log_partial easier.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
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 <ikegami.t@gmail.com>
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 <ikegami.t@gmail.com>
Since checked by kernel-doc-check then the warning message output.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
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 <ikegami.t@gmail.com>
The api-types.h include file provided struct args definition. These are
all gone. But some basic types have been added in the meantime, which
need to be present when using the types.h header.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
As we have renamed nvme_root to nvme_global_ctx, the Python bindings
example needs to be adjusted to reflect the refactoring.

Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
The error handling has changed from returning -1 and errno set to just
returing the error code. Negative values are internal errors, e.g.
-ENOMEM. Positive values are status code from the transport.

Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
This is to resolve the build warnings below.

In function ‘nvme_init_app_tag’,
    inlined from ‘test_verify’ at ../test/ioctl/misc.c:961:2:
../src/nvme/ioctl.h:4514:20: warning: array subscript ‘struct nvme_passthru_cmd64[0]’ is partly outside array bounds of ‘struct nvme_passthru_cmd[1]’ [-Warray-bounds=]
 4514 |         cmd->cdw15 = NVME_FIELD_ENCODE(lbat,
      |                    ^
../test/ioctl/misc.c: In function ‘test_verify’:
../test/ioctl/misc.c:955:34: note: object ‘cmd’ of size 72
  955 |         struct nvme_passthru_cmd cmd;
      |                                  ^~~
In function ‘nvme_init_app_tag’,
    inlined from ‘test_compare’ at ../test/ioctl/misc.c:865:2:
../src/nvme/ioctl.h:4514:20: warning: array subscript ‘struct nvme_passthru_cmd64[0]’ is partly outside array bounds of ‘struct nvme_passthru_cmd[1]’ [-Warray-bounds=]
 4514 |         cmd->cdw15 = NVME_FIELD_ENCODE(lbat,
      |                    ^
../test/ioctl/misc.c: In function ‘test_compare’:
../test/ioctl/misc.c:857:34: note: object ‘cmd’ of size 72
  857 |         struct nvme_passthru_cmd cmd;
      |                                  ^~~
In function ‘nvme_init_app_tag’,
    inlined from ‘test_write’ at ../test/ioctl/misc.c:830:2:
../src/nvme/ioctl.h:4514:20: warning: array subscript ‘struct nvme_passthru_cmd64[0]’ is partly outside array bounds of ‘struct nvme_passthru_cmd[1]’ [-Warray-bounds=]
 4514 |         cmd->cdw15 = NVME_FIELD_ENCODE(lbat,
      |                    ^
../test/ioctl/misc.c: In function ‘test_write’:
../test/ioctl/misc.c:823:34: note: object ‘cmd’ of size 72
  823 |         struct nvme_passthru_cmd cmd;
      |                                  ^~~
In function ‘nvme_init_app_tag’,
    inlined from ‘test_read’ at ../test/ioctl/misc.c:794:2:
../src/nvme/ioctl.h:4514:20: warning: array subscript ‘struct nvme_passthru_cmd64[0]’ is partly outside array bounds of ‘struct nvme_passthru_cmd[1]’ [-Warray-bounds=]
 4514 |         cmd->cdw15 = NVME_FIELD_ENCODE(lbat,
      |                    ^
../test/ioctl/misc.c: In function ‘test_read’:
../test/ioctl/misc.c:787:34: note: object ‘cmd’ of size 72
  787 |         struct nvme_passthru_cmd cmd;
      |                                  ^~~
In function ‘nvme_init_app_tag’,
    inlined from ‘test_write_zeros’ at ../test/ioctl/misc.c:898:2:
../src/nvme/ioctl.h:4514:20: warning: array subscript ‘struct nvme_passthru_cmd64[0]’ is partly outside array bounds of ‘struct nvme_passthru_cmd[1]’ [-Warray-bounds=]
 4514 |         cmd->cdw15 = NVME_FIELD_ENCODE(lbat,
      |                    ^
../test/ioctl/misc.c: In function ‘test_write_zeros’:
../test/ioctl/misc.c:892:34: note: object ‘cmd’ of size 72
  892 |         struct nvme_passthru_cmd cmd;
      |                                  ^~~

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Since the almost nvme-cli caller functions expected the base name.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Adding the data buffer and its length to the nvme passthru cmd.

Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
Add get features helper functions that are frequently called in
nvme-cli.

Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
@MaisenbacherD MaisenbacherD changed the title Libnvme3 set and get features Oct 28, 2025
@ikegami-t
Copy link

Looks good.

@igaw
Copy link

igaw commented Oct 29, 2025

I've merged these changed into 9f8dd99 ("ioctl: introduce get/set feature helper functions").

Thanks!

@igaw igaw closed this Oct 29, 2025
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