diff mbox series

[3/4] lpfc: rework lpfc_vmid_get_appid() to be protocol independent

Message ID 20220510200028.37399-4-jsmart2021@gmail.com (mailing list archive)
State Superseded
Headers show
Series Add VMID support to nvme-fc transport and lpfc driver | expand

Commit Message

James Smart May 10, 2022, 8 p.m. UTC
Rework lpfc_vmid_get_appid() arguments to remove scsi cmd dependency.
It's now callable by nvme path.

Fixup scsi calling path for arg change.

Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_crtn.h | 5 +++--
 drivers/scsi/lpfc/lpfc_scsi.c | 7 ++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

Comments

Hannes Reinecke May 12, 2022, 9:51 a.m. UTC | #1
On 5/10/22 22:00, James Smart wrote:
> Rework lpfc_vmid_get_appid() arguments to remove scsi cmd dependency.
> It's now callable by nvme path.
> 
> Fixup scsi calling path for arg change.
> 
> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> ---
>   drivers/scsi/lpfc/lpfc_crtn.h | 5 +++--
>   drivers/scsi/lpfc/lpfc_scsi.c | 7 ++++---
>   2 files changed, 7 insertions(+), 5 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Himanshu Madhani May 12, 2022, 11:48 p.m. UTC | #2
> On May 10, 2022, at 1:00 PM, James Smart <jsmart2021@gmail.com> wrote:
> 
> Rework lpfc_vmid_get_appid() arguments to remove scsi cmd dependency.
> It's now callable by nvme path.
> 
> Fixup scsi calling path for arg change.
> 
> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> ---
> drivers/scsi/lpfc/lpfc_crtn.h | 5 +++--
> drivers/scsi/lpfc/lpfc_scsi.c | 7 ++++---
> 2 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
> index 913844f01bf5..b1be0dd0337a 100644
> --- a/drivers/scsi/lpfc/lpfc_crtn.h
> +++ b/drivers/scsi/lpfc/lpfc_crtn.h
> @@ -671,8 +671,9 @@ int lpfc_vmid_cmd(struct lpfc_vport *vport,
> int lpfc_vmid_hash_fn(const char *vmid, int len);
> struct lpfc_vmid *lpfc_get_vmid_from_hashtable(struct lpfc_vport *vport,
> 					      uint32_t hash, uint8_t *buf);
> -int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid, struct
> -			       scsi_cmnd * cmd, union lpfc_vmid_io_tag *tag);
> +int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid,
> +			enum dma_data_direction iodir,
> +			union lpfc_vmid_io_tag *tag);
> void lpfc_vmid_vport_cleanup(struct lpfc_vport *vport);
> int lpfc_issue_els_qfpa(struct lpfc_vport *vport);
> 
> diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
> index 70d0a4d3d92e..f5f4409e24cd 100644
> --- a/drivers/scsi/lpfc/lpfc_scsi.c
> +++ b/drivers/scsi/lpfc/lpfc_scsi.c
> @@ -5446,9 +5446,10 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
> 		uuid = lpfc_is_command_vm_io(cmnd);
> 
> 		if (uuid) {
> -			err = lpfc_vmid_get_appid(vport, uuid, cmnd,
> -				(union lpfc_vmid_io_tag *)
> -					&cur_iocbq->vmid_tag);
> +			err = lpfc_vmid_get_appid(vport, uuid,
> +					cmnd->sc_data_direction,
> +					(union lpfc_vmid_io_tag *)
> +						&cur_iocbq->vmid_tag);
> 			if (!err)
> 				cur_iocbq->cmd_flag |= LPFC_IO_VMID;
> 		}
> -- 
> 2.26.2
> 

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

--
Himanshu Madhani	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
index 913844f01bf5..b1be0dd0337a 100644
--- a/drivers/scsi/lpfc/lpfc_crtn.h
+++ b/drivers/scsi/lpfc/lpfc_crtn.h
@@ -671,8 +671,9 @@  int lpfc_vmid_cmd(struct lpfc_vport *vport,
 int lpfc_vmid_hash_fn(const char *vmid, int len);
 struct lpfc_vmid *lpfc_get_vmid_from_hashtable(struct lpfc_vport *vport,
 					      uint32_t hash, uint8_t *buf);
-int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid, struct
-			       scsi_cmnd * cmd, union lpfc_vmid_io_tag *tag);
+int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid,
+			enum dma_data_direction iodir,
+			union lpfc_vmid_io_tag *tag);
 void lpfc_vmid_vport_cleanup(struct lpfc_vport *vport);
 int lpfc_issue_els_qfpa(struct lpfc_vport *vport);
 
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 70d0a4d3d92e..f5f4409e24cd 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -5446,9 +5446,10 @@  lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
 		uuid = lpfc_is_command_vm_io(cmnd);
 
 		if (uuid) {
-			err = lpfc_vmid_get_appid(vport, uuid, cmnd,
-				(union lpfc_vmid_io_tag *)
-					&cur_iocbq->vmid_tag);
+			err = lpfc_vmid_get_appid(vport, uuid,
+					cmnd->sc_data_direction,
+					(union lpfc_vmid_io_tag *)
+						&cur_iocbq->vmid_tag);
 			if (!err)
 				cur_iocbq->cmd_flag |= LPFC_IO_VMID;
 		}