Re: [PATCH rdma-core 07/13] verbs: Introduce ibv_import/unimport_pd() verbs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 17, 2020 at 10:45:50AM +0300, Yishai Hadas wrote:
> Introduce ibv_import/unimport_pd() verbs, this enables an application
> who previously imported a device to import a PD from that context and
> use this shared object for its needs.
> 
> A detailed man page as part of this patch describes the expected usage
> and flow.
> 
> Signed-off-by: Yishai Hadas <yishaih@xxxxxxxxxxxx>
>  debian/libibverbs1.symbols        |  2 ++
>  libibverbs/driver.h               |  3 +++
>  libibverbs/dummy_ops.c            | 15 +++++++++++
>  libibverbs/libibverbs.map.in      |  2 ++
>  libibverbs/man/CMakeLists.txt     |  2 ++
>  libibverbs/man/ibv_import_pd.3.md | 57 +++++++++++++++++++++++++++++++++++++++
>  libibverbs/verbs.c                | 14 ++++++++++
>  libibverbs/verbs.h                | 11 ++++++++
>  8 files changed, 106 insertions(+)
>  create mode 100644 libibverbs/man/ibv_import_pd.3.md
> 
> diff --git a/debian/libibverbs1.symbols b/debian/libibverbs1.symbols
> index e636c1d..ee32bf4 100644
> +++ b/debian/libibverbs1.symbols
> @@ -68,6 +68,7 @@ libibverbs.so.1 libibverbs1 #MINVER#
>   ibv_get_pkey_index@IBVERBS_1.5 20
>   ibv_get_sysfs_path@IBVERBS_1.0 1.1.6
>   ibv_import_device@IBVERBS_1.10 31
> + ibv_import_pd@IBVERBS_1.10 31
>   ibv_init_ah_from_wc@IBVERBS_1.1 1.1.6
>   ibv_modify_qp@IBVERBS_1.0 1.1.6
>   ibv_modify_qp@IBVERBS_1.1 1.1.6
> @@ -102,6 +103,7 @@ libibverbs.so.1 libibverbs1 #MINVER#
>   ibv_resize_cq@IBVERBS_1.0 1.1.6
>   ibv_resize_cq@IBVERBS_1.1 1.1.6
>   ibv_resolve_eth_l2_from_gid@IBVERBS_1.1 1.2.0
> + ibv_unimport_pd@IBVERBS_1.10 31
>   ibv_wc_status_str@IBVERBS_1.1 1.1.6
>   mbps_to_ibv_rate@IBVERBS_1.1 1.1.8
>   mult_to_ibv_rate@IBVERBS_1.0 1.1.6
> diff --git a/libibverbs/driver.h b/libibverbs/driver.h
> index 1883df3..fbf63f3 100644
> +++ b/libibverbs/driver.h
> @@ -311,6 +311,8 @@ struct verbs_context_ops {
>  	void (*free_context)(struct ibv_context *context);
>  	int (*free_dm)(struct ibv_dm *dm);
>  	int (*get_srq_num)(struct ibv_srq *srq, uint32_t *srq_num);
> +	struct ibv_pd *(*import_pd)(struct ibv_context *context,
> +				    uint32_t pd_handle);
>  	int (*modify_cq)(struct ibv_cq *cq, struct ibv_modify_cq_attr *attr);
>  	int (*modify_flow_action_esp)(struct ibv_flow_action *action,
>  				      struct ibv_flow_action_esp_attr *attr);
> @@ -361,6 +363,7 @@ struct verbs_context_ops {
>  	int (*rereg_mr)(struct verbs_mr *vmr, int flags, struct ibv_pd *pd,
>  			void *addr, size_t length, int access);
>  	int (*resize_cq)(struct ibv_cq *cq, int cqe);
> +	void (*unimport_pd)(struct ibv_pd *pd);
>  };
>  
>  static inline struct verbs_device *
> diff --git a/libibverbs/dummy_ops.c b/libibverbs/dummy_ops.c
> index 32fec71..9d6d2af 100644
> +++ b/libibverbs/dummy_ops.c
> @@ -287,6 +287,13 @@ static int get_srq_num(struct ibv_srq *srq, uint32_t *srq_num)
>  	return EOPNOTSUPP;
>  }
>  
> +static  struct ibv_pd *import_pd(struct ibv_context *context,
> +				 uint32_t pd_handle)

Extra space after static

> +
> +# DESCRIPTION
> +
> +**ibv_import_pd()** returns a protection domain (PD) that is associated with the given
> +*pd_handle* in the given *context*.

Explain how to get pd_handle in the first place, same comment for all
of these man pages

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux