aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_nportdisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_nportdisc.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_nportdisc.c118
1 files changed, 50 insertions, 68 deletions
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 9c159a8e6e8c..66ba51cbeb50 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -133,15 +133,15 @@ lpfc_check_sparm(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
133 memcpy(&ndlp->nlp_portname, &sp->portName, sizeof (struct lpfc_name)); 133 memcpy(&ndlp->nlp_portname, &sp->portName, sizeof (struct lpfc_name));
134 return 1; 134 return 1;
135bad_service_param: 135bad_service_param:
136 lpfc_printf_log(vport->phba, KERN_ERR, LOG_DISCOVERY, 136 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
137 "%d (%d):0207 Device %x " 137 "0207 Device %x "
138 "(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x) sent " 138 "(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x) sent "
139 "invalid service parameters. Ignoring device.\n", 139 "invalid service parameters. Ignoring device.\n",
140 vport->phba->brd_no, ndlp->vport->vpi, ndlp->nlp_DID, 140 ndlp->nlp_DID,
141 sp->nodeName.u.wwn[0], sp->nodeName.u.wwn[1], 141 sp->nodeName.u.wwn[0], sp->nodeName.u.wwn[1],
142 sp->nodeName.u.wwn[2], sp->nodeName.u.wwn[3], 142 sp->nodeName.u.wwn[2], sp->nodeName.u.wwn[3],
143 sp->nodeName.u.wwn[4], sp->nodeName.u.wwn[5], 143 sp->nodeName.u.wwn[4], sp->nodeName.u.wwn[5],
144 sp->nodeName.u.wwn[6], sp->nodeName.u.wwn[7]); 144 sp->nodeName.u.wwn[6], sp->nodeName.u.wwn[7]);
145 return 0; 145 return 0;
146} 146}
147 147
@@ -194,11 +194,11 @@ lpfc_els_abort(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
194 IOCB_t *cmd; 194 IOCB_t *cmd;
195 195
196 /* Abort outstanding I/O on NPort <nlp_DID> */ 196 /* Abort outstanding I/O on NPort <nlp_DID> */
197 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 197 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_DISCOVERY,
198 "%d (%d):0205 Abort outstanding I/O on NPort x%x " 198 "0205 Abort outstanding I/O on NPort x%x "
199 "Data: x%x x%x x%x\n", 199 "Data: x%x x%x x%x\n",
200 phba->brd_no, ndlp->vport->vpi, ndlp->nlp_DID, 200 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
201 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); 201 ndlp->nlp_rpi);
202 202
203 lpfc_fabric_abort_nport(ndlp); 203 lpfc_fabric_abort_nport(ndlp);
204 204
@@ -298,11 +298,10 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
298 icmd = &cmdiocb->iocb; 298 icmd = &cmdiocb->iocb;
299 299
300 /* PLOGI chkparm OK */ 300 /* PLOGI chkparm OK */
301 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 301 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
302 "%d (%d):0114 PLOGI chkparm OK Data: x%x x%x x%x x%x\n", 302 "0114 PLOGI chkparm OK Data: x%x x%x x%x x%x\n",
303 phba->brd_no, vport->vpi, 303 ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag,
304 ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, 304 ndlp->nlp_rpi);
305 ndlp->nlp_rpi);
306 305
307 if (vport->cfg_fcp_class == 2 && sp->cls2.classValid) 306 if (vport->cfg_fcp_class == 2 && sp->cls2.classValid)
308 ndlp->nlp_fcp_info |= CLASS2; 307 ndlp->nlp_fcp_info |= CLASS2;
@@ -582,12 +581,11 @@ static uint32_t
582lpfc_disc_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, 581lpfc_disc_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
583 void *arg, uint32_t evt) 582 void *arg, uint32_t evt)
584{ 583{
585 lpfc_printf_log(vport->phba, KERN_ERR, LOG_DISCOVERY, 584 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
586 "%d (%d):0253 Illegal State Transition: node x%x " 585 "0253 Illegal State Transition: node x%x "
587 "event x%x, state x%x Data: x%x x%x\n", 586 "event x%x, state x%x Data: x%x x%x\n",
588 vport->phba->brd_no, vport->vpi, 587 ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi,
589 ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi, 588 ndlp->nlp_flag);
590 ndlp->nlp_flag);
591 return ndlp->nlp_state; 589 return ndlp->nlp_state;
592} 590}
593 591
@@ -777,15 +775,11 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
777 sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t)); 775 sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t));
778 if (!lpfc_check_sparm(vport, ndlp, sp, CLASS3)) 776 if (!lpfc_check_sparm(vport, ndlp, sp, CLASS3))
779 goto out; 777 goto out;
780
781 /* PLOGI chkparm OK */ 778 /* PLOGI chkparm OK */
782 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 779 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
783 "%d (%d):0121 PLOGI chkparm OK " 780 "0121 PLOGI chkparm OK Data: x%x x%x x%x x%x\n",
784 "Data: x%x x%x x%x x%x\n", 781 ndlp->nlp_DID, ndlp->nlp_state,
785 phba->brd_no, vport->vpi, 782 ndlp->nlp_flag, ndlp->nlp_rpi);
786 ndlp->nlp_DID, ndlp->nlp_state,
787 ndlp->nlp_flag, ndlp->nlp_rpi);
788
789 if (vport->cfg_fcp_class == 2 && (sp->cls2.classValid)) 783 if (vport->cfg_fcp_class == 2 && (sp->cls2.classValid))
790 ndlp->nlp_fcp_info |= CLASS2; 784 ndlp->nlp_fcp_info |= CLASS2;
791 else 785 else
@@ -805,10 +799,9 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
805 799
806 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 800 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
807 if (!mbox) { 801 if (!mbox) {
808 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 802 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
809 "%d (%d):0133 PLOGI: no memory for reg_login " 803 "0133 PLOGI: no memory for reg_login "
810 "Data: x%x x%x x%x x%x\n", 804 "Data: x%x x%x x%x x%x\n",
811 phba->brd_no, vport->vpi,
812 ndlp->nlp_DID, ndlp->nlp_state, 805 ndlp->nlp_DID, ndlp->nlp_state,
813 ndlp->nlp_flag, ndlp->nlp_rpi); 806 ndlp->nlp_flag, ndlp->nlp_rpi);
814 goto out; 807 goto out;
@@ -843,30 +836,27 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
843 kfree(mp); 836 kfree(mp);
844 mempool_free(mbox, phba->mbox_mem_pool); 837 mempool_free(mbox, phba->mbox_mem_pool);
845 838
846 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 839 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
847 "%d (%d):0134 PLOGI: cannot issue reg_login " 840 "0134 PLOGI: cannot issue reg_login "
848 "Data: x%x x%x x%x x%x\n", 841 "Data: x%x x%x x%x x%x\n",
849 phba->brd_no, vport->vpi, 842 ndlp->nlp_DID, ndlp->nlp_state,
850 ndlp->nlp_DID, ndlp->nlp_state, 843 ndlp->nlp_flag, ndlp->nlp_rpi);
851 ndlp->nlp_flag, ndlp->nlp_rpi);
852 } else { 844 } else {
853 mempool_free(mbox, phba->mbox_mem_pool); 845 mempool_free(mbox, phba->mbox_mem_pool);
854 846
855 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 847 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
856 "%d (%d):0135 PLOGI: cannot format reg_login " 848 "0135 PLOGI: cannot format reg_login "
857 "Data: x%x x%x x%x x%x\n", 849 "Data: x%x x%x x%x x%x\n",
858 phba->brd_no, vport->vpi, 850 ndlp->nlp_DID, ndlp->nlp_state,
859 ndlp->nlp_DID, ndlp->nlp_state, 851 ndlp->nlp_flag, ndlp->nlp_rpi);
860 ndlp->nlp_flag, ndlp->nlp_rpi);
861 } 852 }
862 853
863 854
864out: 855out:
865 if (ndlp->nlp_DID == NameServer_DID) { 856 if (ndlp->nlp_DID == NameServer_DID) {
866 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 857 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
867 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 858 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
868 "%d (%d):0261 Cannot Register NameServer login\n", 859 "0261 Cannot Register NameServer login\n");
869 phba->brd_no, vport->vpi);
870 } 860 }
871 861
872 /* Free this node since the driver cannot login or has the wrong 862 /* Free this node since the driver cannot login or has the wrong
@@ -1188,19 +1178,15 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport,
1188 uint32_t evt) 1178 uint32_t evt)
1189{ 1179{
1190 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 1180 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
1191 struct lpfc_hba *phba = vport->phba;
1192 LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg; 1181 LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg;
1193 MAILBOX_t *mb = &pmb->mb; 1182 MAILBOX_t *mb = &pmb->mb;
1194 uint32_t did = mb->un.varWords[1]; 1183 uint32_t did = mb->un.varWords[1];
1195 1184
1196 if (mb->mbxStatus) { 1185 if (mb->mbxStatus) {
1197 /* RegLogin failed */ 1186 /* RegLogin failed */
1198 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 1187 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1199 "%d (%d):0246 RegLogin failed Data: x%x x%x " 1188 "0246 RegLogin failed Data: x%x x%x x%x\n",
1200 "x%x\n",
1201 phba->brd_no, vport->vpi,
1202 did, mb->mbxStatus, vport->port_state); 1189 did, mb->mbxStatus, vport->port_state);
1203
1204 /* 1190 /*
1205 * If RegLogin failed due to lack of HBA resources do not 1191 * If RegLogin failed due to lack of HBA resources do not
1206 * retry discovery. 1192 * retry discovery.
@@ -2046,7 +2032,6 @@ int
2046lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, 2032lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2047 void *arg, uint32_t evt) 2033 void *arg, uint32_t evt)
2048{ 2034{
2049 struct lpfc_hba *phba = vport->phba;
2050 uint32_t cur_state, rc; 2035 uint32_t cur_state, rc;
2051 uint32_t(*func) (struct lpfc_vport *, struct lpfc_nodelist *, void *, 2036 uint32_t(*func) (struct lpfc_vport *, struct lpfc_nodelist *, void *,
2052 uint32_t); 2037 uint32_t);
@@ -2055,11 +2040,10 @@ lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2055 cur_state = ndlp->nlp_state; 2040 cur_state = ndlp->nlp_state;
2056 2041
2057 /* DSM in event <evt> on NPort <nlp_DID> in state <cur_state> */ 2042 /* DSM in event <evt> on NPort <nlp_DID> in state <cur_state> */
2058 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 2043 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2059 "%d (%d):0211 DSM in event x%x on NPort x%x in " 2044 "0211 DSM in event x%x on NPort x%x in "
2060 "state %d Data: x%x\n", 2045 "state %d Data: x%x\n",
2061 phba->brd_no, vport->vpi, 2046 evt, ndlp->nlp_DID, cur_state, ndlp->nlp_flag);
2062 evt, ndlp->nlp_DID, cur_state, ndlp->nlp_flag);
2063 2047
2064 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, 2048 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM,
2065 "DSM in: evt:%d ste:%d did:x%x", 2049 "DSM in: evt:%d ste:%d did:x%x",
@@ -2069,11 +2053,9 @@ lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2069 rc = (func) (vport, ndlp, arg, evt); 2053 rc = (func) (vport, ndlp, arg, evt);
2070 2054
2071 /* DSM out state <rc> on NPort <nlp_DID> */ 2055 /* DSM out state <rc> on NPort <nlp_DID> */
2072 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 2056 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2073 "%d (%d):0212 DSM out state %d on NPort x%x " 2057 "0212 DSM out state %d on NPort x%x Data: x%x\n",
2074 "Data: x%x\n", 2058 rc, ndlp->nlp_DID, ndlp->nlp_flag);
2075 phba->brd_no, vport->vpi,
2076 rc, ndlp->nlp_DID, ndlp->nlp_flag);
2077 2059
2078 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, 2060 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM,
2079 "DSM out: ste:%d did:x%x flg:x%x", 2061 "DSM out: ste:%d did:x%x flg:x%x",