Commit 78777dd6 authored by Himanshu Madhani's avatar Himanshu Madhani Committed by Greg Kroah-Hartman

scsi: qla2xxx: Fix NPIV handling for FC-NVMe

[ Upstream commit 5e6803b4 ]

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: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 58ab95b0
...@@ -474,21 +474,10 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, ...@@ -474,21 +474,10 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
int rval = -ENODEV; int rval = -ENODEV;
srb_t *sp; srb_t *sp;
struct qla_qpair *qpair = hw_queue_handle; 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; 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; fcport = qla_rport->fcport;
if (!fcport) {
ql_log(ql_log_warn, NULL, 0x210e, "No fcport ptr\n");
return rval;
}
vha = fcport->vha; vha = fcport->vha;
...@@ -517,6 +506,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, ...@@ -517,6 +506,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
sp->name = "nvme_cmd"; sp->name = "nvme_cmd";
sp->done = qla_nvme_sp_done; sp->done = qla_nvme_sp_done;
sp->qpair = qpair; sp->qpair = qpair;
sp->vha = vha;
nvme = &sp->u.iocb_cmd; nvme = &sp->u.iocb_cmd;
nvme->u.nvme.desc = fd; nvme->u.nvme.desc = fd;
...@@ -564,7 +554,7 @@ static void qla_nvme_remoteport_delete(struct nvme_fc_remote_port *rport) ...@@ -564,7 +554,7 @@ static void qla_nvme_remoteport_delete(struct nvme_fc_remote_port *rport)
schedule_work(&fcport->free_work); 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, ql_log(ql_log_info, fcport->vha, 0x2110,
"remoteport_delete of %p completed.\n", fcport); "remoteport_delete of %p completed.\n", fcport);
} }
......
...@@ -3538,6 +3538,8 @@ qla2x00_delete_all_vps(struct qla_hw_data *ha, scsi_qla_host_t *base_vha) ...@@ -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); spin_unlock_irqrestore(&ha->vport_slock, flags);
mutex_unlock(&ha->vport_lock); mutex_unlock(&ha->vport_lock);
qla_nvme_delete(vha);
fc_vport_terminate(vha->fc_vport); fc_vport_terminate(vha->fc_vport);
scsi_host_put(vha->host); scsi_host_put(vha->host);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment