All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steve Wise" <swise@opengridcomputing.com>
To: 'Sagi Grimberg' <sagig@mellanox.com>,
	linux-rdma@vger.kernel.org, target-devel@vger.kernel.org
Cc: "'Nicholas A. Bellinger'" <nab@linux-iscsi.org>,
	'Or Gerlitz' <ogerlitz@mellanox.com>,
	'Jenny Derzhavetz' <jennyf@mellanox.com>
Subject: RE: [PATCH v1 03/10] IB/iser: Don't register memory for all immediatedata writes
Date: Tue, 24 Nov 2015 10:46:43 -0600	[thread overview]
Message-ID: <00e201d126d7$b2eb1530$18c13f90$@opengridcomputing.com> (raw)
In-Reply-To: <1448382234-24806-4-git-send-email-sagig@mellanox.com>



> -----Original Message-----
> From: Sagi Grimberg [mailto:sagig@mellanox.com]
> Sent: Tuesday, November 24, 2015 10:24 AM
> To: linux-rdma@vger.kernel.org; target-devel@vger.kernel.org
> Cc: Nicholas A. Bellinger; Or Gerlitz; Jenny Derzhavetz; Steve Wise
> Subject: [PATCH v1 03/10] IB/iser: Don't register memory for all immediatedata writes
> 
> From: Jenny Derzhavetz <jennyf@mellanox.com>
> 
> When all the task data is sent as immeidatedata, we are

nit: the above should be "immediate data,"

> allowed to use the local_dma_lkey as it is not sent to
> the wire. In the long run we'd really need to rework
> the memory registration flow only when we need rkeys.
> 
> Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> ---
>  drivers/infiniband/ulp/iser/iscsi_iser.h     |  3 ++-
>  drivers/infiniband/ulp/iser/iser_initiator.c |  5 +++--
>  drivers/infiniband/ulp/iser/iser_memory.c    | 13 +++++++++----
>  3 files changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
> index 233ec0c2ae3d..7b5cf1332ddb 100644
> --- a/drivers/infiniband/ulp/iser/iscsi_iser.h
> +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
> @@ -650,7 +650,8 @@ void iser_finalize_rdma_unaligned_sg(struct iscsi_iser_task *iser_task,
>  				     enum iser_data_dir cmd_dir);
> 
>  int iser_reg_rdma_mem(struct iscsi_iser_task *task,
> -		      enum iser_data_dir dir);
> +		      enum iser_data_dir dir,
> +		      bool all_imm);
>  void iser_unreg_rdma_mem(struct iscsi_iser_task *task,
>  			 enum iser_data_dir dir);
> 
> diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
> index ffd00c420729..07bf26427ee7 100644
> --- a/drivers/infiniband/ulp/iser/iser_initiator.c
> +++ b/drivers/infiniband/ulp/iser/iser_initiator.c
> @@ -72,7 +72,7 @@ static int iser_prepare_read_cmd(struct iscsi_task *task)
>  			return err;
>  	}
> 
> -	err = iser_reg_rdma_mem(iser_task, ISER_DIR_IN);
> +	err = iser_reg_rdma_mem(iser_task, ISER_DIR_IN, false);
>  	if (err) {
>  		iser_err("Failed to set up Data-IN RDMA\n");
>  		return err;
> @@ -126,7 +126,8 @@ iser_prepare_write_cmd(struct iscsi_task *task,
>  			return err;
>  	}
> 
> -	err = iser_reg_rdma_mem(iser_task, ISER_DIR_OUT);
> +	err = iser_reg_rdma_mem(iser_task, ISER_DIR_OUT,
> +				buf_out->data_len == imm_sz);
>  	if (err != 0) {
>  		iser_err("Failed to register write cmd RDMA mem\n");
>  		return err;
> diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
> index b7a2b88f48ce..62d0578388d3 100644
> --- a/drivers/infiniband/ulp/iser/iser_memory.c
> +++ b/drivers/infiniband/ulp/iser/iser_memory.c
> @@ -190,7 +190,11 @@ iser_reg_dma(struct iser_device *device, struct iser_data_buf *mem,
>  	struct scatterlist *sg = mem->sg;
> 
>  	reg->sge.lkey = device->pd->local_dma_lkey;
> -	reg->rkey = device->mr->rkey;
> +	/*
> +	 * FIXME: rework the registration code path to differentiate
> +	 * rkey/lkey use cases
> +	 */
> +	reg->rkey = device->mr ? device->mr->rkey : 0;
>  	reg->sge.addr = ib_sg_dma_address(device->ib_device, &sg[0]);
>  	reg->sge.length = ib_sg_dma_len(device->ib_device, &sg[0]);
> 
> @@ -495,7 +499,8 @@ iser_reg_data_sg(struct iscsi_iser_task *task,
>  }
> 
>  int iser_reg_rdma_mem(struct iscsi_iser_task *task,
> -		      enum iser_data_dir dir)
> +		      enum iser_data_dir dir,
> +		      bool all_imm)
>  {
>  	struct ib_conn *ib_conn = &task->iser_conn->ib_conn;
>  	struct iser_device *device = ib_conn->device;
> @@ -506,8 +511,8 @@ int iser_reg_rdma_mem(struct iscsi_iser_task *task,
>  	bool use_dma_key;
>  	int err;
> 
> -	use_dma_key = (mem->dma_nents == 1 && !iser_always_reg &&
> -		       scsi_get_prot_op(task->sc) == SCSI_PROT_NORMAL);
> +	use_dma_key = mem->dma_nents == 1 && (all_imm || !iser_always_reg) &&
> +		      scsi_get_prot_op(task->sc) == SCSI_PROT_NORMAL;
> 
>  	if (!use_dma_key) {
>  		desc = device->reg_ops->reg_desc_get(ib_conn);
> --
> 1.8.4.3

  reply	other threads:[~2015-11-24 16:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 16:23 [PATCH v1 00/10] iSER support for remote invalidate Sagi Grimberg
     [not found] ` <1448382234-24806-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-11-24 16:23   ` [PATCH v1 01/10] IB/iser: Fix module init not cleaning up on error flow Sagi Grimberg
2015-11-24 16:23   ` [PATCH v1 02/10] IB/iser: Reuse ib_sg_to_pages Sagi Grimberg
2015-11-24 16:23   ` [PATCH v1 04/10] IB/iser: set intuitive values for mr_valid Sagi Grimberg
2015-11-24 16:23   ` [PATCH v1 05/10] iser: Have initiator and target to share protocol structures and definitions Sagi Grimberg
2015-11-24 16:23   ` [PATCH v1 08/10] iser-target: Support the remote invalidation exception Sagi Grimberg
     [not found]     ` <1448382234-24806-9-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-11-24 17:42       ` Or Gerlitz
     [not found]         ` <CAJ3xEMjPwD3X-B+56-+sZ9RqMrcNgr_Y060nR3wLMhi_O0MgqA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-25  7:55           ` Sagi Grimberg
2015-11-25  8:41             ` Or Gerlitz
2015-11-25  8:48               ` Sagi Grimberg
2015-11-25 18:24                 ` Or Gerlitz
2015-11-26  8:55                   ` Sagi Grimberg
2015-11-24 16:23 ` [PATCH v1 03/10] IB/iser: Don't register memory for all immediatedata writes Sagi Grimberg
2015-11-24 16:46   ` Steve Wise [this message]
     [not found]   ` <1448382234-24806-4-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-11-24 19:09     ` Or Gerlitz
2015-11-24 16:23 ` [PATCH v1 06/10] iser-target: Remove unused file iser_proto.h Sagi Grimberg
2015-11-24 16:23 ` [PATCH v1 07/10] iser-target: Declare correct flags when accepting a connection Sagi Grimberg
2015-11-24 16:23 ` [PATCH v1 09/10] IB/iser: Increment the rkey when registering and not when invalidating Sagi Grimberg
2015-11-24 19:12   ` Or Gerlitz
2015-11-24 16:23 ` [PATCH v1 10/10] IB/iser: Support the remote invalidation exception Sagi Grimberg
     [not found]   ` <1448382234-24806-11-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-11-30 13:27     ` Haggai Eran
2015-11-24 16:55 ` [PATCH v1 00/10] iSER support for remote invalidate Steve Wise

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='00e201d126d7$b2eb1530$18c13f90$@opengridcomputing.com' \
    --to=swise@opengridcomputing.com \
    --cc=jennyf@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=ogerlitz@mellanox.com \
    --cc=sagig@mellanox.com \
    --cc=target-devel@vger.kernel.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.