aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_sli.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c47
1 files changed, 40 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 42ea367ddba7..1a391e2df3b3 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -293,7 +293,9 @@ lpfc_sli4_eq_release(struct lpfc_queue *q, bool arm)
293 } 293 }
294 bf_set(lpfc_eqcq_doorbell_num_released, &doorbell, released); 294 bf_set(lpfc_eqcq_doorbell_num_released, &doorbell, released);
295 bf_set(lpfc_eqcq_doorbell_qt, &doorbell, LPFC_QUEUE_TYPE_EVENT); 295 bf_set(lpfc_eqcq_doorbell_qt, &doorbell, LPFC_QUEUE_TYPE_EVENT);
296 bf_set(lpfc_eqcq_doorbell_eqid, &doorbell, q->queue_id); 296 bf_set(lpfc_eqcq_doorbell_eqid_hi, &doorbell,
297 (q->queue_id >> LPFC_EQID_HI_FIELD_SHIFT));
298 bf_set(lpfc_eqcq_doorbell_eqid_lo, &doorbell, q->queue_id);
297 writel(doorbell.word0, q->phba->sli4_hba.EQCQDBregaddr); 299 writel(doorbell.word0, q->phba->sli4_hba.EQCQDBregaddr);
298 /* PCI read to flush PCI pipeline on re-arming for INTx mode */ 300 /* PCI read to flush PCI pipeline on re-arming for INTx mode */
299 if ((q->phba->intr_type == INTx) && (arm == LPFC_QUEUE_REARM)) 301 if ((q->phba->intr_type == INTx) && (arm == LPFC_QUEUE_REARM))
@@ -372,7 +374,9 @@ lpfc_sli4_cq_release(struct lpfc_queue *q, bool arm)
372 bf_set(lpfc_eqcq_doorbell_arm, &doorbell, 1); 374 bf_set(lpfc_eqcq_doorbell_arm, &doorbell, 1);
373 bf_set(lpfc_eqcq_doorbell_num_released, &doorbell, released); 375 bf_set(lpfc_eqcq_doorbell_num_released, &doorbell, released);
374 bf_set(lpfc_eqcq_doorbell_qt, &doorbell, LPFC_QUEUE_TYPE_COMPLETION); 376 bf_set(lpfc_eqcq_doorbell_qt, &doorbell, LPFC_QUEUE_TYPE_COMPLETION);
375 bf_set(lpfc_eqcq_doorbell_cqid, &doorbell, q->queue_id); 377 bf_set(lpfc_eqcq_doorbell_cqid_hi, &doorbell,
378 (q->queue_id >> LPFC_CQID_HI_FIELD_SHIFT));
379 bf_set(lpfc_eqcq_doorbell_cqid_lo, &doorbell, q->queue_id);
376 writel(doorbell.word0, q->phba->sli4_hba.EQCQDBregaddr); 380 writel(doorbell.word0, q->phba->sli4_hba.EQCQDBregaddr);
377 return released; 381 return released;
378} 382}
@@ -5596,6 +5600,8 @@ lpfc_sli4_alloc_resource_identifiers(struct lpfc_hba *phba)
5596 for (i = 0; i < count; i++) 5600 for (i = 0; i < count; i++)
5597 phba->sli4_hba.rpi_ids[i] = base + i; 5601 phba->sli4_hba.rpi_ids[i] = base + i;
5598 5602
5603 lpfc_sli4_node_prep(phba);
5604
5599 /* VPIs. */ 5605 /* VPIs. */
5600 count = phba->sli4_hba.max_cfg_param.max_vpi; 5606 count = phba->sli4_hba.max_cfg_param.max_vpi;
5601 base = phba->sli4_hba.max_cfg_param.vpi_base; 5607 base = phba->sli4_hba.max_cfg_param.vpi_base;
@@ -7555,6 +7561,8 @@ lpfc_sli4_bpl2sgl(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq,
7555 7561
7556 sgl = (struct sli4_sge *)sglq->sgl; 7562 sgl = (struct sli4_sge *)sglq->sgl;
7557 icmd = &piocbq->iocb; 7563 icmd = &piocbq->iocb;
7564 if (icmd->ulpCommand == CMD_XMIT_BLS_RSP64_CX)
7565 return sglq->sli4_xritag;
7558 if (icmd->un.genreq64.bdl.bdeFlags == BUFF_TYPE_BLP_64) { 7566 if (icmd->un.genreq64.bdl.bdeFlags == BUFF_TYPE_BLP_64) {
7559 numBdes = icmd->un.genreq64.bdl.bdeSize / 7567 numBdes = icmd->un.genreq64.bdl.bdeSize /
7560 sizeof(struct ulp_bde64); 7568 sizeof(struct ulp_bde64);
@@ -7756,6 +7764,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
7756 if (if_type == LPFC_SLI_INTF_IF_TYPE_2) { 7764 if (if_type == LPFC_SLI_INTF_IF_TYPE_2) {
7757 if (pcmd && (*pcmd == ELS_CMD_FLOGI || 7765 if (pcmd && (*pcmd == ELS_CMD_FLOGI ||
7758 *pcmd == ELS_CMD_SCR || 7766 *pcmd == ELS_CMD_SCR ||
7767 *pcmd == ELS_CMD_FDISC ||
7759 *pcmd == ELS_CMD_PLOGI)) { 7768 *pcmd == ELS_CMD_PLOGI)) {
7760 bf_set(els_req64_sp, &wqe->els_req, 1); 7769 bf_set(els_req64_sp, &wqe->els_req, 1);
7761 bf_set(els_req64_sid, &wqe->els_req, 7770 bf_set(els_req64_sid, &wqe->els_req,
@@ -7982,6 +7991,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
7982 xritag = 0; 7991 xritag = 0;
7983 break; 7992 break;
7984 case CMD_XMIT_BLS_RSP64_CX: 7993 case CMD_XMIT_BLS_RSP64_CX:
7994 ndlp = (struct lpfc_nodelist *)iocbq->context1;
7985 /* As BLS ABTS RSP WQE is very different from other WQEs, 7995 /* As BLS ABTS RSP WQE is very different from other WQEs,
7986 * we re-construct this WQE here based on information in 7996 * we re-construct this WQE here based on information in
7987 * iocbq from scratch. 7997 * iocbq from scratch.
@@ -8008,8 +8018,15 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
8008 } 8018 }
8009 bf_set(xmit_bls_rsp64_seqcnthi, &wqe->xmit_bls_rsp, 0xffff); 8019 bf_set(xmit_bls_rsp64_seqcnthi, &wqe->xmit_bls_rsp, 0xffff);
8010 bf_set(wqe_xmit_bls_pt, &wqe->xmit_bls_rsp.wqe_dest, 0x1); 8020 bf_set(wqe_xmit_bls_pt, &wqe->xmit_bls_rsp.wqe_dest, 0x1);
8021
8022 /* Use CT=VPI */
8023 bf_set(wqe_els_did, &wqe->xmit_bls_rsp.wqe_dest,
8024 ndlp->nlp_DID);
8025 bf_set(xmit_bls_rsp64_temprpi, &wqe->xmit_bls_rsp,
8026 iocbq->iocb.ulpContext);
8027 bf_set(wqe_ct, &wqe->xmit_bls_rsp.wqe_com, 1);
8011 bf_set(wqe_ctxt_tag, &wqe->xmit_bls_rsp.wqe_com, 8028 bf_set(wqe_ctxt_tag, &wqe->xmit_bls_rsp.wqe_com,
8012 iocbq->iocb.ulpContext); 8029 phba->vpi_ids[phba->pport->vpi]);
8013 bf_set(wqe_qosd, &wqe->xmit_bls_rsp.wqe_com, 1); 8030 bf_set(wqe_qosd, &wqe->xmit_bls_rsp.wqe_com, 1);
8014 bf_set(wqe_lenloc, &wqe->xmit_bls_rsp.wqe_com, 8031 bf_set(wqe_lenloc, &wqe->xmit_bls_rsp.wqe_com,
8015 LPFC_WQE_LENLOC_NONE); 8032 LPFC_WQE_LENLOC_NONE);
@@ -8073,8 +8090,7 @@ __lpfc_sli_issue_iocb_s4(struct lpfc_hba *phba, uint32_t ring_number,
8073 8090
8074 if (piocb->sli4_xritag == NO_XRI) { 8091 if (piocb->sli4_xritag == NO_XRI) {
8075 if (piocb->iocb.ulpCommand == CMD_ABORT_XRI_CN || 8092 if (piocb->iocb.ulpCommand == CMD_ABORT_XRI_CN ||
8076 piocb->iocb.ulpCommand == CMD_CLOSE_XRI_CN || 8093 piocb->iocb.ulpCommand == CMD_CLOSE_XRI_CN)
8077 piocb->iocb.ulpCommand == CMD_XMIT_BLS_RSP64_CX)
8078 sglq = NULL; 8094 sglq = NULL;
8079 else { 8095 else {
8080 if (pring->txq_cnt) { 8096 if (pring->txq_cnt) {
@@ -8384,10 +8400,13 @@ lpfc_sli4_abts_err_handler(struct lpfc_hba *phba,
8384{ 8400{
8385 struct lpfc_vport *vport; 8401 struct lpfc_vport *vport;
8386 8402
8387 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) 8403 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
8388 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 8404 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
8389 "3115 Node Context not found, driver " 8405 "3115 Node Context not found, driver "
8390 "ignoring abts err event\n"); 8406 "ignoring abts err event\n");
8407 return;
8408 }
8409
8391 vport = ndlp->vport; 8410 vport = ndlp->vport;
8392 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, 8411 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
8393 "3116 Port generated FCP XRI ABORT event on " 8412 "3116 Port generated FCP XRI ABORT event on "
@@ -14042,6 +14061,13 @@ lpfc_sli4_seq_abort_rsp_cmpl(struct lpfc_hba *phba,
14042{ 14061{
14043 if (cmd_iocbq) 14062 if (cmd_iocbq)
14044 lpfc_sli_release_iocbq(phba, cmd_iocbq); 14063 lpfc_sli_release_iocbq(phba, cmd_iocbq);
14064
14065 /* Failure means BLS ABORT RSP did not get delivered to remote node*/
14066 if (rsp_iocbq && rsp_iocbq->iocb.ulpStatus)
14067 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
14068 "3154 BLS ABORT RSP failed, data: x%x/x%x\n",
14069 rsp_iocbq->iocb.ulpStatus,
14070 rsp_iocbq->iocb.un.ulpWord[4]);
14045} 14071}
14046 14072
14047/** 14073/**
@@ -14748,7 +14774,8 @@ lpfc_sli4_remove_rpis(struct lpfc_hba *phba)
14748 * provided rpi via a bitmask. 14774 * provided rpi via a bitmask.
14749 **/ 14775 **/
14750int 14776int
14751lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp) 14777lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp,
14778 void (*cmpl)(struct lpfc_hba *, LPFC_MBOXQ_t *), void *arg)
14752{ 14779{
14753 LPFC_MBOXQ_t *mboxq; 14780 LPFC_MBOXQ_t *mboxq;
14754 struct lpfc_hba *phba = ndlp->phba; 14781 struct lpfc_hba *phba = ndlp->phba;
@@ -14761,6 +14788,12 @@ lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp)
14761 14788
14762 /* Post all rpi memory regions to the port. */ 14789 /* Post all rpi memory regions to the port. */
14763 lpfc_resume_rpi(mboxq, ndlp); 14790 lpfc_resume_rpi(mboxq, ndlp);
14791 if (cmpl) {
14792 mboxq->mbox_cmpl = cmpl;
14793 mboxq->context1 = arg;
14794 mboxq->context2 = ndlp;
14795 }
14796 mboxq->vport = ndlp->vport;
14764 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT); 14797 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT);
14765 if (rc == MBX_NOT_FINISHED) { 14798 if (rc == MBX_NOT_FINISHED) {
14766 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 14799 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,