Commit 518c8add authored by Jim Harris's avatar Jim Harris Committed by Changpeng Liu
Browse files

nvme: add SHST_COMPLETE quirk for VMWare emulated SSDs



VMWare Workstation NVMe emulation does not seem to write the
SHST_COMPLETE bit within 10 seconds, resulting in an ERRLOG
during detach/shutdown.  So add a quirk to cover these VMWare
SSDs.  But rather than squashing the ERRLOG completely for
these SSDs, just add a message instead indicating this is
somewhat expected on these VMWare emulated SSDs.

Fixes issue #676.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I3dfcb631feda639926fd712f1f41abb66cbf2096

Reviewed-on: https://review.gerrithub.io/c/445942


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
parent 0aa926c0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ extern "C" {
#define SPDK_PCI_VID_VIRTUALBOX		0x80ee
#define SPDK_PCI_VID_VIRTIO		0x1af4
#define SPDK_PCI_VID_CNEXLABS		0x1d1d
#define SPDK_PCI_VID_VMWARE		0x15ad

/**
 * PCI class code for NVMe devices.
+3 −0
Original line number Diff line number Diff line
@@ -552,6 +552,9 @@ nvme_ctrlr_shutdown(struct spdk_nvme_ctrlr *ctrlr)
	} while (ms_waited < shutdown_timeout_ms);

	SPDK_ERRLOG("did not shutdown within %u milliseconds\n", shutdown_timeout_ms);
	if (ctrlr->quirks & NVME_QUIRK_SHST_COMPLETE) {
		SPDK_ERRLOG("likely due to shutdown handling in the VMWare emulated NVMe SSD\n");
	}
}

static int
+7 −0
Original line number Diff line number Diff line
@@ -116,6 +116,13 @@ extern pid_t g_spdk_nvme_pid;
 */
#define NVME_INTEL_QUIRK_NO_LOG_PAGES 0x100

/*
 * The controller does not set SHST_COMPLETE in a reasonable amount of time.  This
 * is primarily seen in virtual VMWare NVMe SSDs.  This quirk merely adds an additional
 * error message that on VMWare NVMe SSDs, the shutdown timeout may be expected.
 */
#define NVME_QUIRK_SHST_COMPLETE 0x200

#define NVME_MAX_ASYNC_EVENTS	(8)

#define NVME_MAX_TIMEOUT_PERIOD		(120)
+3 −0
Original line number Diff line number Diff line
@@ -83,6 +83,9 @@ static const struct nvme_quirk nvme_quirks[] = {
		NVME_QUIRK_IDENTIFY_CNS |
		NVME_QUIRK_OCSSD
	},
	{	{SPDK_PCI_VID_VMWARE, 0x07f0, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID},
		NVME_QUIRK_SHST_COMPLETE
	},
	{	{0x0000, 0x0000, 0x0000, 0x0000}, 0}
};