diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 310 |
1 files changed, 135 insertions, 175 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 914e74ac11e5..55c4e5455a57 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -201,25 +201,23 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) | |||
201 | warn_on = 0; | 201 | warn_on = 0; |
202 | 202 | ||
203 | if (warn_on) { | 203 | if (warn_on) { |
204 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 204 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
205 | "%d (%d):0203 Devloss timeout on " | 205 | "0203 Devloss timeout on " |
206 | "WWPN %x:%x:%x:%x:%x:%x:%x:%x " | 206 | "WWPN %x:%x:%x:%x:%x:%x:%x:%x " |
207 | "NPort x%x Data: x%x x%x x%x\n", | 207 | "NPort x%x Data: x%x x%x x%x\n", |
208 | phba->brd_no, vport->vpi, | 208 | *name, *(name+1), *(name+2), *(name+3), |
209 | *name, *(name+1), *(name+2), *(name+3), | 209 | *(name+4), *(name+5), *(name+6), *(name+7), |
210 | *(name+4), *(name+5), *(name+6), *(name+7), | 210 | ndlp->nlp_DID, ndlp->nlp_flag, |
211 | ndlp->nlp_DID, ndlp->nlp_flag, | 211 | ndlp->nlp_state, ndlp->nlp_rpi); |
212 | ndlp->nlp_state, ndlp->nlp_rpi); | ||
213 | } else { | 212 | } else { |
214 | lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, | 213 | lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
215 | "%d (%d):0204 Devloss timeout on " | 214 | "0204 Devloss timeout on " |
216 | "WWPN %x:%x:%x:%x:%x:%x:%x:%x " | 215 | "WWPN %x:%x:%x:%x:%x:%x:%x:%x " |
217 | "NPort x%x Data: x%x x%x x%x\n", | 216 | "NPort x%x Data: x%x x%x x%x\n", |
218 | phba->brd_no, vport->vpi, | 217 | *name, *(name+1), *(name+2), *(name+3), |
219 | *name, *(name+1), *(name+2), *(name+3), | 218 | *(name+4), *(name+5), *(name+6), *(name+7), |
220 | *(name+4), *(name+5), *(name+6), *(name+7), | 219 | ndlp->nlp_DID, ndlp->nlp_flag, |
221 | ndlp->nlp_DID, ndlp->nlp_flag, | 220 | ndlp->nlp_state, ndlp->nlp_rpi); |
222 | ndlp->nlp_state, ndlp->nlp_rpi); | ||
223 | } | 221 | } |
224 | 222 | ||
225 | if (!(vport->load_flag & FC_UNLOADING) && | 223 | if (!(vport->load_flag & FC_UNLOADING) && |
@@ -750,12 +748,10 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
750 | /* Check for error */ | 748 | /* Check for error */ |
751 | if ((mb->mbxStatus) && (mb->mbxStatus != 0x1601)) { | 749 | if ((mb->mbxStatus) && (mb->mbxStatus != 0x1601)) { |
752 | /* CLEAR_LA mbox error <mbxStatus> state <hba_state> */ | 750 | /* CLEAR_LA mbox error <mbxStatus> state <hba_state> */ |
753 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, | 751 | lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
754 | "%d (%d):0320 CLEAR_LA mbxStatus error x%x hba " | 752 | "0320 CLEAR_LA mbxStatus error x%x hba " |
755 | "state x%x\n", | 753 | "state x%x\n", |
756 | phba->brd_no, vport->vpi, mb->mbxStatus, | 754 | mb->mbxStatus, vport->port_state); |
757 | vport->port_state); | ||
758 | |||
759 | phba->link_state = LPFC_HBA_ERROR; | 755 | phba->link_state = LPFC_HBA_ERROR; |
760 | goto out; | 756 | goto out; |
761 | } | 757 | } |
@@ -787,10 +783,8 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
787 | 783 | ||
788 | out: | 784 | out: |
789 | /* Device Discovery completes */ | 785 | /* Device Discovery completes */ |
790 | lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, | 786 | lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
791 | "%d (%d):0225 Device Discovery completes\n", | 787 | "0225 Device Discovery completes\n"); |
792 | phba->brd_no, vport->vpi); | ||
793 | |||
794 | mempool_free(pmb, phba->mbox_mem_pool); | 788 | mempool_free(pmb, phba->mbox_mem_pool); |
795 | 789 | ||
796 | spin_lock_irq(shost->host_lock); | 790 | spin_lock_irq(shost->host_lock); |
@@ -847,19 +841,17 @@ lpfc_mbx_cmpl_local_config_link(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
847 | return; | 841 | return; |
848 | 842 | ||
849 | out: | 843 | out: |
850 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, | 844 | lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
851 | "%d (%d):0306 CONFIG_LINK mbxStatus error x%x " | 845 | "0306 CONFIG_LINK mbxStatus error x%x " |
852 | "HBA state x%x\n", | 846 | "HBA state x%x\n", |
853 | phba->brd_no, vport->vpi, pmb->mb.mbxStatus, | 847 | pmb->mb.mbxStatus, vport->port_state); |
854 | vport->port_state); | ||
855 | |||
856 | mempool_free(pmb, phba->mbox_mem_pool); | 848 | mempool_free(pmb, phba->mbox_mem_pool); |
857 | 849 | ||
858 | lpfc_linkdown(phba); | 850 | lpfc_linkdown(phba); |
859 | 851 | ||
860 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 852 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
861 | "%d (%d):0200 CONFIG_LINK bad hba state x%x\n", | 853 | "0200 CONFIG_LINK bad hba state x%x\n", |
862 | phba->brd_no, vport->vpi, vport->port_state); | 854 | vport->port_state); |
863 | 855 | ||
864 | lpfc_issue_clear_la(phba, vport); | 856 | lpfc_issue_clear_la(phba, vport); |
865 | return; | 857 | return; |
@@ -876,12 +868,10 @@ lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
876 | /* Check for error */ | 868 | /* Check for error */ |
877 | if (mb->mbxStatus) { | 869 | if (mb->mbxStatus) { |
878 | /* READ_SPARAM mbox error <mbxStatus> state <hba_state> */ | 870 | /* READ_SPARAM mbox error <mbxStatus> state <hba_state> */ |
879 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, | 871 | lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
880 | "%d (%d):0319 READ_SPARAM mbxStatus error x%x " | 872 | "0319 READ_SPARAM mbxStatus error x%x " |
881 | "hba state x%x>\n", | 873 | "hba state x%x>\n", |
882 | phba->brd_no, vport->vpi, mb->mbxStatus, | 874 | mb->mbxStatus, vport->port_state); |
883 | vport->port_state); | ||
884 | |||
885 | lpfc_linkdown(phba); | 875 | lpfc_linkdown(phba); |
886 | goto out; | 876 | goto out; |
887 | } | 877 | } |
@@ -964,7 +954,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la) | |||
964 | if (i == 0) { | 954 | if (i == 0) { |
965 | phba->alpa_map[0] = 0; | 955 | phba->alpa_map[0] = 0; |
966 | } else { | 956 | } else { |
967 | if (phba->cfg_log_verbose & LOG_LINK_EVENT) { | 957 | if (vport->cfg_log_verbose & LOG_LINK_EVENT) { |
968 | int numalpa, j, k; | 958 | int numalpa, j, k; |
969 | union { | 959 | union { |
970 | uint8_t pamap[16]; | 960 | uint8_t pamap[16]; |
@@ -990,10 +980,9 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la) | |||
990 | lpfc_printf_log(phba, | 980 | lpfc_printf_log(phba, |
991 | KERN_WARNING, | 981 | KERN_WARNING, |
992 | LOG_LINK_EVENT, | 982 | LOG_LINK_EVENT, |
993 | "%d:1304 Link Up Event " | 983 | "1304 Link Up Event " |
994 | "ALPA map Data: x%x " | 984 | "ALPA map Data: x%x " |
995 | "x%x x%x x%x\n", | 985 | "x%x x%x x%x\n", |
996 | phba->brd_no, | ||
997 | un.pa.wd1, un.pa.wd2, | 986 | un.pa.wd1, un.pa.wd2, |
998 | un.pa.wd3, un.pa.wd4); | 987 | un.pa.wd3, un.pa.wd4); |
999 | } | 988 | } |
@@ -1041,11 +1030,9 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la) | |||
1041 | } | 1030 | } |
1042 | out: | 1031 | out: |
1043 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); | 1032 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); |
1044 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, | 1033 | lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
1045 | "%d (%d):0263 Discovery Mailbox error: state: 0x%x : %p %p\n", | 1034 | "0263 Discovery Mailbox error: state: 0x%x : %p %p\n", |
1046 | phba->brd_no, vport->vpi, | 1035 | vport->port_state, sparam_mbox, cfglink_mbox); |
1047 | vport->port_state, sparam_mbox, cfglink_mbox); | ||
1048 | |||
1049 | lpfc_issue_clear_la(phba, vport); | 1036 | lpfc_issue_clear_la(phba, vport); |
1050 | return; | 1037 | return; |
1051 | } | 1038 | } |
@@ -1086,8 +1073,8 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1086 | /* Check for error */ | 1073 | /* Check for error */ |
1087 | if (mb->mbxStatus) { | 1074 | if (mb->mbxStatus) { |
1088 | lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, | 1075 | lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, |
1089 | "%d:1307 READ_LA mbox error x%x state x%x\n", | 1076 | "1307 READ_LA mbox error x%x state x%x\n", |
1090 | phba->brd_no, mb->mbxStatus, vport->port_state); | 1077 | mb->mbxStatus, vport->port_state); |
1091 | lpfc_mbx_issue_link_down(phba); | 1078 | lpfc_mbx_issue_link_down(phba); |
1092 | phba->link_state = LPFC_HBA_ERROR; | 1079 | phba->link_state = LPFC_HBA_ERROR; |
1093 | goto lpfc_mbx_cmpl_read_la_free_mbuf; | 1080 | goto lpfc_mbx_cmpl_read_la_free_mbuf; |
@@ -1118,26 +1105,26 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1118 | phba->fc_stat.LinkUp++; | 1105 | phba->fc_stat.LinkUp++; |
1119 | if (phba->link_flag & LS_LOOPBACK_MODE) { | 1106 | if (phba->link_flag & LS_LOOPBACK_MODE) { |
1120 | lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, | 1107 | lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, |
1121 | "%d:1306 Link Up Event in loop back mode " | 1108 | "1306 Link Up Event in loop back mode " |
1122 | "x%x received Data: x%x x%x x%x x%x\n", | 1109 | "x%x received Data: x%x x%x x%x x%x\n", |
1123 | phba->brd_no, la->eventTag, phba->fc_eventTag, | 1110 | la->eventTag, phba->fc_eventTag, |
1124 | la->granted_AL_PA, la->UlnkSpeed, | 1111 | la->granted_AL_PA, la->UlnkSpeed, |
1125 | phba->alpa_map[0]); | 1112 | phba->alpa_map[0]); |
1126 | } else { | 1113 | } else { |
1127 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | 1114 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
1128 | "%d:1303 Link Up Event x%x received " | 1115 | "1303 Link Up Event x%x received " |
1129 | "Data: x%x x%x x%x x%x\n", | 1116 | "Data: x%x x%x x%x x%x\n", |
1130 | phba->brd_no, la->eventTag, phba->fc_eventTag, | 1117 | la->eventTag, phba->fc_eventTag, |
1131 | la->granted_AL_PA, la->UlnkSpeed, | 1118 | la->granted_AL_PA, la->UlnkSpeed, |
1132 | phba->alpa_map[0]); | 1119 | phba->alpa_map[0]); |
1133 | } | 1120 | } |
1134 | lpfc_mbx_process_link_up(phba, la); | 1121 | lpfc_mbx_process_link_up(phba, la); |
1135 | } else { | 1122 | } else { |
1136 | phba->fc_stat.LinkDown++; | 1123 | phba->fc_stat.LinkDown++; |
1137 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | 1124 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
1138 | "%d:1305 Link Down Event x%x received " | 1125 | "1305 Link Down Event x%x received " |
1139 | "Data: x%x x%x x%x\n", | 1126 | "Data: x%x x%x x%x\n", |
1140 | phba->brd_no, la->eventTag, phba->fc_eventTag, | 1127 | la->eventTag, phba->fc_eventTag, |
1141 | phba->pport->port_state, vport->fc_flag); | 1128 | phba->pport->port_state, vport->fc_flag); |
1142 | lpfc_mbx_issue_link_down(phba); | 1129 | lpfc_mbx_issue_link_down(phba); |
1143 | } | 1130 | } |
@@ -1185,10 +1172,9 @@ lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1185 | case 0x0011: | 1172 | case 0x0011: |
1186 | case 0x0020: | 1173 | case 0x0020: |
1187 | case 0x9700: | 1174 | case 0x9700: |
1188 | lpfc_printf_log(phba, KERN_INFO, LOG_NODE, | 1175 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
1189 | "%d (%d):0911 cmpl_unreg_vpi, " | 1176 | "0911 cmpl_unreg_vpi, mb status = 0x%x\n", |
1190 | "mb status = 0x%x\n", | 1177 | mb->mbxStatus); |
1191 | phba->brd_no, vport->vpi, mb->mbxStatus); | ||
1192 | break; | 1178 | break; |
1193 | } | 1179 | } |
1194 | vport->unreg_vpi_cmpl = VPORT_OK; | 1180 | vport->unreg_vpi_cmpl = VPORT_OK; |
@@ -1217,9 +1203,8 @@ lpfc_mbx_unreg_vpi(struct lpfc_vport *vport) | |||
1217 | mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi; | 1203 | mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi; |
1218 | rc = lpfc_sli_issue_mbox(phba, mbox, (MBX_NOWAIT | MBX_STOP_IOCB)); | 1204 | rc = lpfc_sli_issue_mbox(phba, mbox, (MBX_NOWAIT | MBX_STOP_IOCB)); |
1219 | if (rc == MBX_NOT_FINISHED) { | 1205 | if (rc == MBX_NOT_FINISHED) { |
1220 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_VPORT, | 1206 | lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, |
1221 | "%d (%d):1800 Could not issue unreg_vpi\n", | 1207 | "1800 Could not issue unreg_vpi\n"); |
1222 | phba->brd_no, vport->vpi); | ||
1223 | mempool_free(mbox, phba->mbox_mem_pool); | 1208 | mempool_free(mbox, phba->mbox_mem_pool); |
1224 | vport->unreg_vpi_cmpl = VPORT_ERROR; | 1209 | vport->unreg_vpi_cmpl = VPORT_ERROR; |
1225 | } | 1210 | } |
@@ -1236,9 +1221,9 @@ lpfc_mbx_cmpl_reg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1236 | case 0x0011: | 1221 | case 0x0011: |
1237 | case 0x9601: | 1222 | case 0x9601: |
1238 | case 0x9602: | 1223 | case 0x9602: |
1239 | lpfc_printf_log(phba, KERN_INFO, LOG_NODE, | 1224 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
1240 | "%d (%d):0912 cmpl_reg_vpi, mb status = 0x%x\n", | 1225 | "0912 cmpl_reg_vpi, mb status = 0x%x\n", |
1241 | phba->brd_no, vport->vpi, mb->mbxStatus); | 1226 | mb->mbxStatus); |
1242 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); | 1227 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); |
1243 | spin_lock_irq(shost->host_lock); | 1228 | spin_lock_irq(shost->host_lock); |
1244 | vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP); | 1229 | vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP); |
@@ -1300,10 +1285,9 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1300 | } | 1285 | } |
1301 | 1286 | ||
1302 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); | 1287 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); |
1303 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, | 1288 | lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
1304 | "%d (%d):0258 Register Fabric login error: 0x%x\n", | 1289 | "0258 Register Fabric login error: 0x%x\n", |
1305 | phba->brd_no, vport->vpi, mb->mbxStatus); | 1290 | mb->mbxStatus); |
1306 | |||
1307 | return; | 1291 | return; |
1308 | } | 1292 | } |
1309 | 1293 | ||
@@ -1327,11 +1311,10 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1327 | LPFC_SLI3_NPIV_ENABLED) { | 1311 | LPFC_SLI3_NPIV_ENABLED) { |
1328 | lpfc_vport_set_state(vports[i], | 1312 | lpfc_vport_set_state(vports[i], |
1329 | FC_VPORT_NO_FABRIC_SUPP); | 1313 | FC_VPORT_NO_FABRIC_SUPP); |
1330 | lpfc_printf_log(phba, KERN_ERR, LOG_ELS, | 1314 | lpfc_printf_vlog(vport, KERN_ERR, |
1331 | "%d (%d):0259 No NPIV " | 1315 | LOG_ELS, |
1332 | "Fabric support\n", | 1316 | "0259 No NPIV " |
1333 | phba->brd_no, | 1317 | "Fabric support\n"); |
1334 | vports[i]->vpi); | ||
1335 | } | 1318 | } |
1336 | } | 1319 | } |
1337 | lpfc_destroy_vport_work_array(vports); | 1320 | lpfc_destroy_vport_work_array(vports); |
@@ -1378,9 +1361,9 @@ out: | |||
1378 | return; | 1361 | return; |
1379 | } | 1362 | } |
1380 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); | 1363 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); |
1381 | lpfc_printf_log(phba, KERN_ERR, LOG_ELS, | 1364 | lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, |
1382 | "%d (%d):0260 Register NameServer error: 0x%x\n", | 1365 | "0260 Register NameServer error: 0x%x\n", |
1383 | phba->brd_no, vport->vpi, mb->mbxStatus); | 1366 | mb->mbxStatus); |
1384 | return; | 1367 | return; |
1385 | } | 1368 | } |
1386 | 1369 | ||
@@ -1605,12 +1588,11 @@ lpfc_nlp_set_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
1605 | int old_state = ndlp->nlp_state; | 1588 | int old_state = ndlp->nlp_state; |
1606 | char name1[16], name2[16]; | 1589 | char name1[16], name2[16]; |
1607 | 1590 | ||
1608 | lpfc_printf_log(vport->phba, KERN_INFO, LOG_NODE, | 1591 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
1609 | "%d (%d):0904 NPort state transition x%06x, %s -> %s\n", | 1592 | "0904 NPort state transition x%06x, %s -> %s\n", |
1610 | vport->phba->brd_no, vport->vpi, | 1593 | ndlp->nlp_DID, |
1611 | ndlp->nlp_DID, | 1594 | lpfc_nlp_state_name(name1, sizeof(name1), old_state), |
1612 | lpfc_nlp_state_name(name1, sizeof(name1), old_state), | 1595 | lpfc_nlp_state_name(name2, sizeof(name2), state)); |
1613 | lpfc_nlp_state_name(name2, sizeof(name2), state)); | ||
1614 | 1596 | ||
1615 | lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, | 1597 | lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, |
1616 | "node statechg did:x%x old:%d ste:%d", | 1598 | "node statechg did:x%x old:%d ste:%d", |
@@ -1702,12 +1684,12 @@ lpfc_set_disctmo(struct lpfc_vport *vport) | |||
1702 | spin_unlock_irq(shost->host_lock); | 1684 | spin_unlock_irq(shost->host_lock); |
1703 | 1685 | ||
1704 | /* Start Discovery Timer state <hba_state> */ | 1686 | /* Start Discovery Timer state <hba_state> */ |
1705 | lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, | 1687 | lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
1706 | "%d (%d):0247 Start Discovery Timer state x%x " | 1688 | "0247 Start Discovery Timer state x%x " |
1707 | "Data: x%x x%lx x%x x%x\n", | 1689 | "Data: x%x x%lx x%x x%x\n", |
1708 | phba->brd_no, vport->vpi, vport->port_state, tmo, | 1690 | vport->port_state, tmo, |
1709 | (unsigned long)&vport->fc_disctmo, vport->fc_plogi_cnt, | 1691 | (unsigned long)&vport->fc_disctmo, vport->fc_plogi_cnt, |
1710 | vport->fc_adisc_cnt); | 1692 | vport->fc_adisc_cnt); |
1711 | 1693 | ||
1712 | return; | 1694 | return; |
1713 | } | 1695 | } |
@@ -1719,7 +1701,6 @@ int | |||
1719 | lpfc_can_disctmo(struct lpfc_vport *vport) | 1701 | lpfc_can_disctmo(struct lpfc_vport *vport) |
1720 | { | 1702 | { |
1721 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); | 1703 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
1722 | struct lpfc_hba *phba = vport->phba; | ||
1723 | unsigned long iflags; | 1704 | unsigned long iflags; |
1724 | 1705 | ||
1725 | lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, | 1706 | lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, |
@@ -1738,13 +1719,11 @@ lpfc_can_disctmo(struct lpfc_vport *vport) | |||
1738 | } | 1719 | } |
1739 | 1720 | ||
1740 | /* Cancel Discovery Timer state <hba_state> */ | 1721 | /* Cancel Discovery Timer state <hba_state> */ |
1741 | lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, | 1722 | lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
1742 | "%d (%d):0248 Cancel Discovery Timer state x%x " | 1723 | "0248 Cancel Discovery Timer state x%x " |
1743 | "Data: x%x x%x x%x\n", | 1724 | "Data: x%x x%x x%x\n", |
1744 | phba->brd_no, vport->vpi, vport->port_state, | 1725 | vport->port_state, vport->fc_flag, |
1745 | vport->fc_flag, vport->fc_plogi_cnt, | 1726 | vport->fc_plogi_cnt, vport->fc_adisc_cnt); |
1746 | vport->fc_adisc_cnt); | ||
1747 | |||
1748 | return 0; | 1727 | return 0; |
1749 | } | 1728 | } |
1750 | 1729 | ||
@@ -1927,10 +1906,9 @@ lpfc_unreg_default_rpis(struct lpfc_vport *vport) | |||
1927 | rc = lpfc_sli_issue_mbox(phba, mbox, | 1906 | rc = lpfc_sli_issue_mbox(phba, mbox, |
1928 | (MBX_NOWAIT | MBX_STOP_IOCB)); | 1907 | (MBX_NOWAIT | MBX_STOP_IOCB)); |
1929 | if (rc == MBX_NOT_FINISHED) { | 1908 | if (rc == MBX_NOT_FINISHED) { |
1930 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_VPORT, | 1909 | lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, |
1931 | "%d (%d):1815 Could not issue " | 1910 | "1815 Could not issue " |
1932 | "unreg_did (default rpis)\n", | 1911 | "unreg_did (default rpis)\n"); |
1933 | phba->brd_no, vport->vpi); | ||
1934 | mempool_free(mbox, phba->mbox_mem_pool); | 1912 | mempool_free(mbox, phba->mbox_mem_pool); |
1935 | } | 1913 | } |
1936 | } | 1914 | } |
@@ -1949,12 +1927,11 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) | |||
1949 | struct lpfc_dmabuf *mp; | 1927 | struct lpfc_dmabuf *mp; |
1950 | 1928 | ||
1951 | /* Cleanup node for NPort <nlp_DID> */ | 1929 | /* Cleanup node for NPort <nlp_DID> */ |
1952 | lpfc_printf_log(phba, KERN_INFO, LOG_NODE, | 1930 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
1953 | "%d (%d):0900 Cleanup node for NPort x%x " | 1931 | "0900 Cleanup node for NPort x%x " |
1954 | "Data: x%x x%x x%x\n", | 1932 | "Data: x%x x%x x%x\n", |
1955 | phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_flag, | 1933 | ndlp->nlp_DID, ndlp->nlp_flag, |
1956 | ndlp->nlp_state, ndlp->nlp_rpi); | 1934 | ndlp->nlp_state, ndlp->nlp_rpi); |
1957 | |||
1958 | lpfc_dequeue_node(vport, ndlp); | 1935 | lpfc_dequeue_node(vport, ndlp); |
1959 | 1936 | ||
1960 | /* cleanup any ndlp on mbox q waiting for reglogin cmpl */ | 1937 | /* cleanup any ndlp on mbox q waiting for reglogin cmpl */ |
@@ -2086,7 +2063,6 @@ lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
2086 | static struct lpfc_nodelist * | 2063 | static struct lpfc_nodelist * |
2087 | __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) | 2064 | __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) |
2088 | { | 2065 | { |
2089 | struct lpfc_hba *phba = vport->phba; | ||
2090 | struct lpfc_nodelist *ndlp; | 2066 | struct lpfc_nodelist *ndlp; |
2091 | uint32_t data1; | 2067 | uint32_t data1; |
2092 | 2068 | ||
@@ -2096,20 +2072,18 @@ __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) | |||
2096 | ((uint32_t) ndlp->nlp_xri << 16) | | 2072 | ((uint32_t) ndlp->nlp_xri << 16) | |
2097 | ((uint32_t) ndlp->nlp_type << 8) | | 2073 | ((uint32_t) ndlp->nlp_type << 8) | |
2098 | ((uint32_t) ndlp->nlp_rpi & 0xff)); | 2074 | ((uint32_t) ndlp->nlp_rpi & 0xff)); |
2099 | lpfc_printf_log(phba, KERN_INFO, LOG_NODE, | 2075 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
2100 | "%d (%d):0929 FIND node DID " | 2076 | "0929 FIND node DID " |
2101 | " Data: x%p x%x x%x x%x\n", | 2077 | "Data: x%p x%x x%x x%x\n", |
2102 | phba->brd_no, vport->vpi, | 2078 | ndlp, ndlp->nlp_DID, |
2103 | ndlp, ndlp->nlp_DID, | 2079 | ndlp->nlp_flag, data1); |
2104 | ndlp->nlp_flag, data1); | ||
2105 | return ndlp; | 2080 | return ndlp; |
2106 | } | 2081 | } |
2107 | } | 2082 | } |
2108 | 2083 | ||
2109 | /* FIND node did <did> NOT FOUND */ | 2084 | /* FIND node did <did> NOT FOUND */ |
2110 | lpfc_printf_log(phba, KERN_INFO, LOG_NODE, | 2085 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
2111 | "%d (%d):0932 FIND node did x%x NOT FOUND.\n", | 2086 | "0932 FIND node did x%x NOT FOUND.\n", did); |
2112 | phba->brd_no, vport->vpi, did); | ||
2113 | return NULL; | 2087 | return NULL; |
2114 | } | 2088 | } |
2115 | 2089 | ||
@@ -2301,12 +2275,11 @@ lpfc_disc_start(struct lpfc_vport *vport) | |||
2301 | vport->num_disc_nodes = 0; | 2275 | vport->num_disc_nodes = 0; |
2302 | 2276 | ||
2303 | /* Start Discovery state <hba_state> */ | 2277 | /* Start Discovery state <hba_state> */ |
2304 | lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, | 2278 | lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
2305 | "%d (%d):0202 Start Discovery hba state x%x " | 2279 | "0202 Start Discovery hba state x%x " |
2306 | "Data: x%x x%x x%x\n", | 2280 | "Data: x%x x%x x%x\n", |
2307 | phba->brd_no, vport->vpi, vport->port_state, | 2281 | vport->port_state, vport->fc_flag, vport->fc_plogi_cnt, |
2308 | vport->fc_flag, vport->fc_plogi_cnt, | 2282 | vport->fc_adisc_cnt); |
2309 | vport->fc_adisc_cnt); | ||
2310 | 2283 | ||
2311 | /* First do ADISCs - if any */ | 2284 | /* First do ADISCs - if any */ |
2312 | num_sent = lpfc_els_disc_adisc(vport); | 2285 | num_sent = lpfc_els_disc_adisc(vport); |
@@ -2524,10 +2497,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) | |||
2524 | * FAN | 2497 | * FAN |
2525 | */ | 2498 | */ |
2526 | /* FAN timeout */ | 2499 | /* FAN timeout */ |
2527 | lpfc_printf_log(phba, KERN_WARNING, LOG_DISCOVERY, | 2500 | lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY, |
2528 | "%d (%d):0221 FAN timeout\n", | 2501 | "0221 FAN timeout\n"); |
2529 | phba->brd_no, vport->vpi); | ||
2530 | |||
2531 | /* Start discovery by sending FLOGI, clean up old rpis */ | 2502 | /* Start discovery by sending FLOGI, clean up old rpis */ |
2532 | list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, | 2503 | list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, |
2533 | nlp_listp) { | 2504 | nlp_listp) { |
@@ -2554,10 +2525,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) | |||
2554 | case LPFC_FLOGI: | 2525 | case LPFC_FLOGI: |
2555 | /* port_state is identically LPFC_FLOGI while waiting for FLOGI cmpl */ | 2526 | /* port_state is identically LPFC_FLOGI while waiting for FLOGI cmpl */ |
2556 | /* Initial FLOGI timeout */ | 2527 | /* Initial FLOGI timeout */ |
2557 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 2528 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
2558 | "%d (%d):0222 Initial %s timeout\n", | 2529 | "0222 Initial %s timeout\n", |
2559 | phba->brd_no, vport->vpi, | 2530 | vport->vpi ? "FLOGI" : "FDISC"); |
2560 | vport->vpi ? "FLOGI" : "FDISC"); | ||
2561 | 2531 | ||
2562 | /* Assume no Fabric and go on with discovery. | 2532 | /* Assume no Fabric and go on with discovery. |
2563 | * Check for outstanding ELS FLOGI to abort. | 2533 | * Check for outstanding ELS FLOGI to abort. |
@@ -2573,11 +2543,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) | |||
2573 | case LPFC_FABRIC_CFG_LINK: | 2543 | case LPFC_FABRIC_CFG_LINK: |
2574 | /* hba_state is identically LPFC_FABRIC_CFG_LINK while waiting for | 2544 | /* hba_state is identically LPFC_FABRIC_CFG_LINK while waiting for |
2575 | NameServer login */ | 2545 | NameServer login */ |
2576 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 2546 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
2577 | "%d (%d):0223 Timeout while waiting for " | 2547 | "0223 Timeout while waiting for " |
2578 | "NameServer login\n", | 2548 | "NameServer login\n"); |
2579 | phba->brd_no, vport->vpi); | ||
2580 | |||
2581 | /* Next look for NameServer ndlp */ | 2549 | /* Next look for NameServer ndlp */ |
2582 | ndlp = lpfc_findnode_did(vport, NameServer_DID); | 2550 | ndlp = lpfc_findnode_did(vport, NameServer_DID); |
2583 | if (ndlp) | 2551 | if (ndlp) |
@@ -2588,11 +2556,10 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) | |||
2588 | 2556 | ||
2589 | case LPFC_NS_QRY: | 2557 | case LPFC_NS_QRY: |
2590 | /* Check for wait for NameServer Rsp timeout */ | 2558 | /* Check for wait for NameServer Rsp timeout */ |
2591 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 2559 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
2592 | "%d (%d):0224 NameServer Query timeout " | 2560 | "0224 NameServer Query timeout " |
2593 | "Data: x%x x%x\n", | 2561 | "Data: x%x x%x\n", |
2594 | phba->brd_no, vport->vpi, | 2562 | vport->fc_ns_retry, LPFC_MAX_NS_RETRY); |
2595 | vport->fc_ns_retry, LPFC_MAX_NS_RETRY); | ||
2596 | 2563 | ||
2597 | if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { | 2564 | if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { |
2598 | /* Try it one more time */ | 2565 | /* Try it one more time */ |
@@ -2619,10 +2586,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) | |||
2619 | /* Setup and issue mailbox INITIALIZE LINK command */ | 2586 | /* Setup and issue mailbox INITIALIZE LINK command */ |
2620 | initlinkmbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); | 2587 | initlinkmbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); |
2621 | if (!initlinkmbox) { | 2588 | if (!initlinkmbox) { |
2622 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 2589 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
2623 | "%d (%d):0206 Device Discovery " | 2590 | "0206 Device Discovery " |
2624 | "completion error\n", | 2591 | "completion error\n"); |
2625 | phba->brd_no, vport->vpi); | ||
2626 | phba->link_state = LPFC_HBA_ERROR; | 2592 | phba->link_state = LPFC_HBA_ERROR; |
2627 | break; | 2593 | break; |
2628 | } | 2594 | } |
@@ -2643,9 +2609,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) | |||
2643 | 2609 | ||
2644 | case LPFC_DISC_AUTH: | 2610 | case LPFC_DISC_AUTH: |
2645 | /* Node Authentication timeout */ | 2611 | /* Node Authentication timeout */ |
2646 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 2612 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
2647 | "%d (%d):0227 Node Authentication timeout\n", | 2613 | "0227 Node Authentication timeout\n"); |
2648 | phba->brd_no, vport->vpi); | ||
2649 | lpfc_disc_flush_list(vport); | 2614 | lpfc_disc_flush_list(vport); |
2650 | 2615 | ||
2651 | /* | 2616 | /* |
@@ -2662,11 +2627,10 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) | |||
2662 | 2627 | ||
2663 | case LPFC_VPORT_READY: | 2628 | case LPFC_VPORT_READY: |
2664 | if (vport->fc_flag & FC_RSCN_MODE) { | 2629 | if (vport->fc_flag & FC_RSCN_MODE) { |
2665 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 2630 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
2666 | "%d (%d):0231 RSCN timeout Data: x%x " | 2631 | "0231 RSCN timeout Data: x%x " |
2667 | "x%x\n", | 2632 | "x%x\n", |
2668 | phba->brd_no, vport->vpi, | 2633 | vport->fc_ns_retry, LPFC_MAX_NS_RETRY); |
2669 | vport->fc_ns_retry, LPFC_MAX_NS_RETRY); | ||
2670 | 2634 | ||
2671 | /* Cleanup any outstanding ELS commands */ | 2635 | /* Cleanup any outstanding ELS commands */ |
2672 | lpfc_els_flush_cmd(vport); | 2636 | lpfc_els_flush_cmd(vport); |
@@ -2677,20 +2641,17 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) | |||
2677 | break; | 2641 | break; |
2678 | 2642 | ||
2679 | default: | 2643 | default: |
2680 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 2644 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
2681 | "%d (%d):0229 Unexpected discovery timeout, " | 2645 | "0229 Unexpected discovery timeout, " |
2682 | "vport State x%x\n", | 2646 | "vport State x%x\n", vport->port_state); |
2683 | phba->brd_no, vport->vpi, vport->port_state); | ||
2684 | |||
2685 | break; | 2647 | break; |
2686 | } | 2648 | } |
2687 | 2649 | ||
2688 | switch (phba->link_state) { | 2650 | switch (phba->link_state) { |
2689 | case LPFC_CLEAR_LA: | 2651 | case LPFC_CLEAR_LA: |
2690 | /* CLEAR LA timeout */ | 2652 | /* CLEAR LA timeout */ |
2691 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 2653 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
2692 | "%d (%d):0228 CLEAR LA timeout\n", | 2654 | "0228 CLEAR LA timeout\n"); |
2693 | phba->brd_no, vport->vpi); | ||
2694 | clrlaerr = 1; | 2655 | clrlaerr = 1; |
2695 | break; | 2656 | break; |
2696 | 2657 | ||
@@ -2701,10 +2662,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) | |||
2701 | case LPFC_LINK_DOWN: | 2662 | case LPFC_LINK_DOWN: |
2702 | case LPFC_LINK_UP: | 2663 | case LPFC_LINK_UP: |
2703 | case LPFC_HBA_ERROR: | 2664 | case LPFC_HBA_ERROR: |
2704 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 2665 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
2705 | "%d (%d):0230 Unexpected timeout, hba link " | 2666 | "0230 Unexpected timeout, hba link " |
2706 | "state x%x\n", | 2667 | "state x%x\n", phba->link_state); |
2707 | phba->brd_no, vport->vpi, phba->link_state); | ||
2708 | clrlaerr = 1; | 2668 | clrlaerr = 1; |
2709 | break; | 2669 | break; |
2710 | 2670 | ||