diff mbox series

[v7,10/12] net: mana: Define data structures for allocating doorbell page from GDMA

Message ID 1666034441-15424-11-git-send-email-longli@linuxonhyperv.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Introduce Microsoft Azure Network Adapter (MANA) RDMA driver | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 46 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Long Li Oct. 17, 2022, 7:20 p.m. UTC
From: Long Li <longli@microsoft.com>

The RDMA device needs to allocate doorbell pages for each user context.
Define the GDMA data structures for use by the RDMA driver.

Reviewed-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Haiyang Zhang <haiyangz@microsoft.com>
---
Change log:
v4: use EXPORT_SYMBOL_NS
v7: move mana_gd_allocate_doorbell_page() and mana_gd_destroy_doorbell_page() to the RDMA driver

 include/net/mana/gdma.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

Comments

Yunsheng Lin Oct. 19, 2022, 12:32 a.m. UTC | #1
On 2022/10/18 3:20, longli@linuxonhyperv.com wrote:
> From: Long Li <longli@microsoft.com>
> 
> The RDMA device needs to allocate doorbell pages for each user context.
> Define the GDMA data structures for use by the RDMA driver.
> 
> Reviewed-by: Dexuan Cui <decui@microsoft.com>
> Signed-off-by: Long Li <longli@microsoft.com>
> Acked-by: Haiyang Zhang <haiyangz@microsoft.com>
> ---
> Change log:
> v4: use EXPORT_SYMBOL_NS
> v7: move mana_gd_allocate_doorbell_page() and mana_gd_destroy_doorbell_page() to the RDMA driver
> 
>  include/net/mana/gdma.h | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h
> index a9b7930dfbf8..bc060b6fa54c 100644
> --- a/include/net/mana/gdma.h
> +++ b/include/net/mana/gdma.h
> @@ -24,11 +24,15 @@ enum gdma_request_type {
>  	GDMA_GENERATE_TEST_EQE		= 10,
>  	GDMA_CREATE_QUEUE		= 12,
>  	GDMA_DISABLE_QUEUE		= 13,
> +	GDMA_ALLOCATE_RESOURCE_RANGE	= 22,
> +	GDMA_DESTROY_RESOURCE_RANGE	= 24,
>  	GDMA_CREATE_DMA_REGION		= 25,
>  	GDMA_DMA_REGION_ADD_PAGES	= 26,
>  	GDMA_DESTROY_DMA_REGION		= 27,
>  };
>  
> +#define GDMA_RESOURCE_DOORBELL_PAGE	27
> +
>  enum gdma_queue_type {
>  	GDMA_INVALID_QUEUE,
>  	GDMA_SQ,
> @@ -587,6 +591,26 @@ struct gdma_register_device_resp {
>  	u32 db_id;
>  }; /* HW DATA */
>  
> +struct gdma_allocate_resource_range_req {
> +	struct gdma_req_hdr hdr;
> +	u32 resource_type;
> +	u32 num_resources;
> +	u32 alignment;
> +	u32 allocated_resources;
> +};
> +
> +struct gdma_allocate_resource_range_resp {
> +	struct gdma_resp_hdr hdr;
> +	u32 allocated_resources;
> +};
> +
> +struct gdma_destroy_resource_range_req {
> +	struct gdma_req_hdr hdr;
> +	u32 resource_type;
> +	u32 num_resources;
> +	u32 allocated_resources;
> +};
> +
>  /* GDMA_CREATE_QUEUE */
>  struct gdma_create_queue_req {
>  	struct gdma_req_hdr hdr;
> @@ -695,4 +719,5 @@ void mana_gd_free_memory(struct gdma_mem_info *gmi);
>  
>  int mana_gd_send_request(struct gdma_context *gc, u32 req_len, const void *req,
>  			 u32 resp_len, void *resp);
> +

Unrelated change.

>  #endif /* _GDMA_H */
>
Long Li Oct. 19, 2022, 6:16 p.m. UTC | #2
> Subject: Re: [Patch v7 10/12] net: mana: Define data structures for allocating
> doorbell page from GDMA
> 
> On 2022/10/18 3:20, longli@linuxonhyperv.com wrote:
> > From: Long Li <longli@microsoft.com>
> >
> > The RDMA device needs to allocate doorbell pages for each user context.
> > Define the GDMA data structures for use by the RDMA driver.
> >
> > Reviewed-by: Dexuan Cui <decui@microsoft.com>
> > Signed-off-by: Long Li <longli@microsoft.com>
> > Acked-by: Haiyang Zhang <haiyangz@microsoft.com>
> > ---
> > Change log:
> > v4: use EXPORT_SYMBOL_NS
> > v7: move mana_gd_allocate_doorbell_page() and
> > mana_gd_destroy_doorbell_page() to the RDMA driver
> >
> >  include/net/mana/gdma.h | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >
> > diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h index
> > a9b7930dfbf8..bc060b6fa54c 100644
> > --- a/include/net/mana/gdma.h
> > +++ b/include/net/mana/gdma.h
> > @@ -24,11 +24,15 @@ enum gdma_request_type {
> >  	GDMA_GENERATE_TEST_EQE		= 10,
> >  	GDMA_CREATE_QUEUE		= 12,
> >  	GDMA_DISABLE_QUEUE		= 13,
> > +	GDMA_ALLOCATE_RESOURCE_RANGE	= 22,
> > +	GDMA_DESTROY_RESOURCE_RANGE	= 24,
> >  	GDMA_CREATE_DMA_REGION		= 25,
> >  	GDMA_DMA_REGION_ADD_PAGES	= 26,
> >  	GDMA_DESTROY_DMA_REGION		= 27,
> >  };
> >
> > +#define GDMA_RESOURCE_DOORBELL_PAGE	27
> > +
> >  enum gdma_queue_type {
> >  	GDMA_INVALID_QUEUE,
> >  	GDMA_SQ,
> > @@ -587,6 +591,26 @@ struct gdma_register_device_resp {
> >  	u32 db_id;
> >  }; /* HW DATA */
> >
> > +struct gdma_allocate_resource_range_req {
> > +	struct gdma_req_hdr hdr;
> > +	u32 resource_type;
> > +	u32 num_resources;
> > +	u32 alignment;
> > +	u32 allocated_resources;
> > +};
> > +
> > +struct gdma_allocate_resource_range_resp {
> > +	struct gdma_resp_hdr hdr;
> > +	u32 allocated_resources;
> > +};
> > +
> > +struct gdma_destroy_resource_range_req {
> > +	struct gdma_req_hdr hdr;
> > +	u32 resource_type;
> > +	u32 num_resources;
> > +	u32 allocated_resources;
> > +};
> > +
> >  /* GDMA_CREATE_QUEUE */
> >  struct gdma_create_queue_req {
> >  	struct gdma_req_hdr hdr;
> > @@ -695,4 +719,5 @@ void mana_gd_free_memory(struct
> gdma_mem_info
> > *gmi);
> >
> >  int mana_gd_send_request(struct gdma_context *gc, u32 req_len, const
> void *req,
> >  			 u32 resp_len, void *resp);
> > +
> 
> Unrelated change.

Will remove this.

> 
> >  #endif /* _GDMA_H */
> >
diff mbox series

Patch

diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h
index a9b7930dfbf8..bc060b6fa54c 100644
--- a/include/net/mana/gdma.h
+++ b/include/net/mana/gdma.h
@@ -24,11 +24,15 @@  enum gdma_request_type {
 	GDMA_GENERATE_TEST_EQE		= 10,
 	GDMA_CREATE_QUEUE		= 12,
 	GDMA_DISABLE_QUEUE		= 13,
+	GDMA_ALLOCATE_RESOURCE_RANGE	= 22,
+	GDMA_DESTROY_RESOURCE_RANGE	= 24,
 	GDMA_CREATE_DMA_REGION		= 25,
 	GDMA_DMA_REGION_ADD_PAGES	= 26,
 	GDMA_DESTROY_DMA_REGION		= 27,
 };
 
+#define GDMA_RESOURCE_DOORBELL_PAGE	27
+
 enum gdma_queue_type {
 	GDMA_INVALID_QUEUE,
 	GDMA_SQ,
@@ -587,6 +591,26 @@  struct gdma_register_device_resp {
 	u32 db_id;
 }; /* HW DATA */
 
+struct gdma_allocate_resource_range_req {
+	struct gdma_req_hdr hdr;
+	u32 resource_type;
+	u32 num_resources;
+	u32 alignment;
+	u32 allocated_resources;
+};
+
+struct gdma_allocate_resource_range_resp {
+	struct gdma_resp_hdr hdr;
+	u32 allocated_resources;
+};
+
+struct gdma_destroy_resource_range_req {
+	struct gdma_req_hdr hdr;
+	u32 resource_type;
+	u32 num_resources;
+	u32 allocated_resources;
+};
+
 /* GDMA_CREATE_QUEUE */
 struct gdma_create_queue_req {
 	struct gdma_req_hdr hdr;
@@ -695,4 +719,5 @@  void mana_gd_free_memory(struct gdma_mem_info *gmi);
 
 int mana_gd_send_request(struct gdma_context *gc, u32 req_len, const void *req,
 			 u32 resp_len, void *resp);
+
 #endif /* _GDMA_H */