linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Muneendra <muneendra.kumar@broadcom.com>,
	linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
	tj@kernel.org, linux-nvme@lists.infradead.org
Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com,
	Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Subject: Re: [PATCH v8 05/16] lpfc: vmid: Supplementary data structures for vmid and APIs
Date: Thu, 4 Mar 2021 13:31:22 +0100	[thread overview]
Message-ID: <042ab0ef-d1f7-ed00-27ad-d0b39db29aff@suse.de> (raw)
In-Reply-To: <1614835646-16217-6-git-send-email-muneendra.kumar@broadcom.com>

On 3/4/21 6:27 AM, Muneendra wrote:
> From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
> 
> This patch adds additional data structures for supporting the two
> versions of vmid implementation. First type uses app header while
> the other types uses priority tagging mechanism. These data
> structures are used mostly for ELS andCT commands for the two
> vmid implementation.
> 
> The API determines 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>
> 
> ---
> v8:
> No Change
> 
> v7:
> No change
> 
> v6:
> No change
> 
> v5:
> Merged the patch5 of v4 to this patch
> Uniform data type naming scheme
> 
> v4:
> No change
> 
> v3:
> No change
> 
> v2:
> Ported the patch on top of 5.10/scsi-queue
> ---
>   drivers/scsi/lpfc/lpfc.h      |  24 +++++++
>   drivers/scsi/lpfc/lpfc_disc.h |   1 +
>   drivers/scsi/lpfc/lpfc_hw.h   | 124 ++++++++++++++++++++++++++++++++--
>   drivers/scsi/lpfc/lpfc_sli.h  |   8 +++
>   4 files changed, 153 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
> index dccebe3aae68..d794c3d00f70 100644
> --- a/drivers/scsi/lpfc/lpfc.h
> +++ b/drivers/scsi/lpfc/lpfc.h
> @@ -1515,3 +1515,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;
> +}
> diff --git a/drivers/scsi/lpfc/lpfc_disc.h b/drivers/scsi/lpfc/lpfc_disc.h
> index 8ce13ef3cac3..1d91609c3533 100644
> --- a/drivers/scsi/lpfc/lpfc_disc.h
> +++ b/drivers/scsi/lpfc/lpfc_disc.h
> @@ -124,6 +124,7 @@ struct lpfc_nodelist {
>   	uint8_t         nlp_fcp_info;	        /* class info, bits 0-3 */
>   #define NLP_FCP_2_DEVICE   0x10			/* FCP-2 device */
>   	u8		nlp_nvme_info;	        /* NVME NSLER Support */
> +	uint8_t		vmid_support;		/* destination VMID support */
>   #define NLP_NVME_NSLER     0x1			/* NVME NSLER device */
>   
>   	struct timer_list   nlp_delayfunc;	/* Used for delayed ELS cmds */
> diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
> index 42682d95af52..4a5a85ed42ec 100644
> --- a/drivers/scsi/lpfc/lpfc_hw.h
> +++ b/drivers/scsi/lpfc/lpfc_hw.h
> @@ -275,6 +275,7 @@ struct lpfc_sli_ct_request {
>   #define  SLI_CT_ACCESS_DENIED             0x10
>   #define  SLI_CT_INVALID_PORT_ID           0x11
>   #define  SLI_CT_DATABASE_EMPTY            0x12
> +#define  SLI_CT_APP_ID_NOT_AVAILABLE      0x40
>   
>   /*
>    * Name Server Command Codes
> @@ -400,16 +401,16 @@ struct csp {
>   	uint16_t altBbCredit:1;	/* FC Word 1, bit 27 */
>   	uint16_t edtovResolution:1;	/* FC Word 1, bit 26 */
>   	uint16_t multicast:1;	/* FC Word 1, bit 25 */
> -	uint16_t broadcast:1;	/* FC Word 1, bit 24 */
> +	uint16_t app_hdr_support:1;	/* FC Word 1, bit 24 */
>   
> -	uint16_t huntgroup:1;	/* FC Word 1, bit 23 */
> +	uint16_t priority_tagging:1;	/* FC Word 1, bit 23 */
>   	uint16_t simplex:1;	/* FC Word 1, bit 22 */
>   	uint16_t word1Reserved1:3;	/* FC Word 1, bit 21:19 */
>   	uint16_t dhd:1;		/* FC Word 1, bit 18 */
>   	uint16_t contIncSeqCnt:1;	/* FC Word 1, bit 17 */
>   	uint16_t payloadlength:1;	/* FC Word 1, bit 16 */
>   #else	/*  __LITTLE_ENDIAN_BITFIELD */
> -	uint16_t broadcast:1;	/* FC Word 1, bit 24 */
> +	uint16_t app_hdr_support:1;	/* FC Word 1, bit 24 */
>   	uint16_t multicast:1;	/* FC Word 1, bit 25 */
>   	uint16_t edtovResolution:1;	/* FC Word 1, bit 26 */
>   	uint16_t altBbCredit:1;	/* FC Word 1, bit 27 */
> @@ -423,7 +424,7 @@ struct csp {
>   	uint16_t dhd:1;		/* FC Word 1, bit 18 */
>   	uint16_t word1Reserved1:3;	/* FC Word 1, bit 21:19 */
>   	uint16_t simplex:1;	/* FC Word 1, bit 22 */
> -	uint16_t huntgroup:1;	/* FC Word 1, bit 23 */
> +	uint16_t priority_tagging:1;	/* FC Word 1, bit 23 */
>   #endif
>   
>   	uint8_t bbRcvSizeMsb;	/* Upper nibble is reserved */
> @@ -607,6 +608,8 @@ struct fc_vft_header {
>   #define ELS_CMD_LIRR      0x7A000000
>   #define ELS_CMD_LCB	  0x81000000
>   #define ELS_CMD_FPIN	  0x16000000
> +#define ELS_CMD_QFPA      0xB0000000
> +#define ELS_CMD_UVEM      0xB1000000
>   #else	/*  __LITTLE_ENDIAN_BITFIELD */
>   #define ELS_CMD_MASK      0xffff
>   #define ELS_RSP_MASK      0xff
> @@ -649,6 +652,8 @@ struct fc_vft_header {
>   #define ELS_CMD_LIRR      0x7A
>   #define ELS_CMD_LCB	  0x81
>   #define ELS_CMD_FPIN	  ELS_FPIN
> +#define ELS_CMD_QFPA      0xB0
> +#define ELS_CMD_UVEM      0xB1
>   #endif
>   
>   /*
> @@ -1317,6 +1322,117 @@ struct fc_rdp_res_frame {
>   };
>   
>   
> +/* UVEM */
> +
> +#define LPFC_UVEM_SIZE 60
> +#define LPFC_UVEM_VEM_ID_DESC_SIZE 16
> +#define LPFC_UVEM_VE_MAP_DESC_SIZE 20
> +
> +#define VEM_ID_DESC_TAG  0x0001000A
> +struct lpfc_vem_id_desc {
> +	uint32_t tag;
> +	uint32_t length;
> +	uint8_t vem_id[16];
> +};
> +
> +#define LPFC_QFPA_SIZE	4
> +
> +#define INSTANTIATED_VE_DESC_TAG  0x0001000B
> +struct instantiated_ve_desc {
> +	uint32_t tag;
> +	uint32_t length;
> +	uint8_t global_vem_id[16];
> +	uint32_t word6;
> +#define lpfc_instantiated_local_id_SHIFT   0
> +#define lpfc_instantiated_local_id_MASK    0x000000ff
> +#define lpfc_instantiated_local_id_WORD    word6
> +#define lpfc_instantiated_nport_id_SHIFT   8
> +#define lpfc_instantiated_nport_id_MASK    0x00ffffff
> +#define lpfc_instantiated_nport_id_WORD    word6
> +};
> +
> +#define DEINSTANTIATED_VE_DESC_TAG  0x0001000C
> +struct deinstantiated_ve_desc {
> +	uint32_t tag;
> +	uint32_t length;
> +	uint8_t global_vem_id[16];
> +	uint32_t word6;
> +#define lpfc_deinstantiated_nport_id_SHIFT   0
> +#define lpfc_deinstantiated_nport_id_MASK    0x000000ff
> +#define lpfc_deinstantiated_nport_id_WORD    word6
> +#define lpfc_deinstantiated_local_id_SHIFT   24
> +#define lpfc_deinstantiated_local_id_MASK    0x00ffffff
> +#define lpfc_deinstantiated_local_id_WORD    word6
> +};
> +
> +/* Query Fabric Priority Allocation Response */
> +#define LPFC_PRIORITY_RANGE_DESC_SIZE 12
> +
> +struct priority_range_desc {
> +	uint32_t tag;
> +	uint32_t length;
> +	uint8_t lo_range;
> +	uint8_t hi_range;
> +	uint8_t qos_priority;
> +	uint8_t local_ve_id;
> +};
> +
> +struct fc_qfpa_res {
> +	uint32_t reply_sequence;	/* LS_ACC or LS_RJT */
> +	uint32_t length;	/* FC Word 1    */
> +	struct priority_range_desc desc[1];
> +};
> +
> +/* Application Server command code */
> +/* VMID               */
> +
> +#define SLI_CT_APP_SEV_Subtypes     0x20	/* Application Server subtype */
> +
> +#define SLI_CTAS_GAPPIA_ENT    0x0100	/* Get Application Identifier */
> +#define SLI_CTAS_GALLAPPIA     0x0101	/* Get All Application Identifier */
> +#define SLI_CTAS_GALLAPPIA_ID  0x0102	/* Get All Application Identifier */
> +					/* for Nport */
> +#define SLI_CTAS_GAPPIA_IDAPP  0x0103	/* Get Application Identifier */
> +					/* for Nport */
> +#define SLI_CTAS_RAPP_IDENT    0x0200	/* Register Application Identifier */
> +#define SLI_CTAS_DAPP_IDENT    0x0300	/* Deregister Application */
> +					/* Identifier */
> +#define SLI_CTAS_DALLAPP_ID    0x0301	/* Deregister All Application */
> +					/* Identifier */
> +
> +struct entity_id_object {
> +	uint8_t entity_id_len;
> +	uint8_t entity_id[255];	/* VM UUID */
> +};
> +
> +struct app_id_object {
> +	uint32_t port_id;
> +	uint32_t app_id;
> +	struct entity_id_object obj;
> +};
> +
> +struct lpfc_vmid_rapp_ident_list {
> +	uint32_t no_of_objects;
> +	struct entity_id_object obj[1];
> +};
> +
> +struct lpfc_vmid_dapp_ident_list {
> +	uint32_t no_of_objects;
> +	struct entity_id_object obj[1];
> +};
> +
> +#define GALLAPPIA_ID_LAST  0x80
> +struct lpfc_vmid_gallapp_ident_list {
> +	uint8_t control;
> +	uint8_t reserved[3];
> +	struct app_id_object app_id;
> +};
> +
> +#define RAPP_IDENT_OFFSET  (offsetof(struct lpfc_sli_ct_request, un) + 4)
> +#define DAPP_IDENT_OFFSET  (offsetof(struct lpfc_sli_ct_request, un) + 4)
> +#define GALLAPPIA_ID_SIZE  (offsetof(struct lpfc_sli_ct_request, un) + 4)
> +#define DALLAPP_ID_SIZE    (offsetof(struct lpfc_sli_ct_request, un) + 4)
> +
>   /******** FDMI ********/
>   
>   /* lpfc_sli_ct_request defines the CT_IU preamble for FDMI commands */
> diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h
> index 4f6936014ff5..ff5a2a492405 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.h
> +++ b/drivers/scsi/lpfc/lpfc_sli.h
> @@ -35,6 +35,12 @@ typedef enum _lpfc_ctx_cmd {
>   	LPFC_CTX_HOST
>   } lpfc_ctx_cmd;
>   
> +union lpfc_vmid_iocb_tag {
> +	uint32_t app_id;
> +	uint8_t cs_ctl_vmid;
> +	struct lpfc_vmid_context *vmid_context;	/* UVEM context information */
> +};
> +
>   struct lpfc_cq_event {
>   	struct list_head list;
>   	uint16_t hdwq;
> @@ -100,6 +106,7 @@ struct lpfc_iocbq {
>   #define LPFC_IO_NVME	        0x200000 /* NVME FCP command */
>   #define LPFC_IO_NVME_LS		0x400000 /* NVME LS command */
>   #define LPFC_IO_NVMET		0x800000 /* NVMET command */
> +#define LPFC_IO_VMID            0x1000000 /* VMID tagged IO */
>   
>   	uint32_t drvrTimeout;	/* driver timeout in seconds */
>   	struct lpfc_vport *vport;/* virtual port pointer */
> @@ -114,6 +121,7 @@ struct lpfc_iocbq {
>   		struct lpfc_node_rrq *rrq;
>   	} context_un;
>   
> +	union lpfc_vmid_iocb_tag vmid_tag;
>   	void (*fabric_iocb_cmpl)(struct lpfc_hba *, struct lpfc_iocbq *,
>   			   struct lpfc_iocbq *);
>   	void (*wait_iocb_cmpl)(struct lpfc_hba *, struct lpfc_iocbq *,
> 
Could be merged with previous patch, but that's a minor nit.

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

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

  reply	other threads:[~2021-03-04 12:32 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04  5:27 [PATCH v8 00/16] blkcg:Support to track FC storage blk io traffic Muneendra
2021-03-04  5:27 ` [PATCH v8 01/16] cgroup: Added cgroup_get_from_id Muneendra
2021-03-04 12:25   ` Hannes Reinecke
2021-03-04 16:26   ` kernel test robot
2021-03-04  5:27 ` [PATCH v8 02/16] blkcg: Added a app identifier support for blkcg Muneendra
2021-03-04 12:25   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 03/16] nvme: Added a newsysfs attribute appid_store Muneendra
2021-03-04 12:27   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 04/16] lpfc: vmid: Add the datastructure for supporting VMID in lpfc Muneendra
2021-03-04 12:29   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 05/16] lpfc: vmid: Supplementary data structures for vmid and APIs Muneendra
2021-03-04 12:31   ` Hannes Reinecke [this message]
2021-03-04  5:27 ` [PATCH v8 06/16] lpfc: vmid: Forward declarations for APIs Muneendra
2021-03-04 12:32   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 07/16] lpfc: vmid: VMID params initialization Muneendra
2021-03-04 12:33   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 08/16] lpfc: vmid: Add support for vmid in mailbox command, does vmid resource allocation and vmid cleanup Muneendra
2021-03-04 12:34   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 09/16] lpfc: vmid: Implements ELS commands for appid patch Muneendra
2021-03-04 12:36   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 10/16] lpfc: vmid: Functions to manage vmids Muneendra
2021-03-04 12:41   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 11/16] lpfc: vmid: Implements CT commands for appid Muneendra
2021-03-04 12:42   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 12/16] lpfc: vmid: Appends the vmid in the wqe before sending Muneendra
2021-03-04 12:43   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 13/16] lpfc: vmid: Timeout implementation for vmid Muneendra
2021-03-04 12:46   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread Muneendra
2021-03-04 12:47   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 15/16] lpfc: vmid: Introducing vmid in io path Muneendra
2021-03-04 12:52   ` Hannes Reinecke
2021-03-04  5:27 ` [PATCH v8 16/16] scsi: Made changes in Kconfig to select BLK_CGROUP_FC_APPID Muneendra
2021-03-04 12:53   ` Hannes Reinecke
2021-03-11 15:33 ` [PATCH v8 00/16] blkcg:Support to track FC storage blk io traffic Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=042ab0ef-d1f7-ed00-27ad-d0b39db29aff@suse.de \
    --to=hare@suse.de \
    --cc=emilne@redhat.com \
    --cc=gaurav.srivastava@broadcom.com \
    --cc=jsmart2021@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mkumar@redhat.com \
    --cc=muneendra.kumar@broadcom.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).