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
f4a1c73
api-types: move nvme_root_t to new place
igaw Jul 7, 2025
0fefaee
src: introduce link handle
igaw May 26, 2025
6a31e42
ioctl: fix get_log_partial to use uring for link type direct
ikegami-t Sep 2, 2025
e41691e
api-types: remove unused fd members
igaw May 27, 2025
fc14a7e
linux: add nvme_link_get_fd
igaw May 28, 2025
fa1a3f1
linux: add nvme_link_get_name
igaw Jun 4, 2025
e602ac8
linux: add nvme_link_is_{blk|char}dev
igaw Jun 5, 2025
bade4b1
mi: replace nvme_mi_ctrl_t with nvme_link_t
igaw Jul 7, 2025
f6eeac3
linux: add MI support to nvme_{open|close}
igaw Jul 8, 2025
034a6e9
linux: add nvme_link_is_{direct|mi}
igaw Jul 9, 2025
2deb8a8
ioctl: add support for MI passthru
igaw Jul 8, 2025
f8ec3dc
ioctl: add aligment and lenght check to nvme_fw_download
igaw Jun 11, 2025
3b460ae
mi: replace dedicated MI API with generic one
igaw May 28, 2025
4592845
src: return error codes directly
igaw Jul 11, 2025
443b72e
ioctl: add nvme_identify_partial
igaw Jul 31, 2025
88bac18
mi: remove nvme_mi_admin_identify{_partial}
igaw Jul 31, 2025
40bf009
fabrics: fix nvme_get_adrfam function description parameter ctrl as c
ikegami-t Aug 11, 2025
9ce13d9
ioctl: nvme_identify use nvme_passthru_cmd directly
igaw Jul 31, 2025
0810fef
ioctl: reorder nvme_get_log and nvme_get_log_page
igaw Jul 30, 2025
ca10a4d
ioctl: nvme_get_log use nvme_passthru_cmd directly
igaw Jul 29, 2025
8a43299
test: fix rae and lsp handling in log page tests
igaw Aug 8, 2025
e7e9143
ioctl: nvme_format_nvm use nvme_passthru_cmd directly
igaw Aug 1, 2025
139eb6d
ioctl: nvme_ns_mgmt use nvme_passthru_cmd directly
igaw Aug 1, 2025
ba80d26
ioctl: nvme_ns_attach use nvme_passthru_cmd directly
igaw Aug 1, 2025
e58de59
ioctl: nvme_ns_download use nvme_passthru_cmd directly
igaw Aug 1, 2025
df17c25
ioctl: nvme_fw_commit use nvme_passthru_cmd directly
igaw Aug 1, 2025
67d41a2
ioctl: nvme_security_send use nvme_passthru_cmd directly
igaw Aug 1, 2025
7d7d67d
ioctl: nvme_set_features use nvme_passthru_cmd directly
MaisenbacherD Jul 30, 2025
49b23a5
ioctl: nvme_dsm use nvme_passthru_cmd directly
ikegami-t Aug 2, 2025
1b35385
ioctl: nvme_io use nvme_passthru_cmd directly
ikegami-t Aug 2, 2025
543b740
ioctl: add dsm and io commands dword fields
ikegami-t Aug 3, 2025
93bacb9
ioctl: nvme_copy use nvme_passthru_cmd directly
ikegami-t Aug 4, 2025
54589e3
ioctl: update nvme_copy to latest spec
igaw Sep 11, 2025
7a8dfef
ioctl: nvme_resv_acquire use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
4d92dba
ioctl: nvme_resv_register use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
bac8187
ioctl: nvme_resv_release use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
157f10a
ioctl: nvme_resv_report use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
3bad7e6
ioctl: nvme_io_mgmt_recv use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
b304791
ioctl: nvme_io_mgmt_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
9f1d786
ioctl: nvme_zns_mgmt_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
b34092f
ioctl: nvme_zns_mgmt_recv use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
f0b9aa7
ioctl: nvme_zns_append use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
f83b1b2
ioctl: nvme_dim_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
cc71ada
ioctl: nvme_lm_cdq use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
6194feb
ioctl: nvme_lm_track_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
e88499e
ioctl: nvme_lm_migration_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
7dbc090
ioctl: nvme_lm_migration_recv use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
bdc1952
ioctl: nvme_security_receive use nvme_passthru_cmd directly
ikegami-t Aug 25, 2025
219c26b
ioctl: nvme_get_lba_status use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
3e8e5da
ioctl: nvme_directive_send use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
e16123b
ioctl: nvme_directive_recv use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
02a60de
ioctl: nvme_virtual_mgmt use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
5bdac34
ioctl: nvme_dev_self_test use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
2312b44
ioctl: nvme_sanitize_nvm use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
7107c2d
ioctl: nvme_get_property use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
db6e7e4
ioctl: nvme_set_property use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
6afd7c9
ioctl: nvme_lockdown use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
932ba27
ioctl: nvme_capacity_mgmt use nvme_passthru_cmd directly
ikegami-t Sep 5, 2025
b62c63f
ioctl: nvme_get_features use nvme_passthru_cmd directly
MaisenbacherD Aug 11, 2025
3c347af
ioctl: remove unused enum features
igaw Sep 5, 2025
861d7b2
ioctl: refactor nvme_get_log_partial uring
ikegami-t Sep 3, 2025
4a44ef6
test/zns: fix kernel-doc-check warnings
ikegami-t Aug 19, 2025
ec2a1bc
examples: fix mi-mctp.c kernel-doc-check warning
ikegami-t Aug 25, 2025
490db9c
examples: do not use "/**" opening comment mark
ikegami-t Sep 2, 2025
b911a1a
test: fix mi.c kernel-doc-check warning
ikegami-t Aug 31, 2025
f6436ae
ioctl: add return value for nvme_set_features_iocs_profile
MaisenbacherD Sep 16, 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
26 changes: 14 additions & 12 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 All @@ -86,7 +88,7 @@ int main()
else
print_discover_log(log);

nvme_free_tree(r);
nvme_free_root(r);
free(log);
return 0;
}
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
9 changes: 4 additions & 5 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 Expand Up @@ -67,6 +66,6 @@ int main()
}
}
}
nvme_free_tree(r);
nvme_free_root(r);
return 0;
}
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