diff options
| author | Warner Losh <imp@FreeBSD.org> | 2026-04-24 18:31:38 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2026-04-24 18:32:49 +0000 |
| commit | b40205855e100a4bd95f89e97c15d268ef5b3a35 (patch) | |
| tree | 804e90176294cda2700f3c2b8515f5f6e612c933 | |
| parent | cb78764d47db973a1c9d08565143a1b1b7f17513 (diff) | |
nda: Filter non-storage nvme drives
Non-stroage drives have namespaces, but no storage attached. These
drives have a different interface type than storage drives, so ignore
them for the nvme_sim, which just handles storage.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D56461
| -rw-r--r-- | sys/cam/nvme/nvme_da.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index be578bae5da5..ac1e1f09e2af 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -49,6 +49,7 @@ #include <sys/sbuf.h> #include <geom/geom.h> #include <geom/geom_disk.h> +#include <dev/pci/pcireg.h> #endif /* _KERNEL */ #ifndef _KERNEL @@ -731,6 +732,7 @@ ndaasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) switch (code) { case AC_FOUND_DEVICE: { + struct ccb_pathinq cpi; struct ccb_getdev *cgd; cam_status status; @@ -742,6 +744,18 @@ ndaasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) break; /* + * For PCIe cards, filter all the cards whose programming + * interface doesn't conform to the NVMe storage spec. This + * allows the nvme controller to attach to more than just + * storage cards that use the nvme model. + */ + xpt_path_inq(&cpi, cgd->ccb_h.path); + if (cpi.transport == XPORT_NVME && + cpi.xport_specific.nvme.progif != + PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0) + break; + + /* * Allocate a peripheral instance for * this device and start the probe * process. |
