@@ -5212,14 +5212,6 @@ lpfc_nlp_logo_unreg(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
52125212 ndlp -> nlp_defer_did = NLP_EVT_NOTHING_PENDING ;
52135213 lpfc_issue_els_plogi (vport , ndlp -> nlp_DID , 0 );
52145214 } else {
5215- /* NLP_RELEASE_RPI is only set for SLI4 ports. */
5216- if (ndlp -> nlp_flag & NLP_RELEASE_RPI ) {
5217- lpfc_sli4_free_rpi (vport -> phba , ndlp -> nlp_rpi );
5218- spin_lock_irq (& ndlp -> lock );
5219- ndlp -> nlp_flag &= ~NLP_RELEASE_RPI ;
5220- ndlp -> nlp_rpi = LPFC_RPI_ALLOC_ERROR ;
5221- spin_unlock_irq (& ndlp -> lock );
5222- }
52235215 spin_lock_irq (& ndlp -> lock );
52245216 ndlp -> nlp_flag &= ~NLP_UNREG_INP ;
52255217 spin_unlock_irq (& ndlp -> lock );
@@ -5242,8 +5234,6 @@ static void
52425234lpfc_set_unreg_login_mbx_cmpl (struct lpfc_hba * phba , struct lpfc_vport * vport ,
52435235 struct lpfc_nodelist * ndlp , LPFC_MBOXQ_t * mbox )
52445236{
5245- unsigned long iflags ;
5246-
52475237 /* Driver always gets a reference on the mailbox job
52485238 * in support of async jobs.
52495239 */
@@ -5261,13 +5251,6 @@ lpfc_set_unreg_login_mbx_cmpl(struct lpfc_hba *phba, struct lpfc_vport *vport,
52615251 (kref_read (& ndlp -> kref ) > 0 )) {
52625252 mbox -> mbox_cmpl = lpfc_sli4_unreg_rpi_cmpl_clr ;
52635253 } else {
5264- if (test_bit (FC_UNLOADING , & vport -> load_flag )) {
5265- if (phba -> sli_rev == LPFC_SLI_REV4 ) {
5266- spin_lock_irqsave (& ndlp -> lock , iflags );
5267- ndlp -> nlp_flag |= NLP_RELEASE_RPI ;
5268- spin_unlock_irqrestore (& ndlp -> lock , iflags );
5269- }
5270- }
52715254 mbox -> mbox_cmpl = lpfc_sli_def_mbox_cmpl ;
52725255 }
52735256}
@@ -5330,14 +5313,11 @@ lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
53305313 return 1 ;
53315314 }
53325315
5316+ /* Accept PLOGIs after unreg_rpi_cmpl. */
53335317 if (mbox -> mbox_cmpl == lpfc_sli4_unreg_rpi_cmpl_clr )
5334- /*
5335- * accept PLOGIs after unreg_rpi_cmpl
5336- */
53375318 acc_plogi = 0 ;
5338- if (((ndlp -> nlp_DID & Fabric_DID_MASK ) !=
5339- Fabric_DID_MASK ) &&
5340- (!test_bit (FC_OFFLINE_MODE , & vport -> fc_flag )))
5319+
5320+ if (!test_bit (FC_OFFLINE_MODE , & vport -> fc_flag ))
53415321 ndlp -> nlp_flag |= NLP_UNREG_INP ;
53425322
53435323 lpfc_printf_vlog (vport , KERN_INFO ,
@@ -5561,10 +5541,6 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
55615541 list_del_init (& ndlp -> dev_loss_evt .evt_listp );
55625542 list_del_init (& ndlp -> recovery_evt .evt_listp );
55635543 lpfc_cleanup_vports_rrqs (vport , ndlp );
5564-
5565- if (phba -> sli_rev == LPFC_SLI_REV4 )
5566- ndlp -> nlp_flag |= NLP_RELEASE_RPI ;
5567-
55685544 return 0 ;
55695545}
55705546
@@ -6573,8 +6549,9 @@ lpfc_nlp_init(struct lpfc_vport *vport, uint32_t did)
65736549 INIT_LIST_HEAD (& ndlp -> nlp_listp );
65746550 if (vport -> phba -> sli_rev == LPFC_SLI_REV4 ) {
65756551 ndlp -> nlp_rpi = rpi ;
6576- lpfc_printf_vlog (vport , KERN_INFO , LOG_NODE | LOG_DISCOVERY ,
6577- "0007 Init New ndlp x%px, rpi:x%x DID:%x "
6552+ lpfc_printf_vlog (vport , KERN_INFO ,
6553+ LOG_ELS | LOG_NODE | LOG_DISCOVERY ,
6554+ "0007 Init New ndlp x%px, rpi:x%x DID:x%x "
65786555 "flg:x%x refcnt:%d\n" ,
65796556 ndlp , ndlp -> nlp_rpi , ndlp -> nlp_DID ,
65806557 ndlp -> nlp_flag , kref_read (& ndlp -> kref ));
@@ -6619,19 +6596,12 @@ lpfc_nlp_release(struct kref *kref)
66196596 lpfc_cancel_retry_delay_tmo (vport , ndlp );
66206597 lpfc_cleanup_node (vport , ndlp );
66216598
6622- /* Not all ELS transactions have registered the RPI with the port.
6623- * In these cases the rpi usage is temporary and the node is
6624- * released when the WQE is completed. Catch this case to free the
6625- * RPI to the pool. Because this node is in the release path, a lock
6626- * is unnecessary. All references are gone and the node has been
6627- * dequeued.
6599+ /* All nodes are initialized with an RPI that needs to be released
6600+ * now. All references are gone and the node has been dequeued.
66286601 */
6629- if (ndlp -> nlp_flag & NLP_RELEASE_RPI ) {
6630- if (ndlp -> nlp_rpi != LPFC_RPI_ALLOC_ERROR &&
6631- !(ndlp -> nlp_flag & (NLP_RPI_REGISTERED | NLP_UNREG_INP ))) {
6632- lpfc_sli4_free_rpi (vport -> phba , ndlp -> nlp_rpi );
6633- ndlp -> nlp_rpi = LPFC_RPI_ALLOC_ERROR ;
6634- }
6602+ if (vport -> phba -> sli_rev == LPFC_SLI_REV4 ) {
6603+ lpfc_sli4_free_rpi (vport -> phba , ndlp -> nlp_rpi );
6604+ ndlp -> nlp_rpi = LPFC_RPI_ALLOC_ERROR ;
66356605 }
66366606
66376607 /* The node is not freed back to memory, it is released to a pool so
0 commit comments