mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 16:07:39 +00:00
scsi: lpfc: Add support for VMID tagging of NVMe I/Os
Modify the NVMe I/O path to look for VMID support and call the transport to obtain the I/O's appid value. Link: https://lore.kernel.org/r/20220519123110.17361-5-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Co-developed-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
348efeca74
commit
896325a8b1
1 changed files with 45 additions and 0 deletions
|
@ -1279,6 +1279,19 @@ lpfc_nvme_prep_io_cmd(struct lpfc_vport *vport,
|
|||
|
||||
/* Words 13 14 15 are for PBDE support */
|
||||
|
||||
/* add the VMID tags as per switch response */
|
||||
if (unlikely(lpfc_ncmd->cur_iocbq.cmd_flag & LPFC_IO_VMID)) {
|
||||
if (phba->pport->vmid_priority_tagging) {
|
||||
bf_set(wqe_ccpe, &wqe->fcp_iwrite.wqe_com, 1);
|
||||
bf_set(wqe_ccp, &wqe->fcp_iwrite.wqe_com,
|
||||
lpfc_ncmd->cur_iocbq.vmid_tag.cs_ctl_vmid);
|
||||
} else {
|
||||
bf_set(wqe_appid, &wqe->fcp_iwrite.wqe_com, 1);
|
||||
bf_set(wqe_wqes, &wqe->fcp_iwrite.wqe_com, 1);
|
||||
wqe->words[31] = lpfc_ncmd->cur_iocbq.vmid_tag.app_id;
|
||||
}
|
||||
}
|
||||
|
||||
pwqeq->vport = vport;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1504,6 +1517,11 @@ lpfc_nvme_fcp_io_submit(struct nvme_fc_local_port *pnvme_lport,
|
|||
struct lpfc_nvme_fcpreq_priv *freqpriv;
|
||||
struct nvme_common_command *sqe;
|
||||
uint64_t start = 0;
|
||||
#if (IS_ENABLED(CONFIG_NVME_FC))
|
||||
u8 *uuid = NULL;
|
||||
int err;
|
||||
enum dma_data_direction iodir;
|
||||
#endif
|
||||
|
||||
/* Validate pointers. LLDD fault handling with transport does
|
||||
* have timing races.
|
||||
|
@ -1662,6 +1680,33 @@ lpfc_nvme_fcp_io_submit(struct nvme_fc_local_port *pnvme_lport,
|
|||
lpfc_ncmd->ndlp = ndlp;
|
||||
lpfc_ncmd->qidx = lpfc_queue_info->qidx;
|
||||
|
||||
#if (IS_ENABLED(CONFIG_NVME_FC))
|
||||
/* check the necessary and sufficient condition to support VMID */
|
||||
if (lpfc_is_vmid_enabled(phba) &&
|
||||
(ndlp->vmid_support ||
|
||||
phba->pport->vmid_priority_tagging ==
|
||||
LPFC_VMID_PRIO_TAG_ALL_TARGETS)) {
|
||||
/* is the I/O generated by a VM, get the associated virtual */
|
||||
/* entity id */
|
||||
uuid = nvme_fc_io_getuuid(pnvme_fcreq);
|
||||
|
||||
if (uuid) {
|
||||
if (pnvme_fcreq->io_dir == NVMEFC_FCP_WRITE)
|
||||
iodir = DMA_TO_DEVICE;
|
||||
else if (pnvme_fcreq->io_dir == NVMEFC_FCP_READ)
|
||||
iodir = DMA_FROM_DEVICE;
|
||||
else
|
||||
iodir = DMA_NONE;
|
||||
|
||||
err = lpfc_vmid_get_appid(vport, uuid, iodir,
|
||||
(union lpfc_vmid_io_tag *)
|
||||
&lpfc_ncmd->cur_iocbq.vmid_tag);
|
||||
if (!err)
|
||||
lpfc_ncmd->cur_iocbq.cmd_flag |= LPFC_IO_VMID;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Issue the IO on the WQ indicated by index in the hw_queue_handle.
|
||||
* This identfier was create in our hardware queue create callback
|
||||
|
|
Loading…
Reference in a new issue