|
| 1 | +From cd1238744243e837f8b33f47f9cddff9d96de03c Mon Sep 17 00:00:00 2001 |
| 2 | +From: Clayton Craft < [email protected]> |
| 3 | +Date: Mon, 15 Sep 2025 08:19:27 -0700 |
| 4 | +Subject: [PATCH] tree: support apple-nvme transport |
| 5 | + |
| 6 | +Apple silicon support on Linux uses a separate platform driver called |
| 7 | +'apple-nvme', and libnvme doesn't know about this transport. This fixes |
| 8 | +a "No transport address for 'apple-nvme'" error when running on Apple |
| 9 | +silicon, where libnvme was unable to enumerate nvme storage attached to |
| 10 | +this platform. |
| 11 | + |
| 12 | +$ nvme list |
| 13 | +Node Generic SN Model Namespace Usage Format FW Rev |
| 14 | +--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- -------- |
| 15 | +/dev/nvme0n1 /dev/ng0n1 xxxxxxxxxxxxxxxx APPLE SSD AP2048Z 0x1 2.00 TB / 2.00 TB 4 KiB + 0 B 532.140. |
| 16 | +... |
| 17 | + |
| 18 | +Signed-off-by: Clayton Craft < [email protected]> |
| 19 | +--- |
| 20 | + src/nvme/tree.c | 3 ++- |
| 21 | + 1 file changed, 2 insertions(+), 1 deletion(-) |
| 22 | + |
| 23 | +diff --git a/src/nvme/tree.c b/src/nvme/tree.c |
| 24 | +index d7970743..e4ac90a3 100644 |
| 25 | +--- a/src/nvme/tree.c |
| 26 | ++++ b/src/nvme/tree.c |
| 27 | +@@ -1417,7 +1417,8 @@ struct nvme_ctrl *nvme_create_ctrl(nvme_root_t r, |
| 28 | + return NULL; |
| 29 | + } |
| 30 | + if (strncmp(transport, "loop", 4) && |
| 31 | +- strncmp(transport, "pcie", 4) && !traddr) { |
| 32 | ++ strncmp(transport, "pcie", 4) && |
| 33 | ++ strncmp(transport, "apple-nvme", 10) && !traddr) { |
| 34 | + nvme_msg(r, LOG_ERR, "No transport address for '%s'\n", |
| 35 | + transport); |
| 36 | + errno = EINVAL; |
| 37 | +-- |
| 38 | +2.51.0 |
| 39 | + |
0 commit comments