mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
scsi: lpfc: Modify handling of ADISC based on ndlp state and RPI registration
In lpfc_check_adisc, remove the requirement that the ndlp object must have been RPI registered. Whether or not the ndlp is RPI registered is unrelated to verifying that the received ADISC is intended for that ndlp rport object. After ADISC receipt, there's no need to put the ndlp state into NPR. Let the cmpl routines from the actions taken earlier in ADISC handling set the proper ndlp state. Also, refactor when a RESUME_RPI mailbox command should be sent. It should only be sent if the RPI registered flag is set. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
bb33b07ac6
commit
ee80d8c2d4
1 changed files with 22 additions and 17 deletions
|
@ -64,9 +64,6 @@ static int
|
|||
lpfc_check_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
|
||||
struct lpfc_name *nn, struct lpfc_name *pn)
|
||||
{
|
||||
/* First, we MUST have a RPI registered */
|
||||
if (!test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag))
|
||||
return 0;
|
||||
|
||||
/* Compare the ADISC rsp WWNN / WWPN matches our internal node
|
||||
* table entry for that node.
|
||||
|
@ -735,6 +732,7 @@ lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
|
|||
ADISC *ap;
|
||||
uint32_t *lp;
|
||||
uint32_t cmd;
|
||||
int rc;
|
||||
|
||||
pcmd = cmdiocb->cmd_dmabuf;
|
||||
lp = (uint32_t *) pcmd->virt;
|
||||
|
@ -759,21 +757,29 @@ lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
|
|||
* resume the RPI before the ACC goes out.
|
||||
*/
|
||||
if (vport->phba->sli_rev == LPFC_SLI_REV4) {
|
||||
elsiocb = kmalloc(sizeof(struct lpfc_iocbq),
|
||||
GFP_KERNEL);
|
||||
if (elsiocb) {
|
||||
/* Save info from cmd IOCB used in rsp */
|
||||
memcpy((uint8_t *)elsiocb, (uint8_t *)cmdiocb,
|
||||
sizeof(struct lpfc_iocbq));
|
||||
/* Don't resume an unregistered RPI - unnecessary
|
||||
* mailbox. Just send the ACC when the RPI is not
|
||||
* registered.
|
||||
*/
|
||||
if (test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag)) {
|
||||
elsiocb = kmalloc(sizeof(*elsiocb), GFP_KERNEL);
|
||||
if (elsiocb) {
|
||||
/* Save info from cmd IOCB used in
|
||||
* rsp
|
||||
*/
|
||||
memcpy(elsiocb, cmdiocb,
|
||||
sizeof(*elsiocb));
|
||||
|
||||
/* Save the ELS cmd */
|
||||
elsiocb->drvrTimeout = cmd;
|
||||
elsiocb->drvrTimeout = cmd;
|
||||
|
||||
if (lpfc_sli4_resume_rpi(ndlp,
|
||||
lpfc_mbx_cmpl_resume_rpi,
|
||||
elsiocb))
|
||||
kfree(elsiocb);
|
||||
goto out;
|
||||
rc = lpfc_sli4_resume_rpi(ndlp,
|
||||
lpfc_mbx_cmpl_resume_rpi,
|
||||
elsiocb);
|
||||
if (rc)
|
||||
kfree(elsiocb);
|
||||
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -815,7 +821,6 @@ out:
|
|||
set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag);
|
||||
ndlp->nlp_last_elscmd = ELS_CMD_PLOGI;
|
||||
ndlp->nlp_prev_state = ndlp->nlp_state;
|
||||
lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue