Blob Blame History Raw
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(-)

--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -2823,7 +2823,7 @@ qla24xx_vport_create(struct fc_vport *fc
 			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;
 
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -8917,7 +8917,7 @@ struct qla_qpair *qla2xxx_create_qpair(s
 		/* 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;
 		}
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -122,11 +122,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"
@@ -3109,7 +3105,7 @@ qla2x00_probe_one(struct pci_dev *pdev,
 	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;
@@ -3337,7 +3333,7 @@ skip_dpc:
 	    "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;
 
@@ -4005,7 +4001,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha
 	    "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) {