aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_nportdisc.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2007-08-02 11:10:31 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-08-01 13:24:10 -0400
commit51ef4c26891a734bc8416b639ad460a8162926bc (patch)
tree8279e11bf1a0a3200e8aa9bb3d956345ef73533c /drivers/scsi/lpfc/lpfc_nportdisc.c
parent78b2d852a88cd2a55e3ab632109de045d58b83e3 (diff)
[SCSI] lpfc 8.2.2 : Miscellaneous Bug Fixes
- Fix vport ndlp ref counting errors - Fix use after free of ndlp structure - Use the correct flag to check for LOADING setting. - Fix driver unload bugs (related to shost references) after link down or rscn - Fix up HBQ initialization - Fix port_list locking around driver unload. - Fix references to hostdata as a phba - Fix GFFID type offset to work correctly with big endian structure. - Only call pci_disable_msi if the pci_enable_msi succeeded - Fix vport_delete wait/fail if in discovery - Put a reference on the nameservers ndlp when performing CT traffic. - Remove unbalanced hba unlock. - Fix up HBQ processing - Fix lpfc debugfs discovery trace output for ELS rsp cmpl - Send ADISC when rpi is 0 - Stop FDISC retrying forever - Unable to retrieve correct config parameter for vport - Fix sli_validate_fcp_iocb, sli_sum_iocb, sli_abort_iocb to be vport-aware. - Fix index-out-of-range error in iocb. Spotted by Coverity. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_nportdisc.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_nportdisc.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 66ba51cbeb50..880af0cd463d 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -329,7 +329,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
329 case NLP_STE_PRLI_ISSUE: 329 case NLP_STE_PRLI_ISSUE:
330 case NLP_STE_UNMAPPED_NODE: 330 case NLP_STE_UNMAPPED_NODE:
331 case NLP_STE_MAPPED_NODE: 331 case NLP_STE_MAPPED_NODE:
332 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL, 0); 332 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL);
333 return 1; 333 return 1;
334 } 334 }
335 335
@@ -407,7 +407,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
407 ndlp, mbox); 407 ndlp, mbox);
408 return 1; 408 return 1;
409 } 409 }
410 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, mbox, 0); 410 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, mbox);
411 return 1; 411 return 1;
412 412
413out: 413out:
@@ -451,7 +451,7 @@ lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
451 lpfc_els_rsp_adisc_acc(vport, cmdiocb, ndlp); 451 lpfc_els_rsp_adisc_acc(vport, cmdiocb, ndlp);
452 } else { 452 } else {
453 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, 453 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp,
454 NULL, 0); 454 NULL);
455 } 455 }
456 return 1; 456 return 1;
457 } 457 }
@@ -488,9 +488,9 @@ lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
488 ndlp->nlp_flag |= NLP_LOGO_ACC; 488 ndlp->nlp_flag |= NLP_LOGO_ACC;
489 spin_unlock_irq(shost->host_lock); 489 spin_unlock_irq(shost->host_lock);
490 if (els_cmd == ELS_CMD_PRLO) 490 if (els_cmd == ELS_CMD_PRLO)
491 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); 491 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL);
492 else 492 else
493 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 493 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
494 494
495 if (!(ndlp->nlp_type & NLP_FABRIC) || 495 if (!(ndlp->nlp_type & NLP_FABRIC) ||
496 (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { 496 (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) {
@@ -564,6 +564,11 @@ lpfc_disc_set_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
564{ 564{
565 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 565 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
566 566
567 if (!ndlp->nlp_rpi) {
568 ndlp->nlp_flag &= ~NLP_NPR_ADISC;
569 return 0;
570 }
571
567 /* Check config parameter use-adisc or FCP-2 */ 572 /* Check config parameter use-adisc or FCP-2 */
568 if ((vport->cfg_use_adisc && (vport->fc_flag & FC_RSCN_MODE)) || 573 if ((vport->cfg_use_adisc && (vport->fc_flag & FC_RSCN_MODE)) ||
569 ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) { 574 ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) {
@@ -627,7 +632,7 @@ lpfc_rcv_logo_unused_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
627 spin_lock_irq(shost->host_lock); 632 spin_lock_irq(shost->host_lock);
628 ndlp->nlp_flag |= NLP_LOGO_ACC; 633 ndlp->nlp_flag |= NLP_LOGO_ACC;
629 spin_unlock_irq(shost->host_lock); 634 spin_unlock_irq(shost->host_lock);
630 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 635 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
631 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE); 636 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE);
632 637
633 return ndlp->nlp_state; 638 return ndlp->nlp_state;
@@ -723,7 +728,7 @@ lpfc_rcv_els_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
723 lpfc_els_abort(phba, ndlp); 728 lpfc_els_abort(phba, ndlp);
724 729
725 if (evt == NLP_EVT_RCV_LOGO) { 730 if (evt == NLP_EVT_RCV_LOGO) {
726 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 731 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
727 } else { 732 } else {
728 lpfc_issue_els_logo(vport, ndlp, 0); 733 lpfc_issue_els_logo(vport, ndlp, 0);
729 } 734 }
@@ -1167,7 +1172,7 @@ lpfc_rcv_prlo_reglogin_issue(struct lpfc_vport *vport,
1167 struct lpfc_iocbq *cmdiocb; 1172 struct lpfc_iocbq *cmdiocb;
1168 1173
1169 cmdiocb = (struct lpfc_iocbq *) arg; 1174 cmdiocb = (struct lpfc_iocbq *) arg;
1170 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); 1175 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL);
1171 return ndlp->nlp_state; 1176 return ndlp->nlp_state;
1172} 1177}
1173 1178
@@ -1322,7 +1327,7 @@ lpfc_rcv_prlo_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1322{ 1327{
1323 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; 1328 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg;
1324 1329
1325 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); 1330 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL);
1326 return ndlp->nlp_state; 1331 return ndlp->nlp_state;
1327} 1332}
1328 1333
@@ -1514,7 +1519,7 @@ lpfc_rcv_prlo_unmap_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1514{ 1519{
1515 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; 1520 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg;
1516 1521
1517 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); 1522 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL);
1518 return ndlp->nlp_state; 1523 return ndlp->nlp_state;
1519} 1524}
1520 1525
@@ -1585,8 +1590,8 @@ lpfc_rcv_prlo_mapped_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1585 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; 1590 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg;
1586 1591
1587 /* flush the target */ 1592 /* flush the target */
1588 lpfc_sli_abort_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], 1593 lpfc_sli_abort_iocb(vport, &phba->sli.ring[phba->sli.fcp_ring],
1589 ndlp->nlp_sid, 0, 0, LPFC_CTX_TGT); 1594 ndlp->nlp_sid, 0, LPFC_CTX_TGT);
1590 1595
1591 /* Treat like rcv logo */ 1596 /* Treat like rcv logo */
1592 lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_PRLO); 1597 lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_PRLO);
@@ -1719,7 +1724,7 @@ lpfc_rcv_prlo_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1719 ndlp->nlp_flag |= NLP_LOGO_ACC; 1724 ndlp->nlp_flag |= NLP_LOGO_ACC;
1720 spin_unlock_irq(shost->host_lock); 1725 spin_unlock_irq(shost->host_lock);
1721 1726
1722 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 1727 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
1723 1728
1724 if ((ndlp->nlp_flag & NLP_DELAY_TMO) == 0) { 1729 if ((ndlp->nlp_flag & NLP_DELAY_TMO) == 0) {
1725 mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1); 1730 mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1);