Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Himanshu Madhani <himanshu.madhani@oracle.com>
To: Justin Tee <justintee8345@gmail.com>, linux-scsi@vger.kernel.org
Cc: jsmart2021@gmail.com, justin.tee@broadcom.com
Subject: Re: [PATCH 08/17] lpfc: Add condition to delete ndlp object after sending BLS_RJT to an ABTS
Date: Tue, 30 Jan 2024 18:39:08 -0800	[thread overview]
Message-ID: <b2cff78d-2f0a-4e51-9884-cee311df7f53@oracle.com> (raw)
In-Reply-To: <20240131003549.147784-9-justintee8345@gmail.com>



On 1/30/24 16:35, Justin Tee wrote:
> The "Nodelist not empty" log message and an accompanying delay may be
> observed when deleting an NPIV port or unloading the lpfc driver.  This
> can occur due to receipt of an ABTS for which there is no corresponding
> login context or ndlp allocated.  In such cases, the driver allocates a new
> ndlp object to send a BLS_RJT after which the ndlp object unintentionally
> remains in the NLP_STE_UNUSED_NODE state forever.
> 
> Add a check to conditionally remove ndlp's initial reference count when
> queuing a BLS response.  If the initial reference is removed, then set
> the NLP_DROPPED flag to notify other code paths.
> 
> Signed-off-by: Justin Tee <justin.tee@broadcom.com>
> ---
>   drivers/scsi/lpfc/lpfc_sli.c | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index c7a2f565e2c2..29fd2eda70d5 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -18933,7 +18933,7 @@ lpfc_sli4_seq_abort_rsp(struct lpfc_vport *vport,
>   					 "oxid:x%x SID:x%x\n", oxid, sid);
>   			return;
>   		}
> -		/* Put ndlp onto pport node list */
> +		/* Put ndlp onto vport node list */
>   		lpfc_enqueue_node(vport, ndlp);
>   	}
>   
> @@ -18953,7 +18953,7 @@ lpfc_sli4_seq_abort_rsp(struct lpfc_vport *vport,
>   		return;
>   	}
>   
> -	ctiocb->vport = phba->pport;
> +	ctiocb->vport = vport;
>   	ctiocb->cmd_cmpl = lpfc_sli4_seq_abort_rsp_cmpl;
>   	ctiocb->sli4_lxritag = NO_XRI;
>   	ctiocb->sli4_xritag = NO_XRI;
> @@ -19040,6 +19040,16 @@ lpfc_sli4_seq_abort_rsp(struct lpfc_vport *vport,
>   		ctiocb->ndlp = NULL;
>   		lpfc_sli_release_iocbq(phba, ctiocb);
>   	}
> +
> +	/* if only usage of this nodelist is BLS response, release initial ref
> +	 * to free ndlp when transmit completes
> +	 */
> +	if (ndlp->nlp_state == NLP_STE_UNUSED_NODE &&
> +	    !(ndlp->nlp_flag & NLP_DROPPED) &&
> +	    !(ndlp->fc4_xpt_flags & (NVME_XPT_REGD | SCSI_XPT_REGD))) {
> +		ndlp->nlp_flag |= NLP_DROPPED;
> +		lpfc_nlp_put(ndlp);
> +	}
>   }
>   
>   /**

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

-- 
Himanshu Madhani                                Oracle Linux Engineering

  reply	other threads:[~2024-01-31  2:39 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31  0:35 [PATCH 00/17] lpfc: Update lpfc to revision 14.4.0.0 Justin Tee
2024-01-31  0:35 ` [PATCH 01/17] lpfc: Initialize status local variable in lpfc_sli4_repost_sgl_list Justin Tee
2024-01-31  2:35   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 02/17] lpfc: Fix possible memory leak in lpfc_rcv_padisc Justin Tee
2024-01-31  2:35   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 03/17] lpfc: Use sg_dma_len API to get struct scatterlist's length Justin Tee
2024-01-31  2:36   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 04/17] lpfc: Remove D_ID swap log message from trace event logger Justin Tee
2024-01-31  2:36   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 05/17] lpfc: Allow lpfc_plogi_confirm_nport logic to execute for Fabric nodes Justin Tee
2024-01-31  2:36   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 06/17] lpfc: Remove NLP_RCV_PLOGI early return during RSCN processing for ndlps Justin Tee
2024-01-31  2:37   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 07/17] lpfc: Fix failure to delete vports when discovery is in progress Justin Tee
2024-01-31  2:37   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 08/17] lpfc: Add condition to delete ndlp object after sending BLS_RJT to an ABTS Justin Tee
2024-01-31  2:39   ` Himanshu Madhani [this message]
2024-01-31  0:35 ` [PATCH 09/17] lpfc: Save FPIN frequency statistics upon receipt of peer cgn notifications Justin Tee
2024-01-31  2:39   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 10/17] lpfc: Move handling of reset congestion statistics events Justin Tee
2024-01-31  2:40   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 11/17] lpfc: Remove shost_lock protection for fc_host_port shost APIs Justin Tee
2024-01-31  2:41   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 12/17] lpfc: Change nlp state statistic counters into atomic_t Justin Tee
2024-01-31  2:44   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 13/17] lpfc: Protect vport fc_nodes list with an explicit spin lock Justin Tee
2024-01-31  2:50   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 14/17] lpfc: Change lpfc_vport fc_flag member into a bitmask Justin Tee
2024-01-31  3:35   ` Himanshu Madhani
2024-01-31 18:31     ` Justin Tee
2024-01-31  0:35 ` [PATCH 15/17] lpfc: Change lpfc_vport load_flag " Justin Tee
2024-01-31  0:35 ` [PATCH 16/17] lpfc: Update lpfc version to 14.4.0.0 Justin Tee
2024-01-31  2:33   ` Himanshu Madhani
2024-01-31  0:35 ` [PATCH 17/17] lpfc: Copyright updates for 14.4.0.0 patches Justin Tee
2024-01-31  2:33   ` Himanshu Madhani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2cff78d-2f0a-4e51-9884-cee311df7f53@oracle.com \
    --to=himanshu.madhani@oracle.com \
    --cc=jsmart2021@gmail.com \
    --cc=justin.tee@broadcom.com \
    --cc=justintee8345@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox