All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Jianxin Xiong <jianxin.xiong@intel.com>
Cc: <linux-rdma@vger.kernel.org>, <dri-devel@lists.freedesktop.org>,
	"Doug Ledford" <dledford@redhat.com>,
	Leon Romanovsky <leon@kernel.org>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	Christian Koenig <christian.koenig@amd.com>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH v5 3/5] RDMA/uverbs: Add uverbs command for dma-buf based MR registration
Date: Fri, 16 Oct 2020 21:17:51 -0300	[thread overview]
Message-ID: <20201017001751.GA334582@nvidia.com> (raw)
In-Reply-To: <1602799375-138277-1-git-send-email-jianxin.xiong@intel.com>

On Thu, Oct 15, 2020 at 03:02:55PM -0700, Jianxin Xiong wrote:
> Implement a new uverbs ioctl method for memory registration with file
> descriptor as an extra parameter.
> 
> Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
> Reviewed-by: Sean Hefty <sean.hefty@intel.com>
> Acked-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
> Acked-by: Christian Koenig <christian.koenig@amd.com>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>  drivers/infiniband/core/uverbs_std_types_mr.c | 112 ++++++++++++++++++++++++++
>  include/uapi/rdma/ib_user_ioctl_cmds.h        |  14 ++++
>  2 files changed, 126 insertions(+)
> 
> diff --git a/drivers/infiniband/core/uverbs_std_types_mr.c b/drivers/infiniband/core/uverbs_std_types_mr.c
> index 9b22bb5..e54459f 100644
> +++ b/drivers/infiniband/core/uverbs_std_types_mr.c
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2018, Mellanox Technologies inc.  All rights reserved.
> + * Copyright (c) 2020, Intel Corporation.  All rights reserved.
>   *
>   * This software is available to you under a choice of one of two
>   * licenses.  You may choose to be licensed under the terms of the GNU
> @@ -178,6 +179,85 @@ static int UVERBS_HANDLER(UVERBS_METHOD_QUERY_MR)(
>  	return IS_UVERBS_COPY_ERR(ret) ? ret : 0;
>  }
>  
> +static int UVERBS_HANDLER(UVERBS_METHOD_REG_DMABUF_MR)(
> +	struct uverbs_attr_bundle *attrs)
> +{
> +	struct ib_uobject *uobj =
> +		uverbs_attr_get_uobject(attrs, UVERBS_ATTR_REG_DMABUF_MR_HANDLE);
> +	struct ib_pd *pd =
> +		uverbs_attr_get_obj(attrs, UVERBS_ATTR_REG_DMABUF_MR_PD_HANDLE);
> +	struct ib_device *ib_dev = pd->device;
> +
> +	u64 start, length, virt_addr;
> +	u32 fd, access_flags;
> +	struct ib_mr *mr;
> +	int ret;
> +
> +	if (!ib_dev->ops.reg_user_mr_dmabuf)
> +		return -EOPNOTSUPP;
> +
> +	ret = uverbs_copy_from(&start, attrs,
> +			       UVERBS_ATTR_REG_DMABUF_MR_ADDR);

This should be called OFFSET uniformly here and in all the call chain
below. Not start and not addr.

> +	if (ret)
> +		return ret;
> +
> +	ret = uverbs_copy_from(&length, attrs,
> +			       UVERBS_ATTR_REG_DMABUF_MR_LENGTH);
> +	if (ret)
> +		return ret;
> +
> +	ret = uverbs_copy_from(&virt_addr, attrs,
> +			       UVERBS_ATTR_REG_DMABUF_MR_HCA_VA);

I've been trying to call this IOVA

Jason

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: Jianxin Xiong <jianxin.xiong@intel.com>
Cc: Leon Romanovsky <leon@kernel.org>,
	linux-rdma@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Doug Ledford <dledford@redhat.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Christian Koenig <christian.koenig@amd.com>
Subject: Re: [PATCH v5 3/5] RDMA/uverbs: Add uverbs command for dma-buf based MR registration
Date: Fri, 16 Oct 2020 21:17:51 -0300	[thread overview]
Message-ID: <20201017001751.GA334582@nvidia.com> (raw)
In-Reply-To: <1602799375-138277-1-git-send-email-jianxin.xiong@intel.com>

On Thu, Oct 15, 2020 at 03:02:55PM -0700, Jianxin Xiong wrote:
> Implement a new uverbs ioctl method for memory registration with file
> descriptor as an extra parameter.
> 
> Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
> Reviewed-by: Sean Hefty <sean.hefty@intel.com>
> Acked-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
> Acked-by: Christian Koenig <christian.koenig@amd.com>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>  drivers/infiniband/core/uverbs_std_types_mr.c | 112 ++++++++++++++++++++++++++
>  include/uapi/rdma/ib_user_ioctl_cmds.h        |  14 ++++
>  2 files changed, 126 insertions(+)
> 
> diff --git a/drivers/infiniband/core/uverbs_std_types_mr.c b/drivers/infiniband/core/uverbs_std_types_mr.c
> index 9b22bb5..e54459f 100644
> +++ b/drivers/infiniband/core/uverbs_std_types_mr.c
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2018, Mellanox Technologies inc.  All rights reserved.
> + * Copyright (c) 2020, Intel Corporation.  All rights reserved.
>   *
>   * This software is available to you under a choice of one of two
>   * licenses.  You may choose to be licensed under the terms of the GNU
> @@ -178,6 +179,85 @@ static int UVERBS_HANDLER(UVERBS_METHOD_QUERY_MR)(
>  	return IS_UVERBS_COPY_ERR(ret) ? ret : 0;
>  }
>  
> +static int UVERBS_HANDLER(UVERBS_METHOD_REG_DMABUF_MR)(
> +	struct uverbs_attr_bundle *attrs)
> +{
> +	struct ib_uobject *uobj =
> +		uverbs_attr_get_uobject(attrs, UVERBS_ATTR_REG_DMABUF_MR_HANDLE);
> +	struct ib_pd *pd =
> +		uverbs_attr_get_obj(attrs, UVERBS_ATTR_REG_DMABUF_MR_PD_HANDLE);
> +	struct ib_device *ib_dev = pd->device;
> +
> +	u64 start, length, virt_addr;
> +	u32 fd, access_flags;
> +	struct ib_mr *mr;
> +	int ret;
> +
> +	if (!ib_dev->ops.reg_user_mr_dmabuf)
> +		return -EOPNOTSUPP;
> +
> +	ret = uverbs_copy_from(&start, attrs,
> +			       UVERBS_ATTR_REG_DMABUF_MR_ADDR);

This should be called OFFSET uniformly here and in all the call chain
below. Not start and not addr.

> +	if (ret)
> +		return ret;
> +
> +	ret = uverbs_copy_from(&length, attrs,
> +			       UVERBS_ATTR_REG_DMABUF_MR_LENGTH);
> +	if (ret)
> +		return ret;
> +
> +	ret = uverbs_copy_from(&virt_addr, attrs,
> +			       UVERBS_ATTR_REG_DMABUF_MR_HCA_VA);

I've been trying to call this IOVA

Jason
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-10-17  5:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 22:02 [PATCH v5 3/5] RDMA/uverbs: Add uverbs command for dma-buf based MR registration Jianxin Xiong
2020-10-15 22:02 ` Jianxin Xiong
2020-10-17  0:17 ` Jason Gunthorpe [this message]
2020-10-17  0:17   ` Jason Gunthorpe
2020-10-17  0:59   ` Xiong, Jianxin
2020-10-17  0:59     ` Xiong, Jianxin

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=20201017001751.GA334582@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@intel.com \
    --cc=dledford@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jianxin.xiong@intel.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sumit.semwal@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.