2019-12-03 22:49:46

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 4.19 084/321] scsi: qla2xxx: Fix NPIV handling for FC-NVMe

From: Himanshu Madhani <[email protected]>

[ Upstream commit 5e6803b409ba3c18434de6693062d98a470bcb1e ]

This patch fixes issues with NPIV port with FC-NVMe. Clean up code for
remoteport delete and also call nvme_delete when deleting VPs.

Signed-off-by: Himanshu Madhani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/scsi/qla2xxx/qla_nvme.c | 16 +++-------------
drivers/scsi/qla2xxx/qla_os.c | 2 ++
2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index e6545cb9a2c19..5590d6e8b5762 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -474,21 +474,10 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
int rval = -ENODEV;
srb_t *sp;
struct qla_qpair *qpair = hw_queue_handle;
- struct nvme_private *priv;
+ struct nvme_private *priv = fd->private;
struct qla_nvme_rport *qla_rport = rport->private;

- if (!fd || !qpair) {
- ql_log(ql_log_warn, NULL, 0x2134,
- "NO NVMe request or Queue Handle\n");
- return rval;
- }
-
- priv = fd->private;
fcport = qla_rport->fcport;
- if (!fcport) {
- ql_log(ql_log_warn, NULL, 0x210e, "No fcport ptr\n");
- return rval;
- }

vha = fcport->vha;

@@ -517,6 +506,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
sp->name = "nvme_cmd";
sp->done = qla_nvme_sp_done;
sp->qpair = qpair;
+ sp->vha = vha;
nvme = &sp->u.iocb_cmd;
nvme->u.nvme.desc = fd;

@@ -564,7 +554,7 @@ static void qla_nvme_remoteport_delete(struct nvme_fc_remote_port *rport)
schedule_work(&fcport->free_work);
}

- fcport->nvme_flag &= ~(NVME_FLAG_REGISTERED | NVME_FLAG_DELETING);
+ fcport->nvme_flag &= ~NVME_FLAG_DELETING;
ql_log(ql_log_info, fcport->vha, 0x2110,
"remoteport_delete of %p completed.\n", fcport);
}
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 3e892e013658d..183bfda8f5d11 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3538,6 +3538,8 @@ qla2x00_delete_all_vps(struct qla_hw_data *ha, scsi_qla_host_t *base_vha)
spin_unlock_irqrestore(&ha->vport_slock, flags);
mutex_unlock(&ha->vport_lock);

+ qla_nvme_delete(vha);
+
fc_vport_terminate(vha->fc_vport);
scsi_host_put(vha->host);

--
2.20.1




2019-12-04 21:49:07

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 4.19 084/321] scsi: qla2xxx: Fix NPIV handling for FC-NVMe

Hi!

> From: Himanshu Madhani <[email protected]>
>
> [ Upstream commit 5e6803b409ba3c18434de6693062d98a470bcb1e ]
>
> This patch fixes issues with NPIV port with FC-NVMe. Clean up code for
> remoteport delete and also call nvme_delete when deleting VPs.

> @@ -564,7 +554,7 @@ static void qla_nvme_remoteport_delete(struct nvme_fc_remote_port *rport)
> schedule_work(&fcport->free_work);
> }
>
> - fcport->nvme_flag &= ~(NVME_FLAG_REGISTERED | NVME_FLAG_DELETING);
> + fcport->nvme_flag &= ~NVME_FLAG_DELETING;
> ql_log(ql_log_info, fcport->vha, 0x2110,
> "remoteport_delete of %p completed.\n", fcport);
> }

Current -next-20191204 contains

fcport->nvme_flag &= ~NVME_FLAG_REGISTERED;
fcport->nvme_flag &= ~NVME_FLAG_DELETING;

... and there's no explanation in changelog why removing
NVME_FLAG_REGISTERED is good idea.

Are you sure this change is correct and suitable for -stable?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Attachments:
(No filename) (1.07 kB)
signature.asc (188.00 B)
Digital signature
Download all attachments

2019-12-05 18:00:24

by Himanshu Madhani

[permalink] [raw]
Subject: Re: [PATCH 4.19 084/321] scsi: qla2xxx: Fix NPIV handling for FC-NVMe

Hello,

On 12/4/19, 3:48 PM, "Pavel Machek" <[email protected] on behalf of [email protected]> wrote:

Hi!

> From: Himanshu Madhani <[email protected]>
>
> [ Upstream commit 5e6803b409ba3c18434de6693062d98a470bcb1e ]
>
> This patch fixes issues with NPIV port with FC-NVMe. Clean up code for
> remoteport delete and also call nvme_delete when deleting VPs.

> @@ -564,7 +554,7 @@ static void qla_nvme_remoteport_delete(struct nvme_fc_remote_port *rport)
> schedule_work(&fcport->free_work);
> }
>
> - fcport->nvme_flag &= ~(NVME_FLAG_REGISTERED | NVME_FLAG_DELETING);
> + fcport->nvme_flag &= ~NVME_FLAG_DELETING;
> ql_log(ql_log_info, fcport->vha, 0x2110,
> "remoteport_delete of %p completed.\n", fcport);
> }

Current -next-20191204 contains

fcport->nvme_flag &= ~NVME_FLAG_REGISTERED;
fcport->nvme_flag &= ~ NVME_FLAG_DELETING;

... and there's no explanation in changelog why removing
NVME_FLAG_REGISTERED is good idea.

This patch was mostly cleanup and if you notice on line 541 we are already clearing up NVME_FLAG_REGISTERED flag.

e84067d743010 (Duane Grigsby 2017-06-21 13:48:43 -0700 541) fcport->nvme_flag &= ~NVME_FLAG_REGISTERED;

so this patch is just removing duplicate clearing. At some point we will need to fix double line of clearing NVME_FLAG_REGISTERED and NVME_FLAG_DELETING
in one line. I'll send patch to fix that for net-next.

Thanks,
Himanshu

Are you sure this change is correct and suitable for -stable?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html