@@ -735,7 +735,7 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)
735735
736736 lpfc_printf_vlog (vport , KERN_INFO , LOG_DISCOVERY ,
737737 "0238 Process x%06x NameServer Rsp "
738- "Data: x%x x%x x%x x%lx x%x\n" , Did ,
738+ "Data: x%lx x%x x%x x%lx x%x\n" , Did ,
739739 ndlp -> nlp_flag , ndlp -> nlp_fc4_type ,
740740 ndlp -> nlp_state , vport -> fc_flag ,
741741 vport -> fc_rscn_id_cnt );
@@ -744,7 +744,7 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)
744744 * state of ndlp hit devloss, change state to
745745 * allow rediscovery.
746746 */
747- if (ndlp -> nlp_flag & NLP_NPR_2B_DISC &&
747+ if (test_bit ( NLP_NPR_2B_DISC , & ndlp -> nlp_flag ) &&
748748 ndlp -> nlp_state == NLP_STE_UNUSED_NODE ) {
749749 lpfc_nlp_set_state (vport , ndlp ,
750750 NLP_STE_NPR_NODE );
@@ -832,12 +832,10 @@ lpfc_ns_rsp_audit_did(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)
832832 if (ndlp -> nlp_type != NLP_NVME_INITIATOR ||
833833 ndlp -> nlp_state != NLP_STE_UNMAPPED_NODE )
834834 continue ;
835- spin_lock_irq (& ndlp -> lock );
836835 if (ndlp -> nlp_DID == Did )
837- ndlp -> nlp_flag &= ~ NLP_NVMET_RECOV ;
836+ clear_bit ( NLP_NVMET_RECOV , & ndlp -> nlp_flag ) ;
838837 else
839- ndlp -> nlp_flag |= NLP_NVMET_RECOV ;
840- spin_unlock_irq (& ndlp -> lock );
838+ set_bit (NLP_NVMET_RECOV , & ndlp -> nlp_flag );
841839 }
842840 }
843841}
@@ -894,13 +892,11 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint8_t fc4_type,
894892 */
895893 if (vport -> phba -> nvmet_support ) {
896894 list_for_each_entry (ndlp , & vport -> fc_nodes , nlp_listp ) {
897- if (!( ndlp -> nlp_flag & NLP_NVMET_RECOV ))
895+ if (!test_bit ( NLP_NVMET_RECOV , & ndlp -> nlp_flag ))
898896 continue ;
899897 lpfc_disc_state_machine (vport , ndlp , NULL ,
900898 NLP_EVT_DEVICE_RECOVERY );
901- spin_lock_irq (& ndlp -> lock );
902- ndlp -> nlp_flag &= ~NLP_NVMET_RECOV ;
903- spin_unlock_irq (& ndlp -> lock );
899+ clear_bit (NLP_NVMET_RECOV , & ndlp -> nlp_flag );
904900 }
905901 }
906902
@@ -1440,7 +1436,7 @@ lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
14401436 if (ndlp ) {
14411437 lpfc_printf_vlog (vport , KERN_INFO , LOG_DISCOVERY ,
14421438 "0242 Process x%x GFF "
1443- "NameServer Rsp Data: x%x x%lx x%x\n" ,
1439+ "NameServer Rsp Data: x%lx x%lx x%x\n" ,
14441440 did , ndlp -> nlp_flag , vport -> fc_flag ,
14451441 vport -> fc_rscn_id_cnt );
14461442 } else {
@@ -2226,6 +2222,11 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
22262222 ulp_status , ulp_word4 , latt );
22272223
22282224 if (latt || ulp_status ) {
2225+ lpfc_printf_vlog (vport , KERN_WARNING , LOG_DISCOVERY ,
2226+ "0229 FDMI cmd %04x failed, latt = %d "
2227+ "ulp_status: (x%x/x%x), sli_flag x%x\n" ,
2228+ be16_to_cpu (fdmi_cmd ), latt , ulp_status ,
2229+ ulp_word4 , phba -> sli .sli_flag );
22292230
22302231 /* Look for a retryable error */
22312232 if (ulp_status == IOSTAT_LOCAL_REJECT ) {
@@ -2234,8 +2235,16 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
22342235 case IOERR_SLI_DOWN :
22352236 /* Driver aborted this IO. No retry as error
22362237 * is likely Offline->Online or some adapter
2237- * error. Recovery will try again.
2238+ * error. Recovery will try again, but if port
2239+ * is not active there's no point to continue
2240+ * issuing follow up FDMI commands.
22382241 */
2242+ if (!(phba -> sli .sli_flag & LPFC_SLI_ACTIVE )) {
2243+ free_ndlp = cmdiocb -> ndlp ;
2244+ lpfc_ct_free_iocb (phba , cmdiocb );
2245+ lpfc_nlp_put (free_ndlp );
2246+ return ;
2247+ }
22392248 break ;
22402249 case IOERR_ABORT_IN_PROGRESS :
22412250 case IOERR_SEQUENCE_TIMEOUT :
@@ -2256,12 +2265,6 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
22562265 break ;
22572266 }
22582267 }
2259-
2260- lpfc_printf_vlog (vport , KERN_INFO , LOG_DISCOVERY ,
2261- "0229 FDMI cmd %04x latt = %d "
2262- "ulp_status: x%x, rid x%x\n" ,
2263- be16_to_cpu (fdmi_cmd ), latt , ulp_status ,
2264- ulp_word4 );
22652268 }
22662269
22672270 free_ndlp = cmdiocb -> ndlp ;
0 commit comments