Commit 7855d2ba authored by Martin K. Petersen's avatar Martin K. Petersen

scsi: qla2xxx: Add protection mask module parameters

Allow user to selectively enable/disable DIF/DIX protection
capabilities mask.
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4edff704
...@@ -285,6 +285,20 @@ MODULE_PARM_DESC(qla2xuseresexchforels, ...@@ -285,6 +285,20 @@ MODULE_PARM_DESC(qla2xuseresexchforels,
"Reserve 1/2 of emergency exchanges for ELS.\n" "Reserve 1/2 of emergency exchanges for ELS.\n"
" 0 (default): disabled"); " 0 (default): disabled");
int ql2xprotmask;
module_param(ql2xprotmask, int, 0644);
MODULE_PARM_DESC(ql2xprotmask,
"Override DIF/DIX protection capabilities mask\n"
"Default is 0 which sets protection mask based on "
"capabilities reported by HBA firmware.\n");
int ql2xprotguard;
module_param(ql2xprotguard, int, 0644);
MODULE_PARM_DESC(ql2xprotguard, "Override choice of DIX checksum\n"
" 0 -- Let HBA firmware decide\n"
" 1 -- Force T10 CRC\n"
" 2 -- Force IP checksum\n");
/* /*
* SCSI host template entry points * SCSI host template entry points
*/ */
...@@ -3342,13 +3356,16 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -3342,13 +3356,16 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
"Registering for DIF/DIX type 1 and 3 protection.\n"); "Registering for DIF/DIX type 1 and 3 protection.\n");
if (ql2xenabledif == 1) if (ql2xenabledif == 1)
prot = SHOST_DIX_TYPE0_PROTECTION; prot = SHOST_DIX_TYPE0_PROTECTION;
scsi_host_set_prot(host, if (ql2xprotmask)
prot | SHOST_DIF_TYPE1_PROTECTION scsi_host_set_prot(host, ql2xprotmask);
| SHOST_DIF_TYPE2_PROTECTION else
| SHOST_DIF_TYPE3_PROTECTION scsi_host_set_prot(host,
| SHOST_DIX_TYPE1_PROTECTION prot | SHOST_DIF_TYPE1_PROTECTION
| SHOST_DIX_TYPE2_PROTECTION | SHOST_DIF_TYPE2_PROTECTION
| SHOST_DIX_TYPE3_PROTECTION); | SHOST_DIF_TYPE3_PROTECTION
| SHOST_DIX_TYPE1_PROTECTION
| SHOST_DIX_TYPE2_PROTECTION
| SHOST_DIX_TYPE3_PROTECTION);
guard = SHOST_DIX_GUARD_CRC; guard = SHOST_DIX_GUARD_CRC;
...@@ -3356,7 +3373,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -3356,7 +3373,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
(ql2xenabledif > 1 || IS_PI_DIFB_DIX0_CAPABLE(ha))) (ql2xenabledif > 1 || IS_PI_DIFB_DIX0_CAPABLE(ha)))
guard |= SHOST_DIX_GUARD_IP; guard |= SHOST_DIX_GUARD_IP;
scsi_host_set_guard(host, guard); if (ql2xprotguard)
scsi_host_set_guard(host, ql2xprotguard);
else
scsi_host_set_guard(host, guard);
} else } else
base_vha->flags.difdix_supported = 0; base_vha->flags.difdix_supported = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment