Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee0f4fe1 authored by James Smart's avatar James Smart Committed by James Bottomley
Browse files

[SCSI] lpfc 8.3.31: Fix unsol abts xri lookup

parent 939723a4
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -3003,7 +3003,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
			 * ABTS we cannot generate and RRQ.
			 * ABTS we cannot generate and RRQ.
			 */
			 */
			lpfc_set_rrq_active(phba, ndlp,
			lpfc_set_rrq_active(phba, ndlp,
					 cmdiocb->sli4_xritag, 0, 0);
					 cmdiocb->sli4_lxritag, 0, 0);
		}
		}
		break;
		break;
	case IOSTAT_LOCAL_REJECT:
	case IOSTAT_LOCAL_REJECT:
@@ -5673,7 +5673,7 @@ lpfc_issue_els_rrq(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
	pcmd += sizeof(uint32_t);
	pcmd += sizeof(uint32_t);
	els_rrq = (struct RRQ *) pcmd;
	els_rrq = (struct RRQ *) pcmd;


	bf_set(rrq_oxid, els_rrq, rrq->xritag);
	bf_set(rrq_oxid, els_rrq, phba->sli4_hba.xri_ids[rrq->xritag]);
	bf_set(rrq_rxid, els_rrq, rrq->rxid);
	bf_set(rrq_rxid, els_rrq, rrq->rxid);
	bf_set(rrq_did, els_rrq, vport->fc_myDID);
	bf_set(rrq_did, els_rrq, vport->fc_myDID);
	els_rrq->rrq = cpu_to_be32(els_rrq->rrq);
	els_rrq->rrq = cpu_to_be32(els_rrq->rrq);
@@ -7960,7 +7960,9 @@ lpfc_sli4_els_xri_aborted(struct lpfc_hba *phba,
			sglq_entry->state = SGL_FREED;
			sglq_entry->state = SGL_FREED;
			spin_unlock(&phba->sli4_hba.abts_sgl_list_lock);
			spin_unlock(&phba->sli4_hba.abts_sgl_list_lock);
			spin_unlock_irqrestore(&phba->hbalock, iflag);
			spin_unlock_irqrestore(&phba->hbalock, iflag);
			lpfc_set_rrq_active(phba, ndlp, xri, rxid, 1);
			lpfc_set_rrq_active(phba, ndlp,
				sglq_entry->sli4_lxritag,
				rxid, 1);


			/* Check if TXQ queue needs to be serviced */
			/* Check if TXQ queue needs to be serviced */
			if (pring->txq_cnt)
			if (pring->txq_cnt)
+5 −4
Original line number Original line Diff line number Diff line
@@ -696,7 +696,8 @@ lpfc_sli4_fcp_xri_aborted(struct lpfc_hba *phba,
			rrq_empty = list_empty(&phba->active_rrq_list);
			rrq_empty = list_empty(&phba->active_rrq_list);
			spin_unlock_irqrestore(&phba->hbalock, iflag);
			spin_unlock_irqrestore(&phba->hbalock, iflag);
			if (ndlp) {
			if (ndlp) {
				lpfc_set_rrq_active(phba, ndlp, xri, rxid, 1);
				lpfc_set_rrq_active(phba, ndlp,
					psb->cur_iocbq.sli4_lxritag, rxid, 1);
				lpfc_sli4_abts_err_handler(phba, ndlp, axri);
				lpfc_sli4_abts_err_handler(phba, ndlp, axri);
			}
			}
			lpfc_release_scsi_buf_s4(phba, psb);
			lpfc_release_scsi_buf_s4(phba, psb);
@@ -1099,7 +1100,7 @@ lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
	list_for_each_entry(lpfc_cmd, &phba->lpfc_scsi_buf_list,
	list_for_each_entry(lpfc_cmd, &phba->lpfc_scsi_buf_list,
							list) {
							list) {
		if (lpfc_test_rrq_active(phba, ndlp,
		if (lpfc_test_rrq_active(phba, ndlp,
					 lpfc_cmd->cur_iocbq.sli4_xritag))
					 lpfc_cmd->cur_iocbq.sli4_lxritag))
			continue;
			continue;
		list_del(&lpfc_cmd->list);
		list_del(&lpfc_cmd->list);
		found = 1;
		found = 1;
@@ -3758,7 +3759,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
				 * ABTS we cannot generate and RRQ.
				 * ABTS we cannot generate and RRQ.
				 */
				 */
				lpfc_set_rrq_active(phba, pnode,
				lpfc_set_rrq_active(phba, pnode,
						lpfc_cmd->cur_iocbq.sli4_xritag,
					lpfc_cmd->cur_iocbq.sli4_lxritag,
					0, 0);
					0, 0);
			}
			}
		/* else: fall through */
		/* else: fall through */
+15 −7
Original line number Original line Diff line number Diff line
@@ -885,7 +885,7 @@ __lpfc_sli_get_sglq(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq)
	while (!found) {
	while (!found) {
		if (!sglq)
		if (!sglq)
			return NULL;
			return NULL;
		if (lpfc_test_rrq_active(phba, ndlp, sglq->sli4_xritag)) {
		if (lpfc_test_rrq_active(phba, ndlp, sglq->sli4_lxritag)) {
			/* This xri has an rrq outstanding for this DID.
			/* This xri has an rrq outstanding for this DID.
			 * put it back in the list and get another xri.
			 * put it back in the list and get another xri.
			 */
			 */
@@ -13953,7 +13953,6 @@ lpfc_sli4_xri_inrange(struct lpfc_hba *phba,
	return NO_XRI;
	return NO_XRI;
}
}



/**
/**
 * lpfc_sli4_seq_abort_rsp - bls rsp to sequence abort
 * lpfc_sli4_seq_abort_rsp - bls rsp to sequence abort
 * @phba: Pointer to HBA context object.
 * @phba: Pointer to HBA context object.
@@ -13968,7 +13967,7 @@ lpfc_sli4_seq_abort_rsp(struct lpfc_hba *phba,
{
{
	struct lpfc_iocbq *ctiocb = NULL;
	struct lpfc_iocbq *ctiocb = NULL;
	struct lpfc_nodelist *ndlp;
	struct lpfc_nodelist *ndlp;
	uint16_t oxid, rxid;
	uint16_t oxid, rxid, xri, lxri;
	uint32_t sid, fctl;
	uint32_t sid, fctl;
	IOCB_t *icmd;
	IOCB_t *icmd;
	int rc;
	int rc;
@@ -13987,8 +13986,6 @@ lpfc_sli4_seq_abort_rsp(struct lpfc_hba *phba,
				"SID:x%x\n", oxid, sid);
				"SID:x%x\n", oxid, sid);
		return;
		return;
	}
	}
	if (lpfc_sli4_xri_inrange(phba, rxid))
		lpfc_set_rrq_active(phba, ndlp, rxid, oxid, 0);


	/* Allocate buffer for rsp iocb */
	/* Allocate buffer for rsp iocb */
	ctiocb = lpfc_sli_get_iocbq(phba);
	ctiocb = lpfc_sli_get_iocbq(phba);
@@ -14019,13 +14016,24 @@ lpfc_sli4_seq_abort_rsp(struct lpfc_hba *phba,
	ctiocb->sli4_lxritag = NO_XRI;
	ctiocb->sli4_lxritag = NO_XRI;
	ctiocb->sli4_xritag = NO_XRI;
	ctiocb->sli4_xritag = NO_XRI;


	if (fctl & FC_FC_EX_CTX)
		/* Exchange responder sent the abort so we
		 * own the oxid.
		 */
		xri = oxid;
	else
		xri = rxid;
	lxri = lpfc_sli4_xri_inrange(phba, xri);
	if (lxri != NO_XRI)
		lpfc_set_rrq_active(phba, ndlp, lxri,
			(xri == oxid) ? rxid : oxid, 0);
	/* If the oxid maps to the FCP XRI range or if it is out of range,
	/* If the oxid maps to the FCP XRI range or if it is out of range,
	 * send a BLS_RJT.  The driver no longer has that exchange.
	 * send a BLS_RJT.  The driver no longer has that exchange.
	 * Override the IOCB for a BA_RJT.
	 * Override the IOCB for a BA_RJT.
	 */
	 */
	if (oxid > (phba->sli4_hba.max_cfg_param.max_xri +
	if (xri > (phba->sli4_hba.max_cfg_param.max_xri +
		    phba->sli4_hba.max_cfg_param.xri_base) ||
		    phba->sli4_hba.max_cfg_param.xri_base) ||
	    oxid > (lpfc_sli4_get_els_iocb_cnt(phba) +
	    xri > (lpfc_sli4_get_els_iocb_cnt(phba) +
		    phba->sli4_hba.max_cfg_param.xri_base)) {
		    phba->sli4_hba.max_cfg_param.xri_base)) {
		icmd->un.xseq64.w5.hcsw.Rctl = FC_RCTL_BA_RJT;
		icmd->un.xseq64.w5.hcsw.Rctl = FC_RCTL_BA_RJT;
		bf_set(lpfc_vndr_code, &icmd->un.bls_rsp, 0);
		bf_set(lpfc_vndr_code, &icmd->un.bls_rsp, 0);