Commit b3b98b74 authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Make lpfc_prot_xxx params per hba parameters

Make lpfc_prot_mask and lpfc_prot_guard per hba parameters
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 61bda8f7
...@@ -746,6 +746,8 @@ struct lpfc_hba { ...@@ -746,6 +746,8 @@ struct lpfc_hba {
uint32_t cfg_oas_priority; uint32_t cfg_oas_priority;
uint32_t cfg_XLanePriority; uint32_t cfg_XLanePriority;
uint32_t cfg_enable_bg; uint32_t cfg_enable_bg;
uint32_t cfg_prot_mask;
uint32_t cfg_prot_guard;
uint32_t cfg_hostmem_hgp; uint32_t cfg_hostmem_hgp;
uint32_t cfg_log_verbose; uint32_t cfg_log_verbose;
uint32_t cfg_aer_support; uint32_t cfg_aer_support;
......
...@@ -4691,12 +4691,15 @@ unsigned int lpfc_fcp_look_ahead = LPFC_LOOK_AHEAD_OFF; ...@@ -4691,12 +4691,15 @@ unsigned int lpfc_fcp_look_ahead = LPFC_LOOK_AHEAD_OFF;
# HBA supports DIX Type 1: Host to HBA Type 1 protection # HBA supports DIX Type 1: Host to HBA Type 1 protection
# #
*/ */
unsigned int lpfc_prot_mask = SHOST_DIF_TYPE1_PROTECTION | LPFC_ATTR(prot_mask,
(SHOST_DIF_TYPE1_PROTECTION |
SHOST_DIX_TYPE0_PROTECTION | SHOST_DIX_TYPE0_PROTECTION |
SHOST_DIX_TYPE1_PROTECTION; SHOST_DIX_TYPE1_PROTECTION),
0,
module_param(lpfc_prot_mask, uint, S_IRUGO); (SHOST_DIF_TYPE1_PROTECTION |
MODULE_PARM_DESC(lpfc_prot_mask, "host protection mask"); SHOST_DIX_TYPE0_PROTECTION |
SHOST_DIX_TYPE1_PROTECTION),
"T10-DIF host protection capabilities mask");
/* /*
# lpfc_prot_guard: i # lpfc_prot_guard: i
...@@ -4706,9 +4709,9 @@ MODULE_PARM_DESC(lpfc_prot_mask, "host protection mask"); ...@@ -4706,9 +4709,9 @@ MODULE_PARM_DESC(lpfc_prot_mask, "host protection mask");
# - Default will result in registering capabilities for all guard types # - Default will result in registering capabilities for all guard types
# #
*/ */
unsigned char lpfc_prot_guard = SHOST_DIX_GUARD_IP; LPFC_ATTR(prot_guard,
module_param(lpfc_prot_guard, byte, S_IRUGO); SHOST_DIX_GUARD_IP, SHOST_DIX_GUARD_CRC, SHOST_DIX_GUARD_IP,
MODULE_PARM_DESC(lpfc_prot_guard, "host protection guard type"); "T10-DIF host protection guard type");
/* /*
* Delay initial NPort discovery when Clean Address bit is cleared in * Delay initial NPort discovery when Clean Address bit is cleared in
...@@ -5828,6 +5831,8 @@ lpfc_get_cfgparam(struct lpfc_hba *phba) ...@@ -5828,6 +5831,8 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
phba->cfg_oas_flags = 0; phba->cfg_oas_flags = 0;
phba->cfg_oas_priority = 0; phba->cfg_oas_priority = 0;
lpfc_enable_bg_init(phba, lpfc_enable_bg); lpfc_enable_bg_init(phba, lpfc_enable_bg);
lpfc_prot_mask_init(phba, lpfc_prot_mask);
lpfc_prot_guard_init(phba, lpfc_prot_guard);
if (phba->sli_rev == LPFC_SLI_REV4) if (phba->sli_rev == LPFC_SLI_REV4)
phba->cfg_poll = 0; phba->cfg_poll = 0;
else else
......
...@@ -397,8 +397,6 @@ extern spinlock_t _dump_buf_lock; ...@@ -397,8 +397,6 @@ extern spinlock_t _dump_buf_lock;
extern int _dump_buf_done; extern int _dump_buf_done;
extern spinlock_t pgcnt_lock; extern spinlock_t pgcnt_lock;
extern unsigned int pgcnt; extern unsigned int pgcnt;
extern unsigned int lpfc_prot_mask;
extern unsigned char lpfc_prot_guard;
extern unsigned int lpfc_fcp_look_ahead; extern unsigned int lpfc_fcp_look_ahead;
/* Interface exported by fabric iocb scheduler */ /* Interface exported by fabric iocb scheduler */
......
...@@ -6279,34 +6279,36 @@ lpfc_setup_bg(struct lpfc_hba *phba, struct Scsi_Host *shost) ...@@ -6279,34 +6279,36 @@ lpfc_setup_bg(struct lpfc_hba *phba, struct Scsi_Host *shost)
uint32_t old_guard; uint32_t old_guard;
int pagecnt = 10; int pagecnt = 10;
if (lpfc_prot_mask && lpfc_prot_guard) { if (phba->cfg_prot_mask && phba->cfg_prot_guard) {
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"1478 Registering BlockGuard with the " "1478 Registering BlockGuard with the "
"SCSI layer\n"); "SCSI layer\n");
old_mask = lpfc_prot_mask; old_mask = phba->cfg_prot_mask;
old_guard = lpfc_prot_guard; old_guard = phba->cfg_prot_guard;
/* Only allow supported values */ /* Only allow supported values */
lpfc_prot_mask &= (SHOST_DIF_TYPE1_PROTECTION | phba->cfg_prot_mask &= (SHOST_DIF_TYPE1_PROTECTION |
SHOST_DIX_TYPE0_PROTECTION | SHOST_DIX_TYPE0_PROTECTION |
SHOST_DIX_TYPE1_PROTECTION); SHOST_DIX_TYPE1_PROTECTION);
lpfc_prot_guard &= (SHOST_DIX_GUARD_IP | SHOST_DIX_GUARD_CRC); phba->cfg_prot_guard &= (SHOST_DIX_GUARD_IP |
SHOST_DIX_GUARD_CRC);
/* DIF Type 1 protection for profiles AST1/C1 is end to end */ /* DIF Type 1 protection for profiles AST1/C1 is end to end */
if (lpfc_prot_mask == SHOST_DIX_TYPE1_PROTECTION) if (phba->cfg_prot_mask == SHOST_DIX_TYPE1_PROTECTION)
lpfc_prot_mask |= SHOST_DIF_TYPE1_PROTECTION; phba->cfg_prot_mask |= SHOST_DIF_TYPE1_PROTECTION;
if (lpfc_prot_mask && lpfc_prot_guard) { if (phba->cfg_prot_mask && phba->cfg_prot_guard) {
if ((old_mask != lpfc_prot_mask) || if ((old_mask != phba->cfg_prot_mask) ||
(old_guard != lpfc_prot_guard)) (old_guard != phba->cfg_prot_guard))
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"1475 Registering BlockGuard with the " "1475 Registering BlockGuard with the "
"SCSI layer: mask %d guard %d\n", "SCSI layer: mask %d guard %d\n",
lpfc_prot_mask, lpfc_prot_guard); phba->cfg_prot_mask,
phba->cfg_prot_guard);
scsi_host_set_prot(shost, lpfc_prot_mask); scsi_host_set_prot(shost, phba->cfg_prot_mask);
scsi_host_set_guard(shost, lpfc_prot_guard); scsi_host_set_guard(shost, phba->cfg_prot_guard);
} else } else
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"1479 Not Registering BlockGuard with the SCSI " "1479 Not Registering BlockGuard with the SCSI "
......
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