nvme: add quirk for Intel SSDs without vendor-specific log pages

QEMU emulated NVMe SSDs report themselves with an Intel vendor ID,
but don't support the Intel vendor-specific log pages.  So add
a quirk to avoid confusing error messages.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic41476801ede94d43acb9972217ea7420ca53679
Reviewed-on: https://review.gerrithub.io/423422
Reviewed-on: https://review.gerrithub.io/423928
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Jim Harris 2018-08-24 12:52:36 -07:00
parent 9fca71f514
commit 44a43939e8
3 changed files with 10 additions and 2 deletions

View File

@ -403,7 +403,7 @@ nvme_ctrlr_set_supported_log_pages(struct spdk_nvme_ctrlr *ctrlr)
if (ctrlr->cdata.lpa.celp) { if (ctrlr->cdata.lpa.celp) {
ctrlr->log_page_supported[SPDK_NVME_LOG_COMMAND_EFFECTS_LOG] = true; ctrlr->log_page_supported[SPDK_NVME_LOG_COMMAND_EFFECTS_LOG] = true;
} }
if (ctrlr->cdata.vid == SPDK_PCI_VID_INTEL) { if (ctrlr->cdata.vid == SPDK_PCI_VID_INTEL && !(ctrlr->quirks & NVME_INTEL_QUIRK_NO_LOG_PAGES)) {
nvme_ctrlr_set_intel_support_log_pages(ctrlr); nvme_ctrlr_set_intel_support_log_pages(ctrlr);
} }
} }

View File

@ -107,6 +107,13 @@ extern pid_t g_spdk_nvme_pid;
*/ */
#define NVME_QUIRK_OCSSD 0x80 #define NVME_QUIRK_OCSSD 0x80
/*
* The controller has an Intel vendor ID but does not support Intel vendor-specific
* log pages. This is primarily for QEMU emulated SSDs which report an Intel vendor
* ID but do not support these log pages.
*/
#define NVME_INTEL_QUIRK_NO_LOG_PAGES 0x100
#define NVME_MAX_ASYNC_EVENTS (8) #define NVME_MAX_ASYNC_EVENTS (8)
#define NVME_MIN_TIMEOUT_PERIOD (5) #define NVME_MIN_TIMEOUT_PERIOD (5)

View File

@ -76,7 +76,8 @@ static const struct nvme_quirk nvme_quirks[] = {
NVME_QUIRK_DELAY_AFTER_QUEUE_ALLOC NVME_QUIRK_DELAY_AFTER_QUEUE_ALLOC
}, },
{ {SPDK_PCI_VID_INTEL, 0x5845, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID}, { {SPDK_PCI_VID_INTEL, 0x5845, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID},
NVME_QUIRK_IDENTIFY_CNS NVME_QUIRK_IDENTIFY_CNS |
NVME_INTEL_QUIRK_NO_LOG_PAGES
}, },
{ {SPDK_PCI_VID_CNEXLABS, 0x1f1f, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID}, { {SPDK_PCI_VID_CNEXLABS, 0x1f1f, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID},
NVME_QUIRK_IDENTIFY_CNS | NVME_QUIRK_IDENTIFY_CNS |