Re: [PATCH v1 10/24] IB/mlx4: Add implementation of clone_pd callback

Jason Gunthorpe
2019-08-21T15:00:03Z

On Wed, Aug 21, 2019 at 05:21:11PM +0300, Yuval Shaia wrote:
> From: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
>
> Copy mlx4 ib_pd to user-space.
>
> Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
> Signed-off-by: Shamir Rabinovitch <srabinov7@gmail.com>
> drivers/infiniband/hw/mlx4/main.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
> index 8d2f1e38b891..6baf52d988ed 100644
> +++ b/drivers/infiniband/hw/mlx4/main.c
> @@ -1179,6 +1179,13 @@ static int mlx4_ib_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
> }
> }
>
> +static int mlx4_ib_clone_pd(struct ib_udata *udata, struct ib_pd *ibpd)
> +{
> + struct mlx4_ib_pd *pd = to_mpd(ibpd);
> +
> + return udata ? ib_copy_to_udata(udata, &pd->pdn, sizeof(__u32)) : 0;
> +}

And here it is, clone is just query.

Jason