@@ -1057,9 +1057,9 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1057
1057
goto flogifail ;
1058
1058
1059
1059
lpfc_printf_vlog (vport , KERN_WARNING , LOG_ELS ,
1060
- "0150 FLOGI failure Status:x%x/x%x TMO:x%x\n" ,
1060
+ "0150 FLOGI failure Status:x%x/x%x xri x%x TMO:x%x\n" ,
1061
1061
irsp -> ulpStatus , irsp -> un .ulpWord [4 ],
1062
- irsp -> ulpTimeout );
1062
+ cmdiocb -> sli4_xritag , irsp -> ulpTimeout );
1063
1063
1064
1064
/* FLOGI failed, so there is no fabric */
1065
1065
spin_lock_irq (shost -> host_lock );
@@ -1113,7 +1113,8 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1113
1113
/* FLOGI completes successfully */
1114
1114
lpfc_printf_vlog (vport , KERN_INFO , LOG_ELS ,
1115
1115
"0101 FLOGI completes successfully, I/O tag:x%x, "
1116
- "Data: x%x x%x x%x x%x x%x x%x\n" , cmdiocb -> iotag ,
1116
+ "xri x%x Data: x%x x%x x%x x%x x%x %x\n" ,
1117
+ cmdiocb -> iotag , cmdiocb -> sli4_xritag ,
1117
1118
irsp -> un .ulpWord [4 ], sp -> cmn .e_d_tov ,
1118
1119
sp -> cmn .w2 .r_a_tov , sp -> cmn .edtovResolution ,
1119
1120
vport -> port_state , vport -> fc_flag );
@@ -4347,14 +4348,6 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag,
4347
4348
default :
4348
4349
return 1 ;
4349
4350
}
4350
- /* Xmit ELS ACC response tag <ulpIoTag> */
4351
- lpfc_printf_vlog (vport , KERN_INFO , LOG_ELS ,
4352
- "0128 Xmit ELS ACC response tag x%x, XRI: x%x, "
4353
- "DID: x%x, nlp_flag: x%x nlp_state: x%x RPI: x%x "
4354
- "fc_flag x%x\n" ,
4355
- elsiocb -> iotag , elsiocb -> iocb .ulpContext ,
4356
- ndlp -> nlp_DID , ndlp -> nlp_flag , ndlp -> nlp_state ,
4357
- ndlp -> nlp_rpi , vport -> fc_flag );
4358
4351
if (ndlp -> nlp_flag & NLP_LOGO_ACC ) {
4359
4352
spin_lock_irq (shost -> host_lock );
4360
4353
if (!(ndlp -> nlp_flag & NLP_RPI_REGISTERED ||
@@ -4523,6 +4516,15 @@ lpfc_els_rsp_adisc_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb,
4523
4516
lpfc_els_free_iocb (phba , elsiocb );
4524
4517
return 1 ;
4525
4518
}
4519
+
4520
+ /* Xmit ELS ACC response tag <ulpIoTag> */
4521
+ lpfc_printf_vlog (vport , KERN_INFO , LOG_ELS ,
4522
+ "0128 Xmit ELS ACC response Status: x%x, IoTag: x%x, "
4523
+ "XRI: x%x, DID: x%x, nlp_flag: x%x nlp_state: x%x "
4524
+ "RPI: x%x, fc_flag x%x\n" ,
4525
+ rc , elsiocb -> iotag , elsiocb -> sli4_xritag ,
4526
+ ndlp -> nlp_DID , ndlp -> nlp_flag , ndlp -> nlp_state ,
4527
+ ndlp -> nlp_rpi , vport -> fc_flag );
4526
4528
return 0 ;
4527
4529
}
4528
4530
@@ -6533,6 +6535,11 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
6533
6535
port_state = vport -> port_state ;
6534
6536
vport -> fc_flag |= FC_PT2PT ;
6535
6537
vport -> fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP );
6538
+
6539
+ /* Acking an unsol FLOGI. Count 1 for link bounce
6540
+ * work-around.
6541
+ */
6542
+ vport -> rcv_flogi_cnt ++ ;
6536
6543
spin_unlock_irq (shost -> host_lock );
6537
6544
lpfc_printf_vlog (vport , KERN_INFO , LOG_ELS ,
6538
6545
"3311 Rcv Flogi PS x%x new PS x%x "
@@ -7930,8 +7937,9 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
7930
7937
struct ls_rjt stat ;
7931
7938
uint32_t * payload ;
7932
7939
uint32_t cmd , did , newnode ;
7933
- uint8_t rjt_exp , rjt_err = 0 ;
7940
+ uint8_t rjt_exp , rjt_err = 0 , init_link = 0 ;
7934
7941
IOCB_t * icmd = & elsiocb -> iocb ;
7942
+ LPFC_MBOXQ_t * mbox ;
7935
7943
7936
7944
if (!vport || !(elsiocb -> context2 ))
7937
7945
goto dropit ;
@@ -8080,6 +8088,19 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
8080
8088
did , vport -> port_state , ndlp -> nlp_flag );
8081
8089
8082
8090
phba -> fc_stat .elsRcvFLOGI ++ ;
8091
+
8092
+ /* If the driver believes fabric discovery is done and is ready,
8093
+ * bounce the link. There is some descrepancy.
8094
+ */
8095
+ if (vport -> port_state >= LPFC_LOCAL_CFG_LINK &&
8096
+ vport -> fc_flag & FC_PT2PT &&
8097
+ vport -> rcv_flogi_cnt >= 1 ) {
8098
+ rjt_err = LSRJT_LOGICAL_BSY ;
8099
+ rjt_exp = LSEXP_NOTHING_MORE ;
8100
+ init_link ++ ;
8101
+ goto lsrjt ;
8102
+ }
8103
+
8083
8104
lpfc_els_rcv_flogi (vport , elsiocb , ndlp );
8084
8105
if (newnode )
8085
8106
lpfc_nlp_put (ndlp );
@@ -8308,6 +8329,27 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
8308
8329
8309
8330
lpfc_nlp_put (elsiocb -> context1 );
8310
8331
elsiocb -> context1 = NULL ;
8332
+
8333
+ /* Special case. Driver received an unsolicited command that
8334
+ * unsupportable given the driver's current state. Reset the
8335
+ * link and start over.
8336
+ */
8337
+ if (init_link ) {
8338
+ mbox = mempool_alloc (phba -> mbox_mem_pool , GFP_KERNEL );
8339
+ if (!mbox )
8340
+ return ;
8341
+ lpfc_linkdown (phba );
8342
+ lpfc_init_link (phba , mbox ,
8343
+ phba -> cfg_topology ,
8344
+ phba -> cfg_link_speed );
8345
+ mbox -> u .mb .un .varInitLnk .lipsr_AL_PA = 0 ;
8346
+ mbox -> mbox_cmpl = lpfc_sli_def_mbox_cmpl ;
8347
+ mbox -> vport = vport ;
8348
+ if (lpfc_sli_issue_mbox (phba , mbox , MBX_NOWAIT ) ==
8349
+ MBX_NOT_FINISHED )
8350
+ mempool_free (mbox , phba -> mbox_mem_pool );
8351
+ }
8352
+
8311
8353
return ;
8312
8354
8313
8355
dropit :
0 commit comments