From: Himanshu Madhani <himanshu.madhani@cavium.com>
Date: Tue, 24 Apr 2018 21:22:05 -0700
Subject: qla2xxx: Enable T10-DIF with FC-NVMe enabled
Patch-mainline: No, SLE15 specific
References: bsc#1091264
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
---
drivers/scsi/qla2xxx/qla_attr.c | 2 +-
drivers/scsi/qla2xxx/qla_init.c | 2 +-
drivers/scsi/qla2xxx/qla_os.c | 10 +++-------
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 89a4999fa631..4a7f98893f51 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -2041,7 +2041,7 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable)
fc_vport_set_state(fc_vport, FC_VPORT_LINKDOWN);
}
- if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) {
+ if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif && !ql2xnvmeenable) {
if (ha->fw_attributes & BIT_4) {
int prot = 0, guard;
vha->flags.difdix_supported = 1;
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index dbd718cc106d..c6a9c84d743f 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -8471,7 +8471,7 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos,
/* init qpair to this cpu. Will adjust at run time. */
qla_cpu_update(qpair, smp_processor_id());
- if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) {
+ if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif && !ql2xnvmeenable) {
if (ha->fw_attributes & BIT_4)
qpair->difdix_supported = 1;
}
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 9b8a78a61da6..84c4d2c07cc5 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -120,11 +120,7 @@ MODULE_PARM_DESC(ql2xmaxqdepth,
"Maximum queue depth to set for each LUN. "
"Default is 64.");
-#if (IS_ENABLED(CONFIG_NVME_FC))
-int ql2xenabledif;
-#else
int ql2xenabledif = 2;
-#endif
module_param(ql2xenabledif, int, S_IRUGO);
MODULE_PARM_DESC(ql2xenabledif,
" Enable T10-CRC-DIF:\n"
@@ -3078,7 +3074,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
host->max_id = ha->max_fibre_devices;
host->cmd_per_lun = 3;
host->unique_id = host->host_no;
- if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif)
+ if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif && !ql2xnvmeenable)
host->max_cmd_len = 32;
else
host->max_cmd_len = MAX_CMDSZ;
@@ -3303,7 +3299,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
"Detected hba at address=%p.\n",
ha);
- if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) {
+ if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif && !ql2xnvmeenable) {
if (ha->fw_attributes & BIT_4) {
int prot = 0, guard;
base_vha->flags.difdix_supported = 1;
@@ -3956,7 +3952,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
"init_cb=%p gid_list=%p, srb_mempool=%p s_dma_pool=%p.\n",
ha->init_cb, ha->gid_list, ha->srb_mempool, ha->s_dma_pool);
- if (IS_P3P_TYPE(ha) || ql2xenabledif) {
+ if (IS_P3P_TYPE(ha) || (ql2xenabledif && !ql2xnvmeenable)) {
ha->dl_dma_pool = dma_pool_create(name, &ha->pdev->dev,
DSD_LIST_DMA_POOL_SIZE, 8, 0);
if (!ha->dl_dma_pool) {
--
2.16.1.72.g5be1f00a9a