Commit 2b9cef59 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

test/nvme: check Red Hat's vendor ID when skipping emulated drives



The qemu emulated SSDs report Red Hat's vendor ID by default since
v5.2.0, so the skip check was extended to accommodate that.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I0bce25b0bf737ffd775f96e75e7b4ed74333af1c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19062


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 17cf101b
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -492,13 +492,14 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	if (trid->trtype == SPDK_NVME_TRANSPORT_PCIE) {
		struct spdk_pci_device *dev = spdk_nvme_ctrlr_get_pci_device(ctrlr);

		/* QEMU emulated SSDs can't handle this test, so we will skip
		 *  them.  QEMU NVMe SSDs report themselves as VID == Intel.  So we need
		 *  to check this specific 0x5845 device ID to know whether it's QEMU
		 *  or not.
		/* QEMU emulated SSDs can't handle this test, so we will skip them.  QEMU NVMe SSDs
		 * report themselves as VID == (Intel|Red Hat).  So we need to check this specific
		 * (0x5845|0x0010) device ID to know whether it's QEMU or not.
		 */
		if (spdk_pci_device_get_vendor_id(dev) == SPDK_PCI_VID_INTEL &&
		    spdk_pci_device_get_device_id(dev) == 0x5845) {
		if ((spdk_pci_device_get_vendor_id(dev) == SPDK_PCI_VID_INTEL &&
		     spdk_pci_device_get_device_id(dev) == 0x5845) ||
		    (spdk_pci_device_get_vendor_id(dev) == SPDK_PCI_VID_REDHAT &&
		     spdk_pci_device_get_device_id(dev) == 0x0010)) {
			g_qemu_ssd_found = true;
			printf("Skipping QEMU NVMe SSD at %s\n", trid->traddr);
			return;