diff mbox series

[07/17] lpfc: Fix failure to delete vports when discovery is in progress

Message ID 20240131003549.147784-8-justintee8345@gmail.com (mailing list archive)
State Superseded
Headers show
Series lpfc: Update lpfc to revision 14.4.0.0 | expand

Commit Message

Justin Tee Jan. 31, 2024, 12:35 a.m. UTC
Requests to delete an NPIV port may fail repeatedly if the initial request
is received during discovery.

If the FC_UNLOADING load_flag is set, then skip CT response processing for
the physical port.  This allows discovery processing for other lpfc_vport
objects to reach their cmpl routines before deleting the vport.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
---
 drivers/scsi/lpfc/lpfc_ct.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Himanshu Madhani Jan. 31, 2024, 2:37 a.m. UTC | #1
On 1/30/24 16:35, Justin Tee wrote:
> Requests to delete an NPIV port may fail repeatedly if the initial request
> is received during discovery.
> 
> If the FC_UNLOADING load_flag is set, then skip CT response processing for
> the physical port.  This allows discovery processing for other lpfc_vport
> objects to reach their cmpl routines before deleting the vport.
> 
> Signed-off-by: Justin Tee <justin.tee@broadcom.com>
> ---
>   drivers/scsi/lpfc/lpfc_ct.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
> index baae1f8279e0..315db836404a 100644
> --- a/drivers/scsi/lpfc/lpfc_ct.c
> +++ b/drivers/scsi/lpfc/lpfc_ct.c
> @@ -943,8 +943,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
>   		goto out;
>   	}
>   
> -	/* Don't bother processing response if vport is being torn down. */
> -	if (vport->load_flag & FC_UNLOADING) {
> +	/* Skip processing response on pport if unloading */
> +	if (vport == phba->pport && vport->load_flag & FC_UNLOADING) {
>   		if (vport->fc_flag & FC_RSCN_MODE)
>   			lpfc_els_flush_rscn(vport);
>   		goto out;
> @@ -1166,8 +1166,8 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
>   		goto out;
>   	}
>   
> -	/* Don't bother processing response if vport is being torn down. */
> -	if (vport->load_flag & FC_UNLOADING) {
> +	/* Skip processing response on pport if unloading */
> +	if (vport == phba->pport && vport->load_flag & FC_UNLOADING) {
>   		if (vport->fc_flag & FC_RSCN_MODE)
>   			lpfc_els_flush_rscn(vport);
>   		goto out;

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

Patch

diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index baae1f8279e0..315db836404a 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -943,8 +943,8 @@  lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 		goto out;
 	}
 
-	/* Don't bother processing response if vport is being torn down. */
-	if (vport->load_flag & FC_UNLOADING) {
+	/* Skip processing response on pport if unloading */
+	if (vport == phba->pport && vport->load_flag & FC_UNLOADING) {
 		if (vport->fc_flag & FC_RSCN_MODE)
 			lpfc_els_flush_rscn(vport);
 		goto out;
@@ -1166,8 +1166,8 @@  lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 		goto out;
 	}
 
-	/* Don't bother processing response if vport is being torn down. */
-	if (vport->load_flag & FC_UNLOADING) {
+	/* Skip processing response on pport if unloading */
+	if (vport == phba->pport && vport->load_flag & FC_UNLOADING) {
 		if (vport->fc_flag & FC_RSCN_MODE)
 			lpfc_els_flush_rscn(vport);
 		goto out;