Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
00c9d1c
src: introduce link handle
igaw May 26, 2025
614020c
ioctl: fix get_log_partial to use uring for link type direct
ikegami-t Sep 2, 2025
d6fde8f
api-types: remove unused fd members
igaw May 27, 2025
4828c6e
linux: add nvme_link_get_fd
igaw May 28, 2025
af7ab25
linux: add nvme_link_get_name
igaw Jun 4, 2025
00a466c
linux: add nvme_link_is_{blk|char}dev
igaw Jun 5, 2025
f67db12
mi: replace nvme_mi_ctrl_t with nvme_link_t
igaw Jul 7, 2025
a8da5ab
linux: add MI support to nvme_{open|close}
igaw Jul 8, 2025
e3fbd26
linux: add nvme_link_is_{direct|mi}
igaw Jul 9, 2025
1e8f0af
ioctl: add support for MI passthru
igaw Jul 8, 2025
94fed25
ioctl: add aligment and lenght check to nvme_fw_download
igaw Jun 11, 2025
d87698e
mi: replace dedicated MI API with generic one
igaw May 28, 2025
dacdc34
src: return error codes directly
igaw Jul 11, 2025
6e3ec44
ioctl: add nvme_identify_partial
igaw Jul 31, 2025
0b0e6f8
mi: remove nvme_mi_admin_identify{_partial}
igaw Jul 31, 2025
93fcc58
fabrics: fix nvme_get_adrfam function description parameter ctrl as c
ikegami-t Aug 11, 2025
e4a5649
ioctl: nvme_identify use nvme_passthru_cmd directly
igaw Jul 31, 2025
1027faa
ioctl: reorder nvme_get_log and nvme_get_log_page
igaw Jul 30, 2025
693fe1c
ioctl: nvme_get_log use nvme_passthru_cmd directly
igaw Jul 29, 2025
e708316
test: fix rae and lsp handling in log page tests
igaw Aug 8, 2025
b5588f8
ioctl: nvme_format_nvm use nvme_passthru_cmd directly
igaw Aug 1, 2025
f8664b4
ioctl: nvme_ns_mgmt use nvme_passthru_cmd directly
igaw Aug 1, 2025
54008b7
ioctl: nvme_ns_attach use nvme_passthru_cmd directly
igaw Aug 1, 2025
6f5f173
ioctl: nvme_ns_download use nvme_passthru_cmd directly
igaw Aug 1, 2025
c448831
ioctl: nvme_fw_commit use nvme_passthru_cmd directly
igaw Aug 1, 2025
a8d3e64
ioctl: nvme_security_send use nvme_passthru_cmd directly
igaw Aug 1, 2025
b6c6bd5
ioctl: nvme_set_features use nvme_passthru_cmd directly
MaisenbacherD Jul 30, 2025
2d5ecce
ioctl: nvme_dsm use nvme_passthru_cmd directly
ikegami-t Aug 2, 2025
569d7cb
ioctl: nvme_io use nvme_passthru_cmd directly
ikegami-t Aug 2, 2025
0722528
ioctl: add dsm and io commands dword fields
ikegami-t Aug 3, 2025
d356c2c
ioctl: nvme_copy use nvme_passthru_cmd directly
ikegami-t Aug 4, 2025
4d0dbc8
ioctl: update nvme_copy to latest spec
igaw Sep 11, 2025
71fbee6
ioctl: nvme_resv_acquire use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
b11f84c
ioctl: nvme_resv_register use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
c6d948a
ioctl: nvme_resv_release use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
9e9192f
ioctl: nvme_resv_report use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
ccb16ab
ioctl: nvme_io_mgmt_recv use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
676cc91
ioctl: nvme_io_mgmt_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
6fa762b
ioctl: nvme_zns_mgmt_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
6de7684
ioctl: nvme_zns_mgmt_recv use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
0b03974
ioctl: nvme_zns_append use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
33aac8e
ioctl: nvme_dim_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
f879f9d
ioctl: nvme_lm_cdq use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
64452cc
ioctl: nvme_lm_track_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
aae70db
ioctl: nvme_lm_migration_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
ac92cba
ioctl: nvme_lm_migration_recv use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
e09d95e
ioctl: nvme_security_receive use nvme_passthru_cmd directly
ikegami-t Aug 25, 2025
3fd3822
ioctl: nvme_get_lba_status use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
81d39e4
ioctl: nvme_directive_send use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
3111c42
ioctl: nvme_directive_recv use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
84327cf
ioctl: nvme_virtual_mgmt use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
3cd80d7
ioctl: nvme_dev_self_test use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
74357c0
ioctl: nvme_sanitize_nvm use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
2849afc
ioctl: nvme_get_property use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
ab406b0
ioctl: nvme_set_property use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
3237738
ioctl: nvme_lockdown use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
1d77ff7
ioctl: nvme_capacity_mgmt use nvme_passthru_cmd directly
ikegami-t Sep 5, 2025
7704771
ioctl: nvme_get_features use nvme_passthru_cmd directly
MaisenbacherD Aug 11, 2025
08c6a7a
ioctl: remove unused enum features
igaw Sep 5, 2025
c7f405c
ioctl: refactor nvme_get_log_partial uring
ikegami-t Sep 3, 2025
34458f0
test/zns: fix kernel-doc-check warnings
ikegami-t Aug 19, 2025
5ffe547
examples: fix mi-mctp.c kernel-doc-check warning
ikegami-t Aug 25, 2025
356c4d9
examples: do not use "/**" opening comment mark
ikegami-t Sep 2, 2025
3f29f90
test: fix mi.c kernel-doc-check warning
ikegami-t Aug 31, 2025
f01d77e
nvme_format_nvm: merge lbafl and lbafu into one argument
MaisenbacherD Sep 15, 2025
5793550
nvme_security_send: merge spsp0 and spsp1 into one argument
MaisenbacherD Sep 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions examples/discover-loop.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/**
/*
* This file is part of libnvme.
* Copyright (c) 2020 Western Digital Corporation or its affiliates.
*
* Authors: Keith Busch <[email protected]>
*/

/**
/*
* discover-loop: Use fabrics commands to discover any loop targets and print
* those records. You must have at least one configured nvme loop target on the
* system (no existing connection required). The output will look more
Expand Down Expand Up @@ -59,22 +59,24 @@ int main()

nvmf_default_config(&cfg);

r = nvme_scan(NULL);
h = nvme_default_host(r);
if (!h) {
ret = nvme_scan(NULL, &r);
if (ret)
return ret;
ret = nvme_default_host(r, &h);
if (ret) {
fprintf(stderr, "Failed to allocated memory\n");
return ENOMEM;
return ret;
}
c = nvme_create_ctrl(r, NVME_DISC_SUBSYS_NAME, "loop",
NULL, NULL, NULL, NULL);
if (!c) {
ret = nvme_create_ctrl(r, NVME_DISC_SUBSYS_NAME, "loop",
NULL, NULL, NULL, NULL, &c);
if (ret) {
fprintf(stderr, "Failed to allocate memory\n");
return ENOMEM;
}
ret = nvmf_add_ctrl(h, c, &cfg);
if (ret < 0) {
if (ret) {
fprintf(stderr, "no controller found\n");
return errno;
return ret;
}

ret = nvmf_get_discovery_log(c, &log, 4);
Expand Down
7 changes: 3 additions & 4 deletions examples/display-columnar.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/**
/*
* This file is part of libnvme.
* Copyright (c) 2020 Western Digital Corporation or its affiliates.
*
* Authors: Keith Busch <[email protected]>
*/

/**
/*
* display-columnar: Scans the nvme topology, prints each record type in a
* column format for easy visual scanning.
*/
Expand All @@ -24,8 +24,7 @@ int main()
nvme_path_t p;
nvme_ns_t n;

r = nvme_scan(NULL);
if (!r)
if (nvme_scan(NULL, &r))
return -1;


Expand Down
7 changes: 3 additions & 4 deletions examples/display-tree.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/**
/*
* This file is part of libnvme.
* Copyright (c) 2020 Western Digital Corporation or its affiliates.
*
* Authors: Keith Busch <[email protected]>
*/

/**
/*
* display-tree: Scans the nvme topology, prints as an ascii tree with some
* selected attributes for each component.
*/
Expand All @@ -23,8 +23,7 @@ int main()
nvme_path_t p, _p;
nvme_ns_t n, _n;

r = nvme_scan(NULL);
if (!r)
if (nvme_scan(NULL, &r))
return -1;

printf(".\n");
Expand Down
4 changes: 2 additions & 2 deletions examples/mi-conf.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/**
/*
* This file is part of libnvme.
* Copyright (c) 2022 Code Construct Pty Ltd.
*
* Authors: Jeremy Kerr <[email protected]>
*/

/**
/*
* mi-conf: query a device for optimal MTU and set for both the local MCTP
* route (through dbus to mctpd) and the device itself (through NVMe-MI
* configuration commands)
Expand Down
6 changes: 3 additions & 3 deletions examples/mi-mctp-ae.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/**
/*
* This file is part of libnvme.
*/

/**
/*
* mi-mctp-ae: open a MI connection over MCTP, supporting asynchronous event messages
*/

Expand Down Expand Up @@ -131,7 +131,7 @@ int main(int argc, char **argv)
}

rc = nvme_mi_aem_enable(ep, &aem_config, &data);
if (rc && errno == EOPNOTSUPP)
if (rc == EOPNOTSUPP)
errx(EXIT_FAILURE, "MCTP Peer-Bind is required for AEM");
else if (rc)
err(EXIT_FAILURE, "Can't enable aem:%d", rc);
Expand Down
30 changes: 15 additions & 15 deletions examples/mi-mctp-csi-test.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/**
/*
* This file is part of libnvme.
*/

/**
/*
* mi-mctp-csi-test: open a MI connection over MCTP, and send two commands
* in parallel with different CSI buffers
*/
Expand Down Expand Up @@ -56,8 +56,8 @@ void hexdump(const unsigned char *buf, int len)

int do_get_log_page(nvme_mi_ep_t ep, int argc, char **argv)
{
struct nvme_get_log_args args = { 0 };
struct nvme_mi_ctrl *ctrl;
enum nvme_cmd_get_log_lid lid;
struct nvme_link *link;
uint8_t buf[4096];
uint16_t ctrl_id;
int rc, tmp;
Expand All @@ -75,31 +75,31 @@ int do_get_log_page(nvme_mi_ep_t ep, int argc, char **argv)

ctrl_id = tmp & 0xffff;

args.args_size = sizeof(args);
args.log = buf;
args.len = sizeof(buf);

if (argc > 2) {
tmp = atoi(argv[2]);
args.lid = tmp & 0xff;
lid = tmp & 0xff;
} else {
args.lid = 0x1;
lid = 0x1;
}

ctrl = nvme_mi_init_ctrl(ep, ctrl_id);
if (!ctrl) {
link = nvme_mi_init_link(ep, ctrl_id);
if (!link) {
warn("can't create controller");
return -1;
}

rc = nvme_mi_admin_get_log(ctrl, &args);
rc = nvme_get_log(link, NVME_NSID_NONE, false, NVME_LOG_LSP_NONE,
lid, NVME_LOG_LSI_NONE, NVME_CSI_NVM,
false, NVME_UUID_NONE,
0, buf, sizeof(buf),
sizeof(buf), NULL);
if (rc) {
warn("can't perform Get Log page command");
return -1;
}

printf("Get log page (log id = 0x%02x) data:\n", args.lid);
hexdump(buf, args.len);
printf("Get log page (log id = 0x%02x) data:\n", lid);
hexdump(buf, sizeof(buf));

return 0;
}
Expand Down
Loading