All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anna Schumaker <Anna.Schumaker@netapp.com>
To: Sagi Grimberg <sagig@mellanox.com>, Doug Ledford <dledford@redhat.com>
Cc: Chuck Lever <chuck.lever@oracle.com>,
	<linux-rdma@vger.kernel.org>,
	linux-nfs <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH rdma-rc v2 1/4] xprtrdma: Replace global lkey with lkey local to PD
Date: Thu, 24 Sep 2015 08:57:51 -0400	[thread overview]
Message-ID: <5603F34F.3050505@Netapp.com> (raw)
In-Reply-To: <1443080064-28760-2-git-send-email-sagig@mellanox.com>

Hi Sagi,

On 09/24/2015 03:34 AM, Sagi Grimberg wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
> 
> The core API has changed so that devices that do not have a global
> DMA lkey automatically create an mr, per-PD, and make that lkey
> available. The global DMA lkey interface is going away in favor of
> the per-PD DMA lkey.
> 
> The per-PD DMA lkey is always available. Convert xprtrdma to use the
> device's per-PD DMA lkey for regbufs, no matter which memory
> registration scheme is in use.

This is going through an RDMA tree somewhere, correct?  You can add my:

Acked-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
> 
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> Cc: linux-nfs <linux-nfs@vger.kernel.org>
> ---
>  net/sunrpc/xprtrdma/fmr_ops.c      | 19 -------------------
>  net/sunrpc/xprtrdma/frwr_ops.c     |  5 -----
>  net/sunrpc/xprtrdma/physical_ops.c | 10 +---------
>  net/sunrpc/xprtrdma/verbs.c        |  2 +-
>  net/sunrpc/xprtrdma/xprt_rdma.h    |  1 -
>  5 files changed, 2 insertions(+), 35 deletions(-)
> 
> diff --git a/net/sunrpc/xprtrdma/fmr_ops.c b/net/sunrpc/xprtrdma/fmr_ops.c
> index cb25c89da623..f1e8dafbd507 100644
> --- a/net/sunrpc/xprtrdma/fmr_ops.c
> +++ b/net/sunrpc/xprtrdma/fmr_ops.c
> @@ -39,25 +39,6 @@ static int
>  fmr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
>  	    struct rpcrdma_create_data_internal *cdata)
>  {
> -	struct ib_device_attr *devattr = &ia->ri_devattr;
> -	struct ib_mr *mr;
> -
> -	/* Obtain an lkey to use for the regbufs, which are
> -	 * protected from remote access.
> -	 */
> -	if (devattr->device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY) {
> -		ia->ri_dma_lkey = ia->ri_device->local_dma_lkey;
> -	} else {
> -		mr = ib_get_dma_mr(ia->ri_pd, IB_ACCESS_LOCAL_WRITE);
> -		if (IS_ERR(mr)) {
> -			pr_err("%s: ib_get_dma_mr for failed with %lX\n",
> -			       __func__, PTR_ERR(mr));
> -			return -ENOMEM;
> -		}
> -		ia->ri_dma_lkey = ia->ri_dma_mr->lkey;
> -		ia->ri_dma_mr = mr;
> -	}
> -
>  	return 0;
>  }
>  
> diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
> index d6653f5d0830..5318951b3b53 100644
> --- a/net/sunrpc/xprtrdma/frwr_ops.c
> +++ b/net/sunrpc/xprtrdma/frwr_ops.c
> @@ -189,11 +189,6 @@ frwr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
>  	struct ib_device_attr *devattr = &ia->ri_devattr;
>  	int depth, delta;
>  
> -	/* Obtain an lkey to use for the regbufs, which are
> -	 * protected from remote access.
> -	 */
> -	ia->ri_dma_lkey = ia->ri_device->local_dma_lkey;
> -
>  	ia->ri_max_frmr_depth =
>  			min_t(unsigned int, RPCRDMA_MAX_DATA_SEGS,
>  			      devattr->max_fast_reg_page_list_len);
> diff --git a/net/sunrpc/xprtrdma/physical_ops.c b/net/sunrpc/xprtrdma/physical_ops.c
> index 72cf8b15bbb4..617b76f22154 100644
> --- a/net/sunrpc/xprtrdma/physical_ops.c
> +++ b/net/sunrpc/xprtrdma/physical_ops.c
> @@ -23,7 +23,6 @@ static int
>  physical_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
>  		 struct rpcrdma_create_data_internal *cdata)
>  {
> -	struct ib_device_attr *devattr = &ia->ri_devattr;
>  	struct ib_mr *mr;
>  
>  	/* Obtain an rkey to use for RPC data payloads.
> @@ -37,15 +36,8 @@ physical_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
>  		       __func__, PTR_ERR(mr));
>  		return -ENOMEM;
>  	}
> -	ia->ri_dma_mr = mr;
> -
> -	/* Obtain an lkey to use for regbufs.
> -	 */
> -	if (devattr->device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY)
> -		ia->ri_dma_lkey = ia->ri_device->local_dma_lkey;
> -	else
> -		ia->ri_dma_lkey = ia->ri_dma_mr->lkey;
>  
> +	ia->ri_dma_mr = mr;
>  	return 0;
>  }
>  
> diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
> index 682996779970..eb081ad05e33 100644
> --- a/net/sunrpc/xprtrdma/verbs.c
> +++ b/net/sunrpc/xprtrdma/verbs.c
> @@ -1252,7 +1252,7 @@ rpcrdma_alloc_regbuf(struct rpcrdma_ia *ia, size_t size, gfp_t flags)
>  		goto out_free;
>  
>  	iov->length = size;
> -	iov->lkey = ia->ri_dma_lkey;
> +	iov->lkey = ia->ri_pd->local_dma_lkey;
>  	rb->rg_size = size;
>  	rb->rg_owner = NULL;
>  	return rb;
> diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
> index d252457ff21a..df5ad4e15702 100644
> --- a/net/sunrpc/xprtrdma/xprt_rdma.h
> +++ b/net/sunrpc/xprtrdma/xprt_rdma.h
> @@ -66,7 +66,6 @@ struct rpcrdma_ia {
>  	struct rdma_cm_id 	*ri_id;
>  	struct ib_pd		*ri_pd;
>  	struct ib_mr		*ri_dma_mr;
> -	u32			ri_dma_lkey;
>  	struct completion	ri_done;
>  	int			ri_async_rc;
>  	unsigned int		ri_max_frmr_depth;
> 


WARNING: multiple messages have this Message-ID (diff)
From: Anna Schumaker <Anna.Schumaker-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
To: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nfs <linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH rdma-rc v2 1/4] xprtrdma: Replace global lkey with lkey local to PD
Date: Thu, 24 Sep 2015 08:57:51 -0400	[thread overview]
Message-ID: <5603F34F.3050505@Netapp.com> (raw)
In-Reply-To: <1443080064-28760-2-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Hi Sagi,

On 09/24/2015 03:34 AM, Sagi Grimberg wrote:
> From: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> 
> The core API has changed so that devices that do not have a global
> DMA lkey automatically create an mr, per-PD, and make that lkey
> available. The global DMA lkey interface is going away in favor of
> the per-PD DMA lkey.
> 
> The per-PD DMA lkey is always available. Convert xprtrdma to use the
> device's per-PD DMA lkey for regbufs, no matter which memory
> registration scheme is in use.

This is going through an RDMA tree somewhere, correct?  You can add my:

Acked-by: Anna Schumaker <Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
> 
> Signed-off-by: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Cc: linux-nfs <linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
> ---
>  net/sunrpc/xprtrdma/fmr_ops.c      | 19 -------------------
>  net/sunrpc/xprtrdma/frwr_ops.c     |  5 -----
>  net/sunrpc/xprtrdma/physical_ops.c | 10 +---------
>  net/sunrpc/xprtrdma/verbs.c        |  2 +-
>  net/sunrpc/xprtrdma/xprt_rdma.h    |  1 -
>  5 files changed, 2 insertions(+), 35 deletions(-)
> 
> diff --git a/net/sunrpc/xprtrdma/fmr_ops.c b/net/sunrpc/xprtrdma/fmr_ops.c
> index cb25c89da623..f1e8dafbd507 100644
> --- a/net/sunrpc/xprtrdma/fmr_ops.c
> +++ b/net/sunrpc/xprtrdma/fmr_ops.c
> @@ -39,25 +39,6 @@ static int
>  fmr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
>  	    struct rpcrdma_create_data_internal *cdata)
>  {
> -	struct ib_device_attr *devattr = &ia->ri_devattr;
> -	struct ib_mr *mr;
> -
> -	/* Obtain an lkey to use for the regbufs, which are
> -	 * protected from remote access.
> -	 */
> -	if (devattr->device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY) {
> -		ia->ri_dma_lkey = ia->ri_device->local_dma_lkey;
> -	} else {
> -		mr = ib_get_dma_mr(ia->ri_pd, IB_ACCESS_LOCAL_WRITE);
> -		if (IS_ERR(mr)) {
> -			pr_err("%s: ib_get_dma_mr for failed with %lX\n",
> -			       __func__, PTR_ERR(mr));
> -			return -ENOMEM;
> -		}
> -		ia->ri_dma_lkey = ia->ri_dma_mr->lkey;
> -		ia->ri_dma_mr = mr;
> -	}
> -
>  	return 0;
>  }
>  
> diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
> index d6653f5d0830..5318951b3b53 100644
> --- a/net/sunrpc/xprtrdma/frwr_ops.c
> +++ b/net/sunrpc/xprtrdma/frwr_ops.c
> @@ -189,11 +189,6 @@ frwr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
>  	struct ib_device_attr *devattr = &ia->ri_devattr;
>  	int depth, delta;
>  
> -	/* Obtain an lkey to use for the regbufs, which are
> -	 * protected from remote access.
> -	 */
> -	ia->ri_dma_lkey = ia->ri_device->local_dma_lkey;
> -
>  	ia->ri_max_frmr_depth =
>  			min_t(unsigned int, RPCRDMA_MAX_DATA_SEGS,
>  			      devattr->max_fast_reg_page_list_len);
> diff --git a/net/sunrpc/xprtrdma/physical_ops.c b/net/sunrpc/xprtrdma/physical_ops.c
> index 72cf8b15bbb4..617b76f22154 100644
> --- a/net/sunrpc/xprtrdma/physical_ops.c
> +++ b/net/sunrpc/xprtrdma/physical_ops.c
> @@ -23,7 +23,6 @@ static int
>  physical_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
>  		 struct rpcrdma_create_data_internal *cdata)
>  {
> -	struct ib_device_attr *devattr = &ia->ri_devattr;
>  	struct ib_mr *mr;
>  
>  	/* Obtain an rkey to use for RPC data payloads.
> @@ -37,15 +36,8 @@ physical_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
>  		       __func__, PTR_ERR(mr));
>  		return -ENOMEM;
>  	}
> -	ia->ri_dma_mr = mr;
> -
> -	/* Obtain an lkey to use for regbufs.
> -	 */
> -	if (devattr->device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY)
> -		ia->ri_dma_lkey = ia->ri_device->local_dma_lkey;
> -	else
> -		ia->ri_dma_lkey = ia->ri_dma_mr->lkey;
>  
> +	ia->ri_dma_mr = mr;
>  	return 0;
>  }
>  
> diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
> index 682996779970..eb081ad05e33 100644
> --- a/net/sunrpc/xprtrdma/verbs.c
> +++ b/net/sunrpc/xprtrdma/verbs.c
> @@ -1252,7 +1252,7 @@ rpcrdma_alloc_regbuf(struct rpcrdma_ia *ia, size_t size, gfp_t flags)
>  		goto out_free;
>  
>  	iov->length = size;
> -	iov->lkey = ia->ri_dma_lkey;
> +	iov->lkey = ia->ri_pd->local_dma_lkey;
>  	rb->rg_size = size;
>  	rb->rg_owner = NULL;
>  	return rb;
> diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
> index d252457ff21a..df5ad4e15702 100644
> --- a/net/sunrpc/xprtrdma/xprt_rdma.h
> +++ b/net/sunrpc/xprtrdma/xprt_rdma.h
> @@ -66,7 +66,6 @@ struct rpcrdma_ia {
>  	struct rdma_cm_id 	*ri_id;
>  	struct ib_pd		*ri_pd;
>  	struct ib_mr		*ri_dma_mr;
> -	u32			ri_dma_lkey;
>  	struct completion	ri_done;
>  	int			ri_async_rc;
>  	unsigned int		ri_max_frmr_depth;
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-09-24 12:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24  7:34 [PATCH rdma-rc v2 0/4] Remove mlx5 support for IB_DEVICE_LOCAL_DMA_LKEY Sagi Grimberg
2015-09-24  7:34 ` [PATCH rdma-rc v2 1/4] xprtrdma: Replace global lkey with lkey local to PD Sagi Grimberg
2015-09-24  7:34   ` Sagi Grimberg
2015-09-24 12:57   ` Anna Schumaker [this message]
2015-09-24 12:57     ` Anna Schumaker
2015-09-24 13:04     ` Sagi Grimberg
2015-09-24 13:04       ` Sagi Grimberg
     [not found] ` <1443080064-28760-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-09-24  7:34   ` [PATCH rdma-rc v2 2/4] IB/iser: Add module parameter for always register memory Sagi Grimberg
2015-09-24  7:34   ` [PATCH rdma-rc v2 3/4] IB/mlx5: Remove support for IB_DEVICE_LOCAL_DMA_LKEY Sagi Grimberg
2015-09-24  7:34   ` [PATCH rdma-rc v2 4/4] IB/mlx5: Remove pa_lkey usages Sagi Grimberg
2015-09-25 14:52   ` [PATCH rdma-rc v2 0/4] Remove mlx5 support for IB_DEVICE_LOCAL_DMA_LKEY Doug Ledford

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=5603F34F.3050505@Netapp.com \
    --to=anna.schumaker@netapp.com \
    --cc=chuck.lever@oracle.com \
    --cc=dledford@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sagig@mellanox.com \
    /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.