diff mbox series

[v4,05/19] lpfc: vmid: API to check if VMID is enabled.

Message ID 1604895845-2587-6-git-send-email-muneendra.kumar@broadcom.com (mailing list archive)
State New, archived
Headers show
Series blkcg:Support to track FC storage blk io traffic | expand

Commit Message

Muneendra Kumar M Nov. 9, 2020, 4:23 a.m. UTC
From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This API will determine if VMID is enabled by the user or not.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Hannes Reinecke Nov. 16, 2020, 7:44 a.m. UTC | #1
On 11/9/20 5:23 AM, Muneendra wrote:
> From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
> 
> This API will determine if VMID is enabled by the user or not.
> 
> Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> 
> ---
> v4:
> No change
> 
> v3:
> No change
> 
> v2:
> Ported the patch on top of 5.10/scsi-queue
> ---
>   drivers/scsi/lpfc/lpfc.h | 24 ++++++++++++++++++++++++
>   1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
> index 8f0062d2b891..a62e985aa180 100644
> --- a/drivers/scsi/lpfc/lpfc.h
> +++ b/drivers/scsi/lpfc/lpfc.h
> @@ -1506,3 +1506,27 @@ static const char *routine(enum enum_name table_key)			\
>   	}								\
>   	return name;							\
>   }
> +
> +/**
> + * lpfc_is_vmid_enabled - returns if VMID is enabled for either switch types
> + * @phba: Pointer to HBA context object.
> + *
> + * Relationship between the enable, target support and if vmid tag is required
> + * for the particular combination
> + * ---------------------------------------------------
> + * Switch    Enable Flag  Target Support  VMID Needed
> + * ---------------------------------------------------
> + * App Id     0              NA              N
> + * App Id     1               0              N
> + * App Id     1               1              Y
> + * Pr Tag     0              NA              N
> + * Pr Tag     1               0              N
> + * Pr Tag     1               1              Y
> + * Pr Tag     2               *              Y
> + ---------------------------------------------------
> + *
> + **/
> +static inline int lpfc_is_vmid_enabled(struct lpfc_hba *phba)
> +{
> +	return phba->cfg_vmid_app_header || phba->cfg_vmid_priority_tagging;
> +}
> 
Feels a bit weird, having this patch on its own; maybe merge it with the 
next one?
But I'm not bothered either way.

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index 8f0062d2b891..a62e985aa180 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -1506,3 +1506,27 @@  static const char *routine(enum enum_name table_key)			\
 	}								\
 	return name;							\
 }
+
+/**
+ * lpfc_is_vmid_enabled - returns if VMID is enabled for either switch types
+ * @phba: Pointer to HBA context object.
+ *
+ * Relationship between the enable, target support and if vmid tag is required
+ * for the particular combination
+ * ---------------------------------------------------
+ * Switch    Enable Flag  Target Support  VMID Needed
+ * ---------------------------------------------------
+ * App Id     0              NA              N
+ * App Id     1               0              N
+ * App Id     1               1              Y
+ * Pr Tag     0              NA              N
+ * Pr Tag     1               0              N
+ * Pr Tag     1               1              Y
+ * Pr Tag     2               *              Y
+ ---------------------------------------------------
+ *
+ **/
+static inline int lpfc_is_vmid_enabled(struct lpfc_hba *phba)
+{
+	return phba->cfg_vmid_app_header || phba->cfg_vmid_priority_tagging;
+}