nvme/quirks: don't use SGL for Huawei SSDs

We see reports that Huawei SSDs can't handle hardware
SGL properly, it requires additional alignment, so add
a quirk here to force Huawei SSDs use PRP instead.

Fix #2489.

Change-Id: I20a57e754bc6ff8666d681191994818f2192decc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12405
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Changpeng Liu 2022-04-28 13:20:45 +08:00 committed by Jim Harris
parent 657da2b647
commit 4e241cba01
4 changed files with 11 additions and 1 deletions

View File

@ -54,6 +54,7 @@ extern "C" {
#define SPDK_PCI_VID_VMWARE 0x15ad
#define SPDK_PCI_VID_REDHAT 0x1b36
#define SPDK_PCI_VID_NUTANIX 0x4e58
#define SPDK_PCI_VID_HUAWEI 0x19e5
#define SPDK_PCI_CLASS_ANY_ID 0xffffff
/**

View File

@ -1939,7 +1939,7 @@ nvme_ctrlr_identify_done(void *arg, const struct spdk_nvme_cpl *cpl)
}
}
if (ctrlr->cdata.sgls.supported) {
if (ctrlr->cdata.sgls.supported && !(ctrlr->quirks & NVME_QUIRK_NOT_USE_SGL)) {
assert(ctrlr->cdata.sgls.supported != 0x3);
ctrlr->flags |= SPDK_NVME_CTRLR_SGL_SUPPORTED;
if (ctrlr->cdata.sgls.supported == 0x2) {

View File

@ -163,6 +163,12 @@ extern pid_t g_spdk_nvme_pid;
*/
#define NVME_QUIRK_MDTS_EXCLUDE_MD 0x8000
/**
* Force not to use SGL even the controller report that it can
* support it.
*/
#define NVME_QUIRK_NOT_USE_SGL 0x10000
#define NVME_MAX_ASYNC_EVENTS (8)
#define NVME_MAX_ADMIN_TIMEOUT_IN_SECS (30)

View File

@ -109,6 +109,9 @@ static const struct nvme_quirk nvme_quirks[] = {
{ {SPDK_PCI_CLASS_NVME, SPDK_PCI_VID_INTEL, 0x4140, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID},
NVME_QUIRK_MDTS_EXCLUDE_MD
},
{ {SPDK_PCI_CLASS_NVME, SPDK_PCI_VID_HUAWEI, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID},
NVME_QUIRK_NOT_USE_SGL
},
{ {0x000000, 0x0000, 0x0000, 0x0000, 0x0000}, 0}
};