Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 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
6ea5f08
ioctl: add support for MI passthru
igaw Jul 8, 2025
9940a59
ioctl: add aligment and lenght check to nvme_fw_download
igaw Jun 11, 2025
14ea87b
mi: replace dedicated MI API with generic one
igaw May 28, 2025
8fd6a01
src: return error codes directly
igaw Jul 11, 2025
42e6fc6
ioctl: add nvme_identify_partial
igaw Jul 31, 2025
d67479e
mi: remove nvme_mi_admin_identify{_partial}
igaw Jul 31, 2025
d8e4eaa
fabrics: fix nvme_get_adrfam function description parameter ctrl as c
ikegami-t Aug 11, 2025
dc17c23
ioctl: nvme_identify use nvme_passthru_cmd directly
igaw Jul 31, 2025
38f38ec
ioctl: reorder nvme_get_log and nvme_get_log_page
igaw Jul 30, 2025
80c5d09
ioctl: nvme_get_log use nvme_passthru_cmd directly
igaw Jul 29, 2025
02e510f
test: fix rae and lsp handling in log page tests
igaw Aug 8, 2025
7d54c59
ioctl: nvme_format_nvm use nvme_passthru_cmd directly
igaw Aug 1, 2025
a3ef0ad
ioctl: nvme_ns_mgmt use nvme_passthru_cmd directly
igaw Aug 1, 2025
481d146
ioctl: nvme_ns_attach use nvme_passthru_cmd directly
igaw Aug 1, 2025
0faa6a8
ioctl: nvme_ns_download use nvme_passthru_cmd directly
igaw Aug 1, 2025
18cab04
ioctl: nvme_fw_commit use nvme_passthru_cmd directly
igaw Aug 1, 2025
2b038c3
ioctl: nvme_security_send use nvme_passthru_cmd directly
igaw Aug 1, 2025
967f3b3
ioctl: nvme_set_features use nvme_passthru_cmd directly
MaisenbacherD Jul 30, 2025
31fcba5
ioctl: nvme_dsm use nvme_passthru_cmd directly
ikegami-t Aug 2, 2025
1ee0b20
ioctl: nvme_io use nvme_passthru_cmd directly
ikegami-t Aug 2, 2025
c156322
ioctl: update nvme_io related APIs
igaw Sep 16, 2025
c39f6fa
ioctl: add dsm and io commands dword fields
ikegami-t Aug 3, 2025
9ad340d
ioctl: nvme_copy use nvme_passthru_cmd directly
ikegami-t Aug 4, 2025
be1b664
ioctl: nvme_copy update API
igaw Sep 16, 2025
364f96b
ioctl: nvme_resv_acquire use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
d0af748
ioctl: nvme_resv_register use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
69178b0
ioctl: nvme_resv_release use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
f1170b4
ioctl: nvme_resv_report use nvme_passthru_cmd directly
ikegami-t Aug 10, 2025
90ff814
ioctl: nvme_io_mgmt_recv use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
e584fe6
ioctl: nvme_io_mgmt_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
75f12ec
ioctl: nvme_zns_mgmt_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
95ac9c1
ioctl: nvme_zns_mgmt_recv use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
f3a1f9c
ioctl: nvme_zns_append use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
28092d1
ioctl: nvme_dim_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
8dc1a47
ioctl: nvme_lm_cdq use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
9f580d1
ioctl: nvme_lm_track_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
1c2df1c
ioctl: nvme_lm_migration_send use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
561d885
ioctl: nvme_lm_migration_recv use nvme_passthru_cmd directly
ikegami-t Aug 11, 2025
2c10be3
ioctl: nvme_security_receive use nvme_passthru_cmd directly
ikegami-t Aug 25, 2025
1c2ae56
ioctl: nvme_get_lba_status use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
70a1fb0
ioctl: nvme_directive_send use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
07d5b56
ioctl: nvme_directive_recv use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
548ef04
ioctl: nvme_virtual_mgmt use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
b7db561
ioctl: nvme_dev_self_test use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
08e608d
ioctl: nvme_sanitize_nvm use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
44869a3
ioctl: nvme_get_property use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
c05e0c9
ioctl: nvme_set_property use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
86de51a
ioctl: nvme_lockdown use nvme_passthru_cmd directly
ikegami-t Aug 31, 2025
f4c86b8
ioctl: nvme_capacity_mgmt use nvme_passthru_cmd directly
ikegami-t Sep 5, 2025
2ea5717
ioctl: nvme_get_features use nvme_passthru_cmd directly
MaisenbacherD Aug 11, 2025
3335692
ioctl: remove unused enum features
igaw Sep 5, 2025
21f985a
ioctl: refactor nvme_get_log_partial uring
ikegami-t Sep 3, 2025
da8efc4
test/zns: fix kernel-doc-check warnings
ikegami-t Aug 19, 2025
6e032f2
examples: fix mi-mctp.c kernel-doc-check warning
ikegami-t Aug 25, 2025
131fd56
examples: do not use "/**" opening comment mark
ikegami-t Sep 2, 2025
660b33e
test: fix mi.c kernel-doc-check warning
ikegami-t Aug 31, 2025
625604a
ioctl: correct nvme_copy reftag parameter type
ikegami-t Sep 17, 2025
914797e
ioctl: remove unnecessary nvme_resv_acquire nrkey parameter
ikegami-t Sep 17, 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