提交 dcf2a4e0 编写于 作者: J James Smart 提交者: James Bottomley

[SCSI] lpfc 8.3.17: SLI Additions and Fixes

- Added driver support for management application to pass down two security
  specific mailbox commands (MBX_SECURITY_MGMT and MBX_AUTH_PORT)
- Added driver support for handling FIPS zeroization trap of host ERATT ER8,
  performing selective reset and bringing the device up.
- Added code to detect INIT_LINK mailbox command completion returning status
  MBXERR_SEC_NO_PERMISSION.
- Increased the wait timeout on host status register HS_FFRDY and HS_MBRDY
  being set.
- Remove the port offline code from the Heartbeat TMO handler.
Signed-off-by: NAlex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: NJames Smart <james.smart@emulex.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 d439d286
...@@ -586,6 +586,11 @@ lpfc_issue_lip(struct Scsi_Host *shost) ...@@ -586,6 +586,11 @@ lpfc_issue_lip(struct Scsi_Host *shost)
phba->cfg_link_speed); phba->cfg_link_speed);
mbxstatus = lpfc_sli_issue_mbox_wait(phba, pmboxq, mbxstatus = lpfc_sli_issue_mbox_wait(phba, pmboxq,
phba->fc_ratov * 2); phba->fc_ratov * 2);
if ((mbxstatus == MBX_SUCCESS) &&
(pmboxq->u.mb.mbxStatus == MBXERR_SEC_NO_PERMISSION))
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
"2859 SLI authentication is required "
"for INIT_LINK but has not done yet\n");
} }
lpfc_set_loopback_flag(phba); lpfc_set_loopback_flag(phba);
...@@ -3782,6 +3787,11 @@ sysfs_mbox_read(struct file *filp, struct kobject *kobj, ...@@ -3782,6 +3787,11 @@ sysfs_mbox_read(struct file *filp, struct kobject *kobj,
case MBX_PORT_CAPABILITIES: case MBX_PORT_CAPABILITIES:
case MBX_PORT_IOV_CONTROL: case MBX_PORT_IOV_CONTROL:
break; break;
case MBX_SECURITY_MGMT:
case MBX_AUTH_PORT:
if (phba->pci_dev_grp == LPFC_PCI_DEV_OC)
return -EPERM;
break;
case MBX_READ_SPARM64: case MBX_READ_SPARM64:
case MBX_READ_LA: case MBX_READ_LA:
case MBX_READ_LA64: case MBX_READ_LA64:
......
...@@ -1380,6 +1380,9 @@ typedef struct { /* FireFly BIU registers */ ...@@ -1380,6 +1380,9 @@ typedef struct { /* FireFly BIU registers */
#define MBX_INIT_VFI 0xA3 #define MBX_INIT_VFI 0xA3
#define MBX_INIT_VPI 0xA4 #define MBX_INIT_VPI 0xA4
#define MBX_AUTH_PORT 0xF8
#define MBX_SECURITY_MGMT 0xF9
/* IOCB Commands */ /* IOCB Commands */
#define CMD_RCV_SEQUENCE_CX 0x01 #define CMD_RCV_SEQUENCE_CX 0x01
...@@ -1502,7 +1505,8 @@ typedef struct { /* FireFly BIU registers */ ...@@ -1502,7 +1505,8 @@ typedef struct { /* FireFly BIU registers */
#define MBXERR_DMA_ERROR 15 #define MBXERR_DMA_ERROR 15
#define MBXERR_ERROR 16 #define MBXERR_ERROR 16
#define MBXERR_LINK_DOWN 0x33 #define MBXERR_LINK_DOWN 0x33
#define MBX_NOT_FINISHED 255 #define MBXERR_SEC_NO_PERMISSION 0xF02
#define MBX_NOT_FINISHED 255
#define MBX_BUSY 0xffffff /* Attempted cmd to busy Mailbox */ #define MBX_BUSY 0xffffff /* Attempted cmd to busy Mailbox */
#define MBX_TIMEOUT 0xfffffe /* time-out expired waiting for */ #define MBX_TIMEOUT 0xfffffe /* time-out expired waiting for */
......
...@@ -1076,21 +1076,16 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba) ...@@ -1076,21 +1076,16 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
} else { } else {
/* /*
* If heart beat timeout called with hb_outstanding set * If heart beat timeout called with hb_outstanding set
* we need to take the HBA offline. * we need to give the hb mailbox cmd a chance to
* complete or TMO.
*/ */
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
"0459 Adapter heartbeat failure, " "0459 Adapter heartbeat still out"
"taking this port offline.\n"); "standing:last compl time was %d ms.\n",
jiffies_to_msecs(jiffies
spin_lock_irq(&phba->hbalock); - phba->last_completion_time));
psli->sli_flag &= ~LPFC_SLI_ACTIVE; mod_timer(&phba->hb_tmofunc,
spin_unlock_irq(&phba->hbalock); jiffies + HZ * LPFC_HB_MBOX_TIMEOUT);
lpfc_offline_prep(phba);
lpfc_offline(phba);
lpfc_unblock_mgmt_io(phba);
phba->link_state = LPFC_HBA_ERROR;
lpfc_hba_down_post(phba);
} }
} }
} }
...@@ -1277,13 +1272,21 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba) ...@@ -1277,13 +1272,21 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba)
if (phba->hba_flag & DEFER_ERATT) if (phba->hba_flag & DEFER_ERATT)
lpfc_handle_deferred_eratt(phba); lpfc_handle_deferred_eratt(phba);
if (phba->work_hs & HS_FFER6) { if ((phba->work_hs & HS_FFER6) || (phba->work_hs & HS_FFER8)) {
/* Re-establishing Link */ if (phba->work_hs & HS_FFER6)
lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, /* Re-establishing Link */
"1301 Re-establishing Link " lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
"Data: x%x x%x x%x\n", "1301 Re-establishing Link "
phba->work_hs, "Data: x%x x%x x%x\n",
phba->work_status[0], phba->work_status[1]); phba->work_hs, phba->work_status[0],
phba->work_status[1]);
if (phba->work_hs & HS_FFER8)
/* Device Zeroization */
lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
"2861 Host Authentication device "
"zeroization Data:x%x x%x x%x\n",
phba->work_hs, phba->work_status[0],
phba->work_status[1]);
spin_lock_irq(&phba->hbalock); spin_lock_irq(&phba->hbalock);
psli->sli_flag &= ~LPFC_SLI_ACTIVE; psli->sli_flag &= ~LPFC_SLI_ACTIVE;
......
...@@ -1677,6 +1677,8 @@ lpfc_sli_chk_mbx_command(uint8_t mbxCommand) ...@@ -1677,6 +1677,8 @@ lpfc_sli_chk_mbx_command(uint8_t mbxCommand)
case MBX_RESUME_RPI: case MBX_RESUME_RPI:
case MBX_READ_EVENT_LOG_STATUS: case MBX_READ_EVENT_LOG_STATUS:
case MBX_READ_EVENT_LOG: case MBX_READ_EVENT_LOG:
case MBX_SECURITY_MGMT:
case MBX_AUTH_PORT:
ret = mbxCommand; ret = mbxCommand;
break; break;
default: default:
...@@ -1781,6 +1783,13 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -1781,6 +1783,13 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
pmb->context2 = NULL; pmb->context2 = NULL;
} }
/* Check security permission status on INIT_LINK mailbox command */
if ((pmb->u.mb.mbxCommand == MBX_INIT_LINK) &&
(pmb->u.mb.mbxStatus == MBXERR_SEC_NO_PERMISSION))
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
"2860 SLI authentication is required "
"for INIT_LINK but has not done yet\n");
if (bf_get(lpfc_mqe_command, &pmb->u.mqe) == MBX_SLI4_CONFIG) if (bf_get(lpfc_mqe_command, &pmb->u.mqe) == MBX_SLI4_CONFIG)
lpfc_sli4_mbox_cmd_free(phba, pmb); lpfc_sli4_mbox_cmd_free(phba, pmb);
else else
...@@ -3658,11 +3667,15 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba) ...@@ -3658,11 +3667,15 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba)
i = 0; i = 0;
while ((status & (HS_FFRDY | HS_MBRDY)) != (HS_FFRDY | HS_MBRDY)) { while ((status & (HS_FFRDY | HS_MBRDY)) != (HS_FFRDY | HS_MBRDY)) {
/* Check every 100ms for 5 retries, then every 500ms for 5, then /* Check every 10ms for 10 retries, then every 100ms for 90
* every 2.5 sec for 5, then reset board and every 2.5 sec for * retries, then every 1 sec for 50 retires for a total of
* 4. * ~60 seconds before reset the board again and check every
* 1 sec for 50 retries. The up to 60 seconds before the
* board ready is required by the Falcon FIPS zeroization
* complete, and any reset the board in between shall cause
* restart of zeroization, further delay the board ready.
*/ */
if (i++ >= 20) { if (i++ >= 200) {
/* Adapter failed to init, timeout, status reg /* Adapter failed to init, timeout, status reg
<status> */ <status> */
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
...@@ -3690,16 +3703,15 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba) ...@@ -3690,16 +3703,15 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba)
return -EIO; return -EIO;
} }
if (i <= 5) { if (i <= 10)
msleep(10); msleep(10);
} else if (i <= 10) { else if (i <= 100)
msleep(500); msleep(100);
} else { else
msleep(2500); msleep(1000);
}
if (i == 15) { if (i == 150) {
/* Do post */ /* Do post */
phba->pport->port_state = LPFC_VPORT_UNKNOWN; phba->pport->port_state = LPFC_VPORT_UNKNOWN;
lpfc_sli_brdrestart(phba); lpfc_sli_brdrestart(phba);
} }
...@@ -5950,6 +5962,8 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, ...@@ -5950,6 +5962,8 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
uint8_t command_type = ELS_COMMAND_NON_FIP; uint8_t command_type = ELS_COMMAND_NON_FIP;
uint8_t cmnd; uint8_t cmnd;
uint16_t xritag; uint16_t xritag;
uint16_t abrt_iotag;
struct lpfc_iocbq *abrtiocbq;
struct ulp_bde64 *bpl = NULL; struct ulp_bde64 *bpl = NULL;
uint32_t els_id = ELS_ID_DEFAULT; uint32_t els_id = ELS_ID_DEFAULT;
int numBdes, i; int numBdes, i;
...@@ -6162,9 +6176,17 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, ...@@ -6162,9 +6176,17 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
case CMD_ABORT_XRI_CX: case CMD_ABORT_XRI_CX:
/* words 0-2 memcpy should be 0 rserved */ /* words 0-2 memcpy should be 0 rserved */
/* port will send abts */ /* port will send abts */
if (iocbq->iocb.ulpCommand == CMD_CLOSE_XRI_CN) abrt_iotag = iocbq->iocb.un.acxri.abortContextTag;
if (abrt_iotag != 0 && abrt_iotag <= phba->sli.last_iotag) {
abrtiocbq = phba->sli.iocbq_lookup[abrt_iotag];
fip = abrtiocbq->iocb_flag & LPFC_FIP_ELS_ID_MASK;
} else
fip = 0;
if ((iocbq->iocb.ulpCommand == CMD_CLOSE_XRI_CN) || fip)
/* /*
* The link is down so the fw does not need to send abts * The link is down, or the command was ELS_FIP
* so the fw does not need to send abts
* on the wire. * on the wire.
*/ */
bf_set(abort_cmd_ia, &wqe->abort_cmd, 1); bf_set(abort_cmd_ia, &wqe->abort_cmd, 1);
...@@ -7895,7 +7917,7 @@ lpfc_sli_eratt_read(struct lpfc_hba *phba) ...@@ -7895,7 +7917,7 @@ lpfc_sli_eratt_read(struct lpfc_hba *phba)
/* Check if there is a deferred error condition is active */ /* Check if there is a deferred error condition is active */
if ((HS_FFER1 & phba->work_hs) && if ((HS_FFER1 & phba->work_hs) &&
((HS_FFER2 | HS_FFER3 | HS_FFER4 | HS_FFER5 | ((HS_FFER2 | HS_FFER3 | HS_FFER4 | HS_FFER5 |
HS_FFER6 | HS_FFER7) & phba->work_hs)) { HS_FFER6 | HS_FFER7 | HS_FFER8) & phba->work_hs)) {
phba->hba_flag |= DEFER_ERATT; phba->hba_flag |= DEFER_ERATT;
/* Clear all interrupt enable conditions */ /* Clear all interrupt enable conditions */
writel(0, phba->HCregaddr); writel(0, phba->HCregaddr);
...@@ -8211,7 +8233,8 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id) ...@@ -8211,7 +8233,8 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id)
*/ */
if ((HS_FFER1 & phba->work_hs) && if ((HS_FFER1 & phba->work_hs) &&
((HS_FFER2 | HS_FFER3 | HS_FFER4 | HS_FFER5 | ((HS_FFER2 | HS_FFER3 | HS_FFER4 | HS_FFER5 |
HS_FFER6 | HS_FFER7) & phba->work_hs)) { HS_FFER6 | HS_FFER7 | HS_FFER8) &
phba->work_hs)) {
phba->hba_flag |= DEFER_ERATT; phba->hba_flag |= DEFER_ERATT;
/* Clear all interrupt enable conditions */ /* Clear all interrupt enable conditions */
writel(0, phba->HCregaddr); writel(0, phba->HCregaddr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册