All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/10] iSER support for remote invalidate
@ 2015-12-09 12:11 Sagi Grimberg
  2015-12-09 12:12 ` [PATCH v2 02/10] IB/iser: Reuse ib_sg_to_pages Sagi Grimberg
                   ` (9 more replies)
  0 siblings, 10 replies; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:11 UTC (permalink / raw)
  To: linux-rdma, target-devel
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

Changes from v1:
- Fixed change-log typos

Changes from v0:
- Rebased on top of 4.4-rc2
- Removed iser_hello messages from the protocol header
- Avoided from further breaking the non-existent bidi support
- Fixed initiator remote invalidate support exposure only
  for fastreg && iser_always_register
- Removed patch 2/10 as it's still under testing.
- Minor line-spacing nitpicks CR comments fixes.
- Added a FIXME comment to declare our debt to Or and Jason
  on the awkward device->mr->rkey deref.
- Piggybacked another patch that reduces some iser code that
  is now available by the ib_core (ib_sg_to_pages).

Thanks a lot to all the reviewers!

Code is available at:
git@github.com:sagigrimberg/linux.git iser-remote-inv.2

Jenny Derzhavetz (5):
  IB/iser: Don't register memory for all immediate data writes
  IB/iser: set intuitive values for mr_valid
  iser-target: Declare correct flags when accepting a connection
  iser-target: Support the remote invalidation exception
  IB/iser: Support the remote invalidation exception

Roi Dayan (1):
  IB/iser: Fix module init not cleaning up on error flow

Sagi Grimberg (4):
  IB/iser: Reuse ib_sg_to_pages
  iser: Have initiator and target to share protocol structures and
    definitions
  iser-target: Remove unused file iser_proto.h
  IB/iser: Increment the rkey when registering and not when invalidating

 drivers/infiniband/ulp/iser/iscsi_iser.c     |   9 +-
 drivers/infiniband/ulp/iser/iscsi_iser.h     |  54 +++-------
 drivers/infiniband/ulp/iser/iser_initiator.c |  70 +++++++++++--
 drivers/infiniband/ulp/iser/iser_memory.c    | 150 +++++++++------------------
 drivers/infiniband/ulp/iser/iser_verbs.c     |  30 ++++--
 drivers/infiniband/ulp/isert/ib_isert.c      |  73 +++++++++----
 drivers/infiniband/ulp/isert/ib_isert.h      |  40 ++++++-
 drivers/infiniband/ulp/isert/isert_proto.h   |  47 ---------
 include/scsi/iser.h                          |  78 ++++++++++++++
 9 files changed, 322 insertions(+), 229 deletions(-)
 delete mode 100644 drivers/infiniband/ulp/isert/isert_proto.h
 create mode 100644 include/scsi/iser.h

-- 
1.8.4.3

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v2 01/10] IB/iser: Fix module init not cleaning up on error flow
       [not found] ` <1449663128-368-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-12-09 12:11   ` Sagi Grimberg
  2015-12-09 12:12   ` [PATCH v2 05/10] iser: Have initiator and target to share protocol structures and definitions Sagi Grimberg
  1 sibling, 0 replies; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:11 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, target-devel-u79uwXL29TY76Z2rM5mHXA
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger, Roi Dayan

From: Roi Dayan <roid-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Destroy workqueue on transport register error, also
release kmem cache on workqueue allocation error.

Signed-off-by: Roi Dayan <roid-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 drivers/infiniband/ulp/iser/iscsi_iser.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 9080161e01af..5e6c0bf1e84b 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -1059,7 +1059,8 @@ static int __init iser_init(void)
 	release_wq = alloc_workqueue("release workqueue", 0, 0);
 	if (!release_wq) {
 		iser_err("failed to allocate release workqueue\n");
-		return -ENOMEM;
+		err = -ENOMEM;
+		goto err_alloc_wq;
 	}
 
 	iscsi_iser_scsi_transport = iscsi_register_transport(
@@ -1067,12 +1068,14 @@ static int __init iser_init(void)
 	if (!iscsi_iser_scsi_transport) {
 		iser_err("iscsi_register_transport failed\n");
 		err = -EINVAL;
-		goto register_transport_failure;
+		goto err_reg;
 	}
 
 	return 0;
 
-register_transport_failure:
+err_reg:
+	destroy_workqueue(release_wq);
+err_alloc_wq:
 	kmem_cache_destroy(ig.desc_cache);
 
 	return err;
-- 
1.8.4.3

--
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

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 02/10] IB/iser: Reuse ib_sg_to_pages
  2015-12-09 12:11 [PATCH v2 00/10] iSER support for remote invalidate Sagi Grimberg
@ 2015-12-09 12:12 ` Sagi Grimberg
  2015-12-09 19:28   ` Christoph Hellwig
  2015-12-09 12:12 ` [PATCH v2 03/10] IB/iser: Don't register memory for all immediate data writes Sagi Grimberg
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:12 UTC (permalink / raw)
  To: linux-rdma, target-devel
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

We have in iser iser_sg_to_page_vec which has exactly
the same role as ib_sg_to_pages. Customize the page_vec
to hold a fake MR so we can reuse ib_sg_to_pages.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/infiniband/ulp/iser/iscsi_iser.h  |   5 +-
 drivers/infiniband/ulp/iser/iser_memory.c | 105 +++++++-----------------------
 2 files changed, 25 insertions(+), 85 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index 8a5998e6a407..233ec0c2ae3d 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -579,9 +579,8 @@ struct iscsi_iser_task {
 
 struct iser_page_vec {
 	u64 *pages;
-	int length;
-	int offset;
-	int data_size;
+	int npages;
+	struct ib_mr fake_mr;
 };
 
 /**
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index ea765fb9664d..b7a2b88f48ce 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -131,67 +131,6 @@ iser_reg_desc_put_fmr(struct ib_conn *ib_conn,
 {
 }
 
-#define IS_4K_ALIGNED(addr)	((((unsigned long)addr) & ~MASK_4K) == 0)
-
-/**
- * iser_sg_to_page_vec - Translates scatterlist entries to physical addresses
- * and returns the length of resulting physical address array (may be less than
- * the original due to possible compaction).
- *
- * we build a "page vec" under the assumption that the SG meets the RDMA
- * alignment requirements. Other then the first and last SG elements, all
- * the "internal" elements can be compacted into a list whose elements are
- * dma addresses of physical pages. The code supports also the weird case
- * where --few fragments of the same page-- are present in the SG as
- * consecutive elements. Also, it handles one entry SG.
- */
-
-static int iser_sg_to_page_vec(struct iser_data_buf *data,
-			       struct ib_device *ibdev, u64 *pages,
-			       int *offset, int *data_size)
-{
-	struct scatterlist *sg, *sgl = data->sg;
-	u64 start_addr, end_addr, page, chunk_start = 0;
-	unsigned long total_sz = 0;
-	unsigned int dma_len;
-	int i, new_chunk, cur_page, last_ent = data->dma_nents - 1;
-
-	/* compute the offset of first element */
-	*offset = (u64) sgl[0].offset & ~MASK_4K;
-
-	new_chunk = 1;
-	cur_page  = 0;
-	for_each_sg(sgl, sg, data->dma_nents, i) {
-		start_addr = ib_sg_dma_address(ibdev, sg);
-		if (new_chunk)
-			chunk_start = start_addr;
-		dma_len = ib_sg_dma_len(ibdev, sg);
-		end_addr = start_addr + dma_len;
-		total_sz += dma_len;
-
-		/* collect page fragments until aligned or end of SG list */
-		if (!IS_4K_ALIGNED(end_addr) && i < last_ent) {
-			new_chunk = 0;
-			continue;
-		}
-		new_chunk = 1;
-
-		/* address of the first page in the contiguous chunk;
-		   masking relevant for the very first SG entry,
-		   which might be unaligned */
-		page = chunk_start & MASK_4K;
-		do {
-			pages[cur_page++] = page;
-			page += SIZE_4K;
-		} while (page < end_addr);
-	}
-
-	*data_size = total_sz;
-	iser_dbg("page_vec->data_size:%d cur_page %d\n",
-		 *data_size, cur_page);
-	return cur_page;
-}
-
 static void iser_data_buf_dump(struct iser_data_buf *data,
 			       struct ib_device *ibdev)
 {
@@ -210,10 +149,10 @@ static void iser_dump_page_vec(struct iser_page_vec *page_vec)
 {
 	int i;
 
-	iser_err("page vec length %d data size %d\n",
-		 page_vec->length, page_vec->data_size);
-	for (i = 0; i < page_vec->length; i++)
-		iser_err("%d %lx\n",i,(unsigned long)page_vec->pages[i]);
+	iser_err("page vec npages %d data length %d\n",
+		 page_vec->npages, page_vec->fake_mr.length);
+	for (i = 0; i < page_vec->npages; i++)
+		iser_err("vec[%d]: %llx\n", i, page_vec->pages[i]);
 }
 
 int iser_dma_map_task_data(struct iscsi_iser_task *iser_task,
@@ -262,11 +201,16 @@ iser_reg_dma(struct iser_device *device, struct iser_data_buf *mem,
 	return 0;
 }
 
-/**
- * iser_reg_page_vec - Register physical memory
- *
- * returns: 0 on success, errno code on failure
- */
+static int iser_set_page(struct ib_mr *mr, u64 addr)
+{
+	struct iser_page_vec *page_vec =
+		container_of(mr, struct iser_page_vec, fake_mr);
+
+	page_vec->pages[page_vec->npages++] = addr;
+
+	return 0;
+}
+
 static
 int iser_fast_reg_fmr(struct iscsi_iser_task *iser_task,
 		      struct iser_data_buf *mem,
@@ -280,22 +224,19 @@ int iser_fast_reg_fmr(struct iscsi_iser_task *iser_task,
 	struct ib_pool_fmr *fmr;
 	int ret, plen;
 
-	plen = iser_sg_to_page_vec(mem, device->ib_device,
-				   page_vec->pages,
-				   &page_vec->offset,
-				   &page_vec->data_size);
-	page_vec->length = plen;
-	if (plen * SIZE_4K < page_vec->data_size) {
+	page_vec->npages = 0;
+	page_vec->fake_mr.page_size = SIZE_4K;
+	plen = ib_sg_to_pages(&page_vec->fake_mr, mem->sg,
+			      mem->size, iser_set_page);
+	if (unlikely(plen < mem->size)) {
 		iser_err("page vec too short to hold this SG\n");
 		iser_data_buf_dump(mem, device->ib_device);
 		iser_dump_page_vec(page_vec);
 		return -EINVAL;
 	}
 
-	fmr  = ib_fmr_pool_map_phys(fmr_pool,
-				    page_vec->pages,
-				    page_vec->length,
-				    page_vec->pages[0]);
+	fmr  = ib_fmr_pool_map_phys(fmr_pool, page_vec->pages,
+				    page_vec->npages, page_vec->pages[0]);
 	if (IS_ERR(fmr)) {
 		ret = PTR_ERR(fmr);
 		iser_err("ib_fmr_pool_map_phys failed: %d\n", ret);
@@ -304,8 +245,8 @@ int iser_fast_reg_fmr(struct iscsi_iser_task *iser_task,
 
 	reg->sge.lkey = fmr->fmr->lkey;
 	reg->rkey = fmr->fmr->rkey;
-	reg->sge.addr = page_vec->pages[0] + page_vec->offset;
-	reg->sge.length = page_vec->data_size;
+	reg->sge.addr = page_vec->fake_mr.iova;
+	reg->sge.length = page_vec->fake_mr.length;
 	reg->mem_h = fmr;
 
 	iser_dbg("fmr reg: lkey=0x%x, rkey=0x%x, addr=0x%llx,"
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 03/10] IB/iser: Don't register memory for all immediate data writes
  2015-12-09 12:11 [PATCH v2 00/10] iSER support for remote invalidate Sagi Grimberg
  2015-12-09 12:12 ` [PATCH v2 02/10] IB/iser: Reuse ib_sg_to_pages Sagi Grimberg
@ 2015-12-09 12:12 ` Sagi Grimberg
  2015-12-09 19:30   ` Christoph Hellwig
  2015-12-09 12:12 ` [PATCH v2 04/10] IB/iser: set intuitive values for mr_valid Sagi Grimberg
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:12 UTC (permalink / raw)
  To: linux-rdma, target-devel
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

From: Jenny Derzhavetz <jennyf@mellanox.com>

When all the task data is sent as immediate data, we are
allowed to use the local_dma_lkey as it is not sent to
the wire.

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

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 04/10] IB/iser: set intuitive values for mr_valid
  2015-12-09 12:11 [PATCH v2 00/10] iSER support for remote invalidate Sagi Grimberg
  2015-12-09 12:12 ` [PATCH v2 02/10] IB/iser: Reuse ib_sg_to_pages Sagi Grimberg
  2015-12-09 12:12 ` [PATCH v2 03/10] IB/iser: Don't register memory for all immediate data writes Sagi Grimberg
@ 2015-12-09 12:12 ` Sagi Grimberg
  2015-12-09 19:32   ` Christoph Hellwig
       [not found] ` <1449663128-368-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:12 UTC (permalink / raw)
  To: linux-rdma, target-devel
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

From: Jenny Derzhavetz <jennyf@mellanox.com>

This parameter is described as "is mr valid indicator".
In other words, it indicates whether memory registration
is valid or not. So intuitive values would be:
mr_valid=True, when memory registration is valid and
mr_valid=False otherwise.

Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/infiniband/ulp/iser/iser_memory.c | 8 ++++----
 drivers/infiniband/ulp/iser/iser_verbs.c  | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index 62d0578388d3..a0216da6e8bf 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -392,7 +392,7 @@ iser_reg_sig_mr(struct iscsi_iser_task *iser_task,
 
 	iser_set_prot_checks(iser_task->sc, &sig_attrs->check_mask);
 
-	if (!pi_ctx->sig_mr_valid)
+	if (pi_ctx->sig_mr_valid)
 		iser_inv_rkey(iser_tx_next_wr(tx_desc), pi_ctx->sig_mr);
 
 	wr = sig_handover_wr(iser_tx_next_wr(tx_desc));
@@ -410,7 +410,7 @@ iser_reg_sig_mr(struct iscsi_iser_task *iser_task,
 	wr->access_flags = IB_ACCESS_LOCAL_WRITE |
 			   IB_ACCESS_REMOTE_READ |
 			   IB_ACCESS_REMOTE_WRITE;
-	pi_ctx->sig_mr_valid = 0;
+	pi_ctx->sig_mr_valid = 1;
 
 	sig_reg->sge.lkey = pi_ctx->sig_mr->lkey;
 	sig_reg->rkey = pi_ctx->sig_mr->rkey;
@@ -434,7 +434,7 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task,
 	struct ib_reg_wr *wr;
 	int n;
 
-	if (!rsc->mr_valid)
+	if (rsc->mr_valid)
 		iser_inv_rkey(iser_tx_next_wr(tx_desc), mr);
 
 	n = ib_map_mr_sg(mr, mem->sg, mem->size, SIZE_4K);
@@ -455,7 +455,7 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task,
 		     IB_ACCESS_REMOTE_WRITE |
 		     IB_ACCESS_REMOTE_READ;
 
-	rsc->mr_valid = 0;
+	rsc->mr_valid = 1;
 
 	reg->sge.lkey = mr->lkey;
 	reg->rkey = mr->rkey;
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index a93070210109..415a06e69bc5 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -299,7 +299,7 @@ iser_alloc_reg_res(struct ib_device *ib_device,
 		iser_err("Failed to allocate ib_fast_reg_mr err=%d\n", ret);
 		return ret;
 	}
-	res->mr_valid = 1;
+	res->mr_valid = 0;
 
 	return 0;
 }
@@ -336,7 +336,7 @@ iser_alloc_pi_ctx(struct ib_device *ib_device,
 		ret = PTR_ERR(pi_ctx->sig_mr);
 		goto sig_mr_failure;
 	}
-	pi_ctx->sig_mr_valid = 1;
+	pi_ctx->sig_mr_valid = 0;
 	desc->pi_ctx->sig_protected = 0;
 
 	return 0;
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 05/10] iser: Have initiator and target to share protocol structures and definitions
       [not found] ` <1449663128-368-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2015-12-09 12:11   ` [PATCH v2 01/10] IB/iser: Fix module init not cleaning up on error flow Sagi Grimberg
@ 2015-12-09 12:12   ` Sagi Grimberg
  2015-12-09 19:33     ` Christoph Hellwig
  1 sibling, 1 reply; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:12 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, target-devel-u79uwXL29TY76Z2rM5mHXA
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

The iser RDMA_CM negotiation protocol is shared by
the initiator and the target, so have a shared header
for the defines and structure. Move relevant items from
the initiator and target headers.

Signed-off-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Jenny Derzhavetz <jennyf-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/ulp/iser/iscsi_iser.h     | 41 ++-------------
 drivers/infiniband/ulp/iser/iser_initiator.c |  6 +--
 drivers/infiniband/ulp/iser/iser_verbs.c     |  7 ++-
 drivers/infiniband/ulp/isert/ib_isert.c      | 22 ++++----
 drivers/infiniband/ulp/isert/ib_isert.h      |  6 ++-
 drivers/infiniband/ulp/isert/isert_proto.h   | 20 +------
 include/scsi/iser.h                          | 78 ++++++++++++++++++++++++++++
 7 files changed, 106 insertions(+), 74 deletions(-)
 create mode 100644 include/scsi/iser.h

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index 7b5cf1332ddb..c79fdba6f969 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -48,6 +48,7 @@
 #include <scsi/scsi_transport_iscsi.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
+#include <scsi/iser.h>
 
 #include <linux/interrupt.h>
 #include <linux/wait.h>
@@ -154,43 +155,11 @@
 #define ISER_WC_BATCH_COUNT   16
 #define ISER_SIGNAL_CMD_COUNT 32
 
-#define ISER_VER			0x10
-#define ISER_WSV			0x08
-#define ISER_RSV			0x04
-
 #define ISER_FASTREG_LI_WRID		0xffffffffffffffffULL
 #define ISER_BEACON_WRID		0xfffffffffffffffeULL
 
-/**
- * struct iser_hdr - iSER header
- *
- * @flags:        flags support (zbva, remote_inv)
- * @rsvd:         reserved
- * @write_stag:   write rkey
- * @write_va:     write virtual address
- * @reaf_stag:    read rkey
- * @read_va:      read virtual address
- */
-struct iser_hdr {
-	u8      flags;
-	u8      rsvd[3];
-	__be32  write_stag;
-	__be64  write_va;
-	__be32  read_stag;
-	__be64  read_va;
-} __attribute__((packed));
-
-
-#define ISER_ZBVA_NOT_SUPPORTED		0x80
-#define ISER_SEND_W_INV_NOT_SUPPORTED	0x40
-
-struct iser_cm_hdr {
-	u8      flags;
-	u8      rsvd[3];
-} __packed;
-
-/* Constant PDU lengths calculations */
-#define ISER_HEADERS_LEN  (sizeof(struct iser_hdr) + sizeof(struct iscsi_hdr))
+/*Constant PDU lengths calculations */
+#define ISER_HEADERS_LEN       (sizeof(struct iser_ctrl) + sizeof(struct iscsi_hdr))
 
 #define ISER_RECV_DATA_SEG_LEN	128
 #define ISER_RX_PAYLOAD_SIZE	(ISER_HEADERS_LEN + ISER_RECV_DATA_SEG_LEN)
@@ -287,7 +256,7 @@ enum iser_desc_type {
  * @sig_attrs:     Signature attributes
  */
 struct iser_tx_desc {
-	struct iser_hdr              iser_header;
+	struct iser_ctrl             iser_header;
 	struct iscsi_hdr             iscsi_header;
 	enum   iser_desc_type        type;
 	u64		             dma_addr;
@@ -318,7 +287,7 @@ struct iser_tx_desc {
  * @pad:           for sense data TODO: Modify to maximum sense length supported
  */
 struct iser_rx_desc {
-	struct iser_hdr              iser_header;
+	struct iser_ctrl             iser_header;
 	struct iscsi_hdr             iscsi_header;
 	char		             data[ISER_RECV_DATA_SEG_LEN];
 	u64		             dma_addr;
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index 07bf26427ee7..6a968e350c14 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -51,7 +51,7 @@ static int iser_prepare_read_cmd(struct iscsi_task *task)
 	struct iscsi_iser_task *iser_task = task->dd_data;
 	struct iser_mem_reg *mem_reg;
 	int err;
-	struct iser_hdr *hdr = &iser_task->desc.iser_header;
+	struct iser_ctrl *hdr = &iser_task->desc.iser_header;
 	struct iser_data_buf *buf_in = &iser_task->data[ISER_DIR_IN];
 
 	err = iser_dma_map_task_data(iser_task,
@@ -104,7 +104,7 @@ iser_prepare_write_cmd(struct iscsi_task *task,
 	struct iscsi_iser_task *iser_task = task->dd_data;
 	struct iser_mem_reg *mem_reg;
 	int err;
-	struct iser_hdr *hdr = &iser_task->desc.iser_header;
+	struct iser_ctrl *hdr = &iser_task->desc.iser_header;
 	struct iser_data_buf *buf_out = &iser_task->data[ISER_DIR_OUT];
 	struct ib_sge *tx_dsg = &iser_task->desc.tx_sg[1];
 
@@ -167,7 +167,7 @@ static void iser_create_send_desc(struct iser_conn	*iser_conn,
 	ib_dma_sync_single_for_cpu(device->ib_device,
 		tx_desc->dma_addr, ISER_HEADERS_LEN, DMA_TO_DEVICE);
 
-	memset(&tx_desc->iser_header, 0, sizeof(struct iser_hdr));
+	memset(&tx_desc->iser_header, 0, sizeof(struct iser_ctrl));
 	tx_desc->iser_header.flags = ISER_VER;
 	tx_desc->num_sge = 1;
 }
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 415a06e69bc5..9ba5214f0e02 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -847,10 +847,9 @@ static void iser_route_handler(struct rdma_cm_id *cma_id)
 	conn_param.rnr_retry_count     = 6;
 
 	memset(&req_hdr, 0, sizeof(req_hdr));
-	req_hdr.flags = (ISER_ZBVA_NOT_SUPPORTED |
-			ISER_SEND_W_INV_NOT_SUPPORTED);
-	conn_param.private_data		= (void *)&req_hdr;
-	conn_param.private_data_len	= sizeof(struct iser_cm_hdr);
+	req_hdr.flags = (ISER_ZBVA_NOT_SUP | ISER_SEND_W_INV_NOT_SUP);
+	conn_param.private_data	= (void *)&req_hdr;
+	conn_param.private_data_len = sizeof(struct iser_cm_hdr);
 
 	ret = rdma_connect(cma_id, &conn_param);
 	if (ret) {
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index dfbbbb28090b..19ab0510dd1e 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -1054,8 +1054,8 @@ isert_create_send_desc(struct isert_conn *isert_conn,
 	ib_dma_sync_single_for_cpu(ib_dev, tx_desc->dma_addr,
 				   ISER_HEADERS_LEN, DMA_TO_DEVICE);
 
-	memset(&tx_desc->iser_header, 0, sizeof(struct iser_hdr));
-	tx_desc->iser_header.flags = ISER_VER;
+	memset(&tx_desc->iser_header, 0, sizeof(struct iser_ctrl));
+	tx_desc->iser_header.flags = ISCSI_CTRL;
 
 	tx_desc->num_sge = 1;
 	tx_desc->isert_cmd = isert_cmd;
@@ -1547,21 +1547,21 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc,
 static void
 isert_rx_do_work(struct iser_rx_desc *rx_desc, struct isert_conn *isert_conn)
 {
-	struct iser_hdr *iser_hdr = &rx_desc->iser_header;
+	struct iser_ctrl *iser_ctrl = &rx_desc->iser_header;
 	uint64_t read_va = 0, write_va = 0;
 	uint32_t read_stag = 0, write_stag = 0;
 
-	switch (iser_hdr->flags & 0xF0) {
+	switch (iser_ctrl->flags & 0xF0) {
 	case ISCSI_CTRL:
-		if (iser_hdr->flags & ISER_RSV) {
-			read_stag = be32_to_cpu(iser_hdr->read_stag);
-			read_va = be64_to_cpu(iser_hdr->read_va);
+		if (iser_ctrl->flags & ISER_RSV) {
+			read_stag = be32_to_cpu(iser_ctrl->read_stag);
+			read_va = be64_to_cpu(iser_ctrl->read_va);
 			isert_dbg("ISER_RSV: read_stag: 0x%x read_va: 0x%llx\n",
 				  read_stag, (unsigned long long)read_va);
 		}
-		if (iser_hdr->flags & ISER_WSV) {
-			write_stag = be32_to_cpu(iser_hdr->write_stag);
-			write_va = be64_to_cpu(iser_hdr->write_va);
+		if (iser_ctrl->flags & ISER_WSV) {
+			write_stag = be32_to_cpu(iser_ctrl->write_stag);
+			write_va = be64_to_cpu(iser_ctrl->write_va);
 			isert_dbg("ISER_WSV: write_stag: 0x%x write_va: 0x%llx\n",
 				  write_stag, (unsigned long long)write_va);
 		}
@@ -1572,7 +1572,7 @@ isert_rx_do_work(struct iser_rx_desc *rx_desc, struct isert_conn *isert_conn)
 		isert_err("iSER Hello message\n");
 		break;
 	default:
-		isert_warn("Unknown iSER hdr flags: 0x%02x\n", iser_hdr->flags);
+		isert_warn("Unknown iSER hdr flags: 0x%02x\n", iser_ctrl->flags);
 		break;
 	}
 
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h
index 3d7fbc47c343..03ddc3e0087f 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.h
+++ b/drivers/infiniband/ulp/isert/ib_isert.h
@@ -3,6 +3,8 @@
 #include <linux/in6.h>
 #include <rdma/ib_verbs.h>
 #include <rdma/rdma_cm.h>
+#include <scsi/iser.h>
+
 
 #define DRV_NAME	"isert"
 #define PFX		DRV_NAME ": "
@@ -56,7 +58,7 @@ enum iser_conn_state {
 };
 
 struct iser_rx_desc {
-	struct iser_hdr iser_header;
+	struct iser_ctrl iser_header;
 	struct iscsi_hdr iscsi_header;
 	char		data[ISER_RECV_DATA_SEG_LEN];
 	u64		dma_addr;
@@ -65,7 +67,7 @@ struct iser_rx_desc {
 } __packed;
 
 struct iser_tx_desc {
-	struct iser_hdr iser_header;
+	struct iser_ctrl iser_header;
 	struct iscsi_hdr iscsi_header;
 	enum isert_desc_type type;
 	u64		dma_addr;
diff --git a/drivers/infiniband/ulp/isert/isert_proto.h b/drivers/infiniband/ulp/isert/isert_proto.h
index 4dccd313b777..c835b0083fa7 100644
--- a/drivers/infiniband/ulp/isert/isert_proto.h
+++ b/drivers/infiniband/ulp/isert/isert_proto.h
@@ -1,16 +1,7 @@
 /* From iscsi_iser.h */
 
-struct iser_hdr {
-	u8	flags;
-	u8	rsvd[3];
-	__be32	write_stag; /* write rkey */
-	__be64	write_va;
-	__be32	read_stag;  /* read rkey */
-	__be64	read_va;
-} __packed;
-
-/*Constant PDU lengths calculations */
-#define ISER_HEADERS_LEN  (sizeof(struct iser_hdr) + sizeof(struct iscsi_hdr))
+/* Constant PDU lengths calculations */
+#define ISER_HEADERS_LEN  (sizeof(struct iser_ctrl) + sizeof(struct iscsi_hdr))
 
 #define ISER_RECV_DATA_SEG_LEN  8192
 #define ISER_RX_PAYLOAD_SIZE    (ISER_HEADERS_LEN + ISER_RECV_DATA_SEG_LEN)
@@ -38,10 +29,3 @@ struct iser_hdr {
 
 #define ISER_RX_PAD_SIZE	(ISER_RECV_DATA_SEG_LEN + 4096 - \
 		(ISER_RX_PAYLOAD_SIZE + sizeof(u64) + sizeof(struct ib_sge)))
-
-#define ISER_VER	0x10
-#define ISER_WSV	0x08
-#define ISER_RSV	0x04
-#define ISCSI_CTRL	0x10
-#define ISER_HELLO	0x20
-#define ISER_HELLORPLY	0x30
diff --git a/include/scsi/iser.h b/include/scsi/iser.h
new file mode 100644
index 000000000000..2e678fa74eca
--- /dev/null
+++ b/include/scsi/iser.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2015 Mellanox Technologies. 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
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *	- Redistributions of source code must retain the above
+ *	  copyright notice, this list of conditions and the following
+ *	  disclaimer.
+ *
+ *	- Redistributions in binary form must reproduce the above
+ *	  copyright notice, this list of conditions and the following
+ *	  disclaimer in the documentation and/or other materials
+ *	  provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+#ifndef ISCSI_ISER_H
+#define ISCSI_ISER_H
+
+#define ISER_ZBVA_NOT_SUP		0x80
+#define ISER_SEND_W_INV_NOT_SUP		0x40
+#define ISERT_ZBVA_NOT_USED		0x80
+#define ISERT_SEND_W_INV_NOT_USED	0x40
+
+#define ISCSI_CTRL	0x10
+#define ISER_HELLO	0x20
+#define ISER_HELLORPLY	0x30
+
+#define ISER_VER	0x10
+#define ISER_WSV	0x08
+#define ISER_RSV	0x04
+
+/**
+ * struct iser_cm_hdr - iSER CM header (from iSER Annex A12)
+ *
+ * @flags:        flags support (zbva, send_w_inv)
+ * @rsvd:         reserved
+ */
+struct iser_cm_hdr {
+	u8      flags;
+	u8      rsvd[3];
+} __packed;
+
+/**
+ * struct iser_ctrl - iSER header of iSCSI control PDU
+ *
+ * @flags:        opcode and read/write valid bits
+ * @rsvd:         reserved
+ * @write_stag:   write rkey
+ * @write_va:     write virtual address
+ * @reaf_stag:    read rkey
+ * @read_va:      read virtual address
+ */
+struct iser_ctrl {
+	u8      flags;
+	u8      rsvd[3];
+	__be32  write_stag;
+	__be64  write_va;
+	__be32  read_stag;
+	__be64  read_va;
+} __packed;
+
+#endif /* ISCSI_ISER_H */
-- 
1.8.4.3

--
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

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 06/10] iser-target: Remove unused file iser_proto.h
  2015-12-09 12:11 [PATCH v2 00/10] iSER support for remote invalidate Sagi Grimberg
                   ` (3 preceding siblings ...)
       [not found] ` <1449663128-368-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-12-09 12:12 ` Sagi Grimberg
  2015-12-09 12:12 ` [PATCH v2 07/10] iser-target: Declare correct flags when accepting a connection Sagi Grimberg
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:12 UTC (permalink / raw)
  To: linux-rdma, target-devel
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

We don't need iser_proto.h anymore, remove it and
move (non-protocol) declarations to ib_isert.h

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 drivers/infiniband/ulp/isert/ib_isert.c    |  1 -
 drivers/infiniband/ulp/isert/ib_isert.h    | 32 ++++++++++++++++++++++++++++++
 drivers/infiniband/ulp/isert/isert_proto.h | 31 -----------------------------
 3 files changed, 32 insertions(+), 32 deletions(-)
 delete mode 100644 drivers/infiniband/ulp/isert/isert_proto.h

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 19ab0510dd1e..63217e382140 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -29,7 +29,6 @@
 #include <target/iscsi/iscsi_transport.h>
 #include <linux/semaphore.h>
 
-#include "isert_proto.h"
 #include "ib_isert.h"
 
 #define	ISERT_MAX_CONN		8
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h
index 03ddc3e0087f..da8b2fae5776 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.h
+++ b/drivers/infiniband/ulp/isert/ib_isert.h
@@ -33,6 +33,38 @@
 #define isert_err(fmt, arg...) \
 	pr_err(PFX "%s: " fmt, __func__ , ## arg)
 
+/* Constant PDU lengths calculations */
+#define ISER_HEADERS_LEN	(sizeof(struct iser_ctrl) + \
+				 sizeof(struct iscsi_hdr))
+#define ISER_RECV_DATA_SEG_LEN	8192
+#define ISER_RX_PAYLOAD_SIZE	(ISER_HEADERS_LEN + ISER_RECV_DATA_SEG_LEN)
+#define ISER_RX_LOGIN_SIZE	(ISER_HEADERS_LEN + ISCSI_DEF_MAX_RECV_SEG_LEN)
+
+/* QP settings */
+/* Maximal bounds on received asynchronous PDUs */
+#define ISERT_MAX_TX_MISC_PDUS	4 /* NOOP_IN(2) , ASYNC_EVENT(2)   */
+
+#define ISERT_MAX_RX_MISC_PDUS	6 /*
+				   * NOOP_OUT(2), TEXT(1),
+				   * SCSI_TMFUNC(2), LOGOUT(1)
+				   */
+
+#define ISCSI_DEF_XMIT_CMDS_MAX 128 /* from libiscsi.h, must be power of 2 */
+
+#define ISERT_QP_MAX_RECV_DTOS	(ISCSI_DEF_XMIT_CMDS_MAX)
+
+#define ISERT_MIN_POSTED_RX	(ISCSI_DEF_XMIT_CMDS_MAX >> 2)
+
+#define ISERT_INFLIGHT_DATAOUTS	8
+
+#define ISERT_QP_MAX_REQ_DTOS	(ISCSI_DEF_XMIT_CMDS_MAX *    \
+				(1 + ISERT_INFLIGHT_DATAOUTS) + \
+				ISERT_MAX_TX_MISC_PDUS	+ \
+				ISERT_MAX_RX_MISC_PDUS)
+
+#define ISER_RX_PAD_SIZE	(ISER_RECV_DATA_SEG_LEN + 4096 - \
+		(ISER_RX_PAYLOAD_SIZE + sizeof(u64) + sizeof(struct ib_sge)))
+
 #define ISCSI_ISER_SG_TABLESIZE		256
 #define ISER_FASTREG_LI_WRID		0xffffffffffffffffULL
 #define ISER_BEACON_WRID               0xfffffffffffffffeULL
diff --git a/drivers/infiniband/ulp/isert/isert_proto.h b/drivers/infiniband/ulp/isert/isert_proto.h
deleted file mode 100644
index c835b0083fa7..000000000000
--- a/drivers/infiniband/ulp/isert/isert_proto.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* From iscsi_iser.h */
-
-/* Constant PDU lengths calculations */
-#define ISER_HEADERS_LEN  (sizeof(struct iser_ctrl) + sizeof(struct iscsi_hdr))
-
-#define ISER_RECV_DATA_SEG_LEN  8192
-#define ISER_RX_PAYLOAD_SIZE    (ISER_HEADERS_LEN + ISER_RECV_DATA_SEG_LEN)
-#define ISER_RX_LOGIN_SIZE      (ISER_HEADERS_LEN + ISCSI_DEF_MAX_RECV_SEG_LEN)
-
-/* QP settings */
-/* Maximal bounds on received asynchronous PDUs */
-#define ISERT_MAX_TX_MISC_PDUS	4 /* NOOP_IN(2) , ASYNC_EVENT(2)   */
-
-#define ISERT_MAX_RX_MISC_PDUS	6 /* NOOP_OUT(2), TEXT(1),         *
-				   * SCSI_TMFUNC(2), LOGOUT(1) */
-
-#define ISCSI_DEF_XMIT_CMDS_MAX 128 /* from libiscsi.h, must be power of 2 */
-
-#define ISERT_QP_MAX_RECV_DTOS	(ISCSI_DEF_XMIT_CMDS_MAX)
-
-#define ISERT_MIN_POSTED_RX	(ISCSI_DEF_XMIT_CMDS_MAX >> 2)
-
-#define ISERT_INFLIGHT_DATAOUTS	8
-
-#define ISERT_QP_MAX_REQ_DTOS	(ISCSI_DEF_XMIT_CMDS_MAX *    \
-				(1 + ISERT_INFLIGHT_DATAOUTS) + \
-				ISERT_MAX_TX_MISC_PDUS	+ \
-				ISERT_MAX_RX_MISC_PDUS)
-
-#define ISER_RX_PAD_SIZE	(ISER_RECV_DATA_SEG_LEN + 4096 - \
-		(ISER_RX_PAYLOAD_SIZE + sizeof(u64) + sizeof(struct ib_sge)))
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 07/10] iser-target: Declare correct flags when accepting a connection
  2015-12-09 12:11 [PATCH v2 00/10] iSER support for remote invalidate Sagi Grimberg
                   ` (4 preceding siblings ...)
  2015-12-09 12:12 ` [PATCH v2 06/10] iser-target: Remove unused file iser_proto.h Sagi Grimberg
@ 2015-12-09 12:12 ` Sagi Grimberg
       [not found]   ` <1449663128-368-8-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2015-12-09 12:12 ` [PATCH v2 08/10] iser-target: Support the remote invalidation exception Sagi Grimberg
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:12 UTC (permalink / raw)
  To: linux-rdma, target-devel
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

From: Jenny Derzhavetz <jennyf@mellanox.com>

iser target does not support zero based virtual addresses and
send with invalidate, so it should declare that it doesn't.

Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 63217e382140..8a90475ed2f2 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -3098,12 +3098,18 @@ isert_rdma_accept(struct isert_conn *isert_conn)
 	struct rdma_cm_id *cm_id = isert_conn->cm_id;
 	struct rdma_conn_param cp;
 	int ret;
+	struct iser_cm_hdr rsp_hdr;
 
 	memset(&cp, 0, sizeof(struct rdma_conn_param));
 	cp.initiator_depth = isert_conn->initiator_depth;
 	cp.retry_count = 7;
 	cp.rnr_retry_count = 7;
 
+	memset(&rsp_hdr, 0, sizeof(rsp_hdr));
+	rsp_hdr.flags = (ISERT_ZBVA_NOT_USED | ISERT_SEND_W_INV_NOT_USED);
+	cp.private_data = (void *)&rsp_hdr;
+	cp.private_data_len = sizeof(rsp_hdr);
+
 	ret = rdma_accept(cm_id, &cp);
 	if (ret) {
 		isert_err("rdma_accept() failed with: %d\n", ret);
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 08/10] iser-target: Support the remote invalidation exception
  2015-12-09 12:11 [PATCH v2 00/10] iSER support for remote invalidate Sagi Grimberg
                   ` (5 preceding siblings ...)
  2015-12-09 12:12 ` [PATCH v2 07/10] iser-target: Declare correct flags when accepting a connection Sagi Grimberg
@ 2015-12-09 12:12 ` Sagi Grimberg
       [not found]   ` <1449663128-368-9-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2015-12-09 12:12 ` [PATCH v2 09/10] IB/iser: Increment the rkey when registering and not when invalidating Sagi Grimberg
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:12 UTC (permalink / raw)
  To: linux-rdma, target-devel
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

From: Jenny Derzhavetz <jennyf@mellanox.com>

We'll use remote invalidate, according to negotiation result
during connection establishment. If the initiator declared that
it supports the remote invalidate exception and the local HCA
supports IB_DEVICE_MEM_MGT_EXTENSIONS then the target will
use IB_WR_SEND_WITH_INV with the correct rkey for the response.

Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 46 ++++++++++++++++++++++++++++-----
 drivers/infiniband/ulp/isert/ib_isert.h |  2 ++
 2 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 8a90475ed2f2..91eb22c4fdba 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -679,6 +679,32 @@ out_login_buf:
 	return ret;
 }
 
+static void
+isert_set_nego_params(struct isert_conn *isert_conn,
+		      struct rdma_conn_param *param)
+{
+	struct isert_device *device = isert_conn->device;
+
+	/* Set max inflight RDMA READ requests */
+	isert_conn->initiator_depth = min_t(u8, param->initiator_depth,
+				device->dev_attr.max_qp_init_rd_atom);
+	isert_dbg("Using initiator_depth: %u\n", isert_conn->initiator_depth);
+
+	if (param->private_data) {
+		u8 flags = *(u8 *)param->private_data;
+
+		/*
+		 * use remote invalidation if the both initiator
+		 * and the HCA support it
+		 */
+		isert_conn->snd_w_inv = !(flags & ISER_SEND_W_INV_NOT_SUP) &&
+					  (device->dev_attr.device_cap_flags &
+					   IB_DEVICE_MEM_MGT_EXTENSIONS);
+		if (isert_conn->snd_w_inv)
+			isert_info("Using remote invalidation\n");
+	}
+}
+
 static int
 isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 {
@@ -717,11 +743,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 	}
 	isert_conn->device = device;
 
-	/* Set max inflight RDMA READ requests */
-	isert_conn->initiator_depth = min_t(u8,
-				event->param.conn.initiator_depth,
-				device->dev_attr.max_qp_init_rd_atom);
-	isert_dbg("Using initiator_depth: %u\n", isert_conn->initiator_depth);
+	isert_set_nego_params(isert_conn, &event->param.conn);
 
 	ret = isert_conn_setup_qp(isert_conn, cma_id);
 	if (ret)
@@ -1100,7 +1122,14 @@ isert_init_send_wr(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd,
 
 	isert_cmd->rdma_wr.iser_ib_op = ISER_IB_SEND;
 	send_wr->wr_id = (uintptr_t)&isert_cmd->tx_desc;
-	send_wr->opcode = IB_WR_SEND;
+
+	if (isert_conn->snd_w_inv && isert_cmd->inv_rkey) {
+		send_wr->opcode  = IB_WR_SEND_WITH_INV;
+		send_wr->ex.invalidate_rkey = isert_cmd->inv_rkey;
+	} else {
+		send_wr->opcode = IB_WR_SEND;
+	}
+
 	send_wr->sg_list = &tx_desc->tx_sg[0];
 	send_wr->num_sge = isert_cmd->tx_desc.num_sge;
 	send_wr->send_flags = IB_SEND_SIGNALED;
@@ -1489,6 +1518,7 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc,
 		isert_cmd->read_va = read_va;
 		isert_cmd->write_stag = write_stag;
 		isert_cmd->write_va = write_va;
+		isert_cmd->inv_rkey = read_stag ? read_stag : write_stag;
 
 		ret = isert_handle_scsi_cmd(isert_conn, isert_cmd, cmd,
 					rx_desc, (unsigned char *)hdr);
@@ -3106,7 +3136,9 @@ isert_rdma_accept(struct isert_conn *isert_conn)
 	cp.rnr_retry_count = 7;
 
 	memset(&rsp_hdr, 0, sizeof(rsp_hdr));
-	rsp_hdr.flags = (ISERT_ZBVA_NOT_USED | ISERT_SEND_W_INV_NOT_USED);
+	rsp_hdr.flags = ISERT_ZBVA_NOT_USED;
+	if (!isert_conn->snd_w_inv)
+		rsp_hdr.flags = rsp_hdr.flags | ISERT_SEND_W_INV_NOT_USED;
 	cp.private_data = (void *)&rsp_hdr;
 	cp.private_data_len = sizeof(rsp_hdr);
 
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h
index da8b2fae5776..586561cb23fc 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.h
+++ b/drivers/infiniband/ulp/isert/ib_isert.h
@@ -163,6 +163,7 @@ struct isert_cmd {
 	uint32_t		write_stag;
 	uint64_t		read_va;
 	uint64_t		write_va;
+	uint32_t		inv_rkey;
 	u64			pdu_buf_dma;
 	u32			pdu_buf_len;
 	struct isert_conn	*conn;
@@ -210,6 +211,7 @@ struct isert_conn {
 	struct work_struct	release_work;
 	struct ib_recv_wr       beacon;
 	bool                    logout_posted;
+	bool                    snd_w_inv;
 };
 
 #define ISERT_MAX_CQ 64
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 09/10] IB/iser: Increment the rkey when registering and not when invalidating
  2015-12-09 12:11 [PATCH v2 00/10] iSER support for remote invalidate Sagi Grimberg
                   ` (6 preceding siblings ...)
  2015-12-09 12:12 ` [PATCH v2 08/10] iser-target: Support the remote invalidation exception Sagi Grimberg
@ 2015-12-09 12:12 ` Sagi Grimberg
  2015-12-09 19:38   ` Christoph Hellwig
  2015-12-09 12:12 ` [PATCH v2 10/10] IB/iser: Support the remote invalidation exception Sagi Grimberg
  2015-12-21  4:20 ` [PATCH v2 00/10] iSER support for remote invalidate Nicholas A. Bellinger
  9 siblings, 1 reply; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:12 UTC (permalink / raw)
  To: linux-rdma, target-devel
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

With remote invalidate we won't local invalidate
but we still want to increment the rkey.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
---
 drivers/infiniband/ulp/iser/iser_memory.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index a0216da6e8bf..c008fc262aee 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -358,19 +358,14 @@ iser_set_prot_checks(struct scsi_cmnd *sc, u8 *mask)
 		*mask |= ISER_CHECK_GUARD;
 }
 
-static void
+static inline void
 iser_inv_rkey(struct ib_send_wr *inv_wr, struct ib_mr *mr)
 {
-	u32 rkey;
-
 	inv_wr->opcode = IB_WR_LOCAL_INV;
 	inv_wr->wr_id = ISER_FASTREG_LI_WRID;
 	inv_wr->ex.invalidate_rkey = mr->rkey;
 	inv_wr->send_flags = 0;
 	inv_wr->num_sge = 0;
-
-	rkey = ib_inc_rkey(mr->rkey);
-	ib_update_fast_reg_key(mr, rkey);
 }
 
 static int
@@ -383,6 +378,7 @@ iser_reg_sig_mr(struct iscsi_iser_task *iser_task,
 	struct iser_tx_desc *tx_desc = &iser_task->desc;
 	struct ib_sig_attrs *sig_attrs = &tx_desc->sig_attrs;
 	struct ib_sig_handover_wr *wr;
+	struct ib_mr *mr = pi_ctx->sig_mr;
 	int ret;
 
 	memset(sig_attrs, 0, sizeof(*sig_attrs));
@@ -393,7 +389,9 @@ iser_reg_sig_mr(struct iscsi_iser_task *iser_task,
 	iser_set_prot_checks(iser_task->sc, &sig_attrs->check_mask);
 
 	if (pi_ctx->sig_mr_valid)
-		iser_inv_rkey(iser_tx_next_wr(tx_desc), pi_ctx->sig_mr);
+		iser_inv_rkey(iser_tx_next_wr(tx_desc), mr);
+
+	ib_update_fast_reg_key(mr, ib_inc_rkey(mr->rkey));
 
 	wr = sig_handover_wr(iser_tx_next_wr(tx_desc));
 	wr->wr.opcode = IB_WR_REG_SIG_MR;
@@ -402,7 +400,7 @@ iser_reg_sig_mr(struct iscsi_iser_task *iser_task,
 	wr->wr.num_sge = 1;
 	wr->wr.send_flags = 0;
 	wr->sig_attrs = sig_attrs;
-	wr->sig_mr = pi_ctx->sig_mr;
+	wr->sig_mr = mr;
 	if (scsi_prot_sg_count(iser_task->sc))
 		wr->prot = &prot_reg->sge;
 	else
@@ -412,8 +410,8 @@ iser_reg_sig_mr(struct iscsi_iser_task *iser_task,
 			   IB_ACCESS_REMOTE_WRITE;
 	pi_ctx->sig_mr_valid = 1;
 
-	sig_reg->sge.lkey = pi_ctx->sig_mr->lkey;
-	sig_reg->rkey = pi_ctx->sig_mr->rkey;
+	sig_reg->sge.lkey = mr->lkey;
+	sig_reg->rkey = mr->rkey;
 	sig_reg->sge.addr = 0;
 	sig_reg->sge.length = scsi_transfer_length(iser_task->sc);
 
@@ -437,6 +435,8 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task,
 	if (rsc->mr_valid)
 		iser_inv_rkey(iser_tx_next_wr(tx_desc), mr);
 
+	ib_update_fast_reg_key(mr, ib_inc_rkey(mr->rkey));
+
 	n = ib_map_mr_sg(mr, mem->sg, mem->size, SIZE_4K);
 	if (unlikely(n != mem->size)) {
 		iser_err("failed to map sg (%d/%d)\n",
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 10/10] IB/iser: Support the remote invalidation exception
  2015-12-09 12:11 [PATCH v2 00/10] iSER support for remote invalidate Sagi Grimberg
                   ` (7 preceding siblings ...)
  2015-12-09 12:12 ` [PATCH v2 09/10] IB/iser: Increment the rkey when registering and not when invalidating Sagi Grimberg
@ 2015-12-09 12:12 ` Sagi Grimberg
  2015-12-21  4:20 ` [PATCH v2 00/10] iSER support for remote invalidate Nicholas A. Bellinger
  9 siblings, 0 replies; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-09 12:12 UTC (permalink / raw)
  To: linux-rdma, target-devel
  Cc: Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

From: Jenny Derzhavetz <jennyf@mellanox.com>

Declare that we support remote invalidation in case we are:
1. using fastreg method
2. always registering memory

Detect the invalidated rkey from the work completion info so we
won't invalidate it locally. The spec mandates that we must not rely
on the target remote invalidate our rkey so we must check it upon
a receive (scsi response) completion.

Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/infiniband/ulp/iser/iscsi_iser.h     |  5 ++-
 drivers/infiniband/ulp/iser/iser_initiator.c | 59 +++++++++++++++++++++++++++-
 drivers/infiniband/ulp/iser/iser_memory.c    |  4 +-
 drivers/infiniband/ulp/iser/iser_verbs.c     | 21 +++++++---
 4 files changed, 80 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index c79fdba6f969..e399d9a49df2 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -358,6 +358,7 @@ struct iser_reg_ops {
  *                 cpus and device max completion vectors
  * @comps:         Dinamically allocated array of completion handlers
  * @reg_ops:       Registration ops
+ * @remote_inv_sup: Remote invalidate is supported on this device
  */
 struct iser_device {
 	struct ib_device             *ib_device;
@@ -370,6 +371,7 @@ struct iser_device {
 	int			     comps_used;
 	struct iser_comp	     *comps;
 	struct iser_reg_ops          *reg_ops;
+	bool                         remote_inv_sup;
 };
 
 #define ISER_CHECK_GUARD	0xc0
@@ -519,6 +521,7 @@ struct iser_conn {
 	u32                          num_rx_descs;
 	unsigned short               scsi_sg_tablesize;
 	unsigned int                 scsi_max_sectors;
+	bool			     snd_w_inv;
 };
 
 /**
@@ -602,7 +605,7 @@ int iser_conn_terminate(struct iser_conn *iser_conn);
 void iser_release_work(struct work_struct *work);
 
 void iser_rcv_completion(struct iser_rx_desc *desc,
-			 unsigned long dto_xfer_len,
+			 struct ib_wc *wc,
 			 struct ib_conn *ib_conn);
 
 void iser_snd_completion(struct iser_tx_desc *desc,
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index 6a968e350c14..cd12f89b3365 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -563,11 +563,61 @@ send_control_error:
 	return err;
 }
 
+static inline void
+iser_inv_desc(struct iser_fr_desc *desc, u32 rkey)
+{
+	if (likely(rkey == desc->rsc.mr->rkey))
+		desc->rsc.mr_valid = 0;
+	else if (likely(rkey == desc->pi_ctx->sig_mr->rkey))
+		desc->pi_ctx->sig_mr_valid = 0;
+}
+
+static int
+iser_check_remote_inv(struct iser_conn *iser_conn,
+		      struct ib_wc *wc,
+		      struct iscsi_hdr *hdr)
+{
+	if (wc->wc_flags & IB_WC_WITH_INVALIDATE) {
+		struct iscsi_task *task;
+		u32 rkey = wc->ex.invalidate_rkey;
+
+		iser_dbg("conn %p: remote invalidation for rkey %#x\n",
+			 iser_conn, rkey);
+
+		if (unlikely(!iser_conn->snd_w_inv)) {
+			iser_err("conn %p: unexepected remote invalidation, "
+				 "terminating connection\n", iser_conn);
+			return -EPROTO;
+		}
+
+		task = iscsi_itt_to_ctask(iser_conn->iscsi_conn, hdr->itt);
+		if (likely(task)) {
+			struct iscsi_iser_task *iser_task = task->dd_data;
+			struct iser_fr_desc *desc;
+
+			if (iser_task->dir[ISER_DIR_IN]) {
+				desc = iser_task->rdma_reg[ISER_DIR_IN].mem_h;
+				iser_inv_desc(desc, rkey);
+			}
+
+			if (iser_task->dir[ISER_DIR_OUT]) {
+				desc = iser_task->rdma_reg[ISER_DIR_OUT].mem_h;
+				iser_inv_desc(desc, rkey);
+			}
+		} else {
+			iser_err("failed to get task for itt=%d\n", hdr->itt);
+			return -EINVAL;
+		}
+	}
+
+	return 0;
+}
+
 /**
  * iser_rcv_dto_completion - recv DTO completion
  */
 void iser_rcv_completion(struct iser_rx_desc *rx_desc,
-			 unsigned long rx_xfer_len,
+			 struct ib_wc *wc,
 			 struct ib_conn *ib_conn)
 {
 	struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn,
@@ -575,6 +625,7 @@ void iser_rcv_completion(struct iser_rx_desc *rx_desc,
 	struct iscsi_hdr *hdr;
 	u64 rx_dma;
 	int rx_buflen, outstanding, count, err;
+	unsigned long rx_xfer_len = wc->byte_len;
 
 	/* differentiate between login to all other PDUs */
 	if ((char *)rx_desc == iser_conn->login_resp_buf) {
@@ -593,6 +644,12 @@ void iser_rcv_completion(struct iser_rx_desc *rx_desc,
 	iser_dbg("op 0x%x itt 0x%x dlen %d\n", hdr->opcode,
 			hdr->itt, (int)(rx_xfer_len - ISER_HEADERS_LEN));
 
+	if (iser_check_remote_inv(iser_conn, wc, hdr)) {
+		iscsi_conn_failure(iser_conn->iscsi_conn,
+				   ISCSI_ERR_CONN_FAILED);
+		return;
+	}
+
 	iscsi_iser_recv(iser_conn->iscsi_conn, hdr, rx_desc->data,
 			rx_xfer_len - ISER_HEADERS_LEN);
 
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index c008fc262aee..8a57d4eadda6 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -76,10 +76,10 @@ int iser_assign_reg_ops(struct iser_device *device)
 	    device->ib_device->map_phys_fmr && device->ib_device->unmap_fmr) {
 		iser_info("FMR supported, using FMR for registration\n");
 		device->reg_ops = &fmr_ops;
-	} else
-	if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) {
+	} else if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) {
 		iser_info("FastReg supported, using FastReg for registration\n");
 		device->reg_ops = &fastreg_ops;
+		device->remote_inv_sup = iser_always_reg;
 	} else {
 		iser_err("IB device does not support FMRs nor FastRegs, can't register memory\n");
 		return -1;
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 9ba5214f0e02..8d25c503d32b 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -847,7 +847,9 @@ static void iser_route_handler(struct rdma_cm_id *cma_id)
 	conn_param.rnr_retry_count     = 6;
 
 	memset(&req_hdr, 0, sizeof(req_hdr));
-	req_hdr.flags = (ISER_ZBVA_NOT_SUP | ISER_SEND_W_INV_NOT_SUP);
+	req_hdr.flags = ISER_ZBVA_NOT_SUP;
+	if (!device->remote_inv_sup)
+		req_hdr.flags |= ISER_SEND_W_INV_NOT_SUP;
 	conn_param.private_data	= (void *)&req_hdr;
 	conn_param.private_data_len = sizeof(struct iser_cm_hdr);
 
@@ -862,7 +864,8 @@ failure:
 	iser_connect_error(cma_id);
 }
 
-static void iser_connected_handler(struct rdma_cm_id *cma_id)
+static void iser_connected_handler(struct rdma_cm_id *cma_id,
+				   const void *private_data)
 {
 	struct iser_conn *iser_conn;
 	struct ib_qp_attr attr;
@@ -876,6 +879,15 @@ static void iser_connected_handler(struct rdma_cm_id *cma_id)
 	(void)ib_query_qp(cma_id->qp, &attr, ~0, &init_attr);
 	iser_info("remote qpn:%x my qpn:%x\n", attr.dest_qp_num, cma_id->qp->qp_num);
 
+	if (private_data) {
+		u8 flags = *(u8 *)private_data;
+
+		iser_conn->snd_w_inv = !(flags & ISER_SEND_W_INV_NOT_SUP);
+	}
+
+	iser_info("conn %p: negotiated %s invalidation\n",
+		  iser_conn, iser_conn->snd_w_inv ? "remote" : "local");
+
 	iser_conn->state = ISER_CONN_UP;
 	complete(&iser_conn->up_completion);
 }
@@ -927,7 +939,7 @@ static int iser_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *eve
 		iser_route_handler(cma_id);
 		break;
 	case RDMA_CM_EVENT_ESTABLISHED:
-		iser_connected_handler(cma_id);
+		iser_connected_handler(cma_id, event->param.conn.private_data);
 		break;
 	case RDMA_CM_EVENT_ADDR_ERROR:
 	case RDMA_CM_EVENT_ROUTE_ERROR:
@@ -1205,8 +1217,7 @@ static void iser_handle_wc(struct ib_wc *wc)
 	if (likely(wc->status == IB_WC_SUCCESS)) {
 		if (wc->opcode == IB_WC_RECV) {
 			rx_desc = (struct iser_rx_desc *)(uintptr_t)wc->wr_id;
-			iser_rcv_completion(rx_desc, wc->byte_len,
-					    ib_conn);
+			iser_rcv_completion(rx_desc, wc, ib_conn);
 		} else
 		if (wc->opcode == IB_WC_SEND) {
 			tx_desc = (struct iser_tx_desc *)(uintptr_t)wc->wr_id;
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 02/10] IB/iser: Reuse ib_sg_to_pages
  2015-12-09 12:12 ` [PATCH v2 02/10] IB/iser: Reuse ib_sg_to_pages Sagi Grimberg
@ 2015-12-09 19:28   ` Christoph Hellwig
       [not found]     ` <20151209192819.GA21477-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Christoph Hellwig @ 2015-12-09 19:28 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-rdma, target-devel, Or Gerlitz, Jenny Derzhavetz,
	Nicholas A. Bellinger

On Wed, Dec 09, 2015 at 02:12:00PM +0200, Sagi Grimberg wrote:
> We have in iser iser_sg_to_page_vec which has exactly
> the same role as ib_sg_to_pages. Customize the page_vec
> to hold a fake MR so we can reuse ib_sg_to_pages.

Looks good.  In the long run we should simply kill struct ib_fmr
and make FRMs operate on struct ib_mr so that it can use
ib_sg_to_pages directly.

Signed-off-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 03/10] IB/iser: Don't register memory for all immediate data writes
  2015-12-09 12:12 ` [PATCH v2 03/10] IB/iser: Don't register memory for all immediate data writes Sagi Grimberg
@ 2015-12-09 19:30   ` Christoph Hellwig
  2015-12-10  8:31     ` Sagi Grimberg
  0 siblings, 1 reply; 32+ messages in thread
From: Christoph Hellwig @ 2015-12-09 19:30 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-rdma, target-devel, Or Gerlitz, Jenny Derzhavetz,
	Nicholas A. Bellinger

The iser_reg_rdma_mem calling conventions seem rather confusing,
and this patch doesn't help that.  But I think that's something
to be addressed in bigger cleanup later on.

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 04/10] IB/iser: set intuitive values for mr_valid
  2015-12-09 12:12 ` [PATCH v2 04/10] IB/iser: set intuitive values for mr_valid Sagi Grimberg
@ 2015-12-09 19:32   ` Christoph Hellwig
  0 siblings, 0 replies; 32+ messages in thread
From: Christoph Hellwig @ 2015-12-09 19:32 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-rdma, target-devel, Or Gerlitz, Jenny Derzhavetz,
	Nicholas A. Bellinger

On Wed, Dec 09, 2015 at 02:12:02PM +0200, Sagi Grimberg wrote:
> From: Jenny Derzhavetz <jennyf@mellanox.com>
> 
> This parameter is described as "is mr valid indicator".
> In other words, it indicates whether memory registration
> is valid or not. So intuitive values would be:
> mr_valid=True, when memory registration is valid and
> mr_valid=False otherwise.

Might be worth to rename it to 'bool need_invalidate', but otherwise
looks fine:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 05/10] iser: Have initiator and target to share protocol structures and definitions
  2015-12-09 12:12   ` [PATCH v2 05/10] iser: Have initiator and target to share protocol structures and definitions Sagi Grimberg
@ 2015-12-09 19:33     ` Christoph Hellwig
  0 siblings, 0 replies; 32+ messages in thread
From: Christoph Hellwig @ 2015-12-09 19:33 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-rdma, target-devel, Or Gerlitz, Jenny Derzhavetz,
	Nicholas A. Bellinger

> -/* Constant PDU lengths calculations */
> -#define ISER_HEADERS_LEN  (sizeof(struct iser_hdr) + sizeof(struct iscsi_hdr))
> +/*Constant PDU lengths calculations */

Odd whitespace error.

Otherwise looks fine:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 07/10] iser-target: Declare correct flags when accepting a connection
       [not found]   ` <1449663128-368-8-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-12-09 19:36     ` Christoph Hellwig
       [not found]       ` <20151209193614.GE21477-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Christoph Hellwig @ 2015-12-09 19:36 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Jenny Derzhavetz, Nicholas A. Bellinger

On Wed, Dec 09, 2015 at 02:12:05PM +0200, Sagi Grimberg wrote:
> From: Jenny Derzhavetz <jennyf-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> iser target does not support zero based virtual addresses and
> send with invalidate, so it should declare that it doesn't.

Only mrginally related, but can someone explain what zero based
virtual addresses means in this context?  Does this means it uses
the old RFC5046-style header without the read/write_va fields?
Or does it mean those fields exist but must always be zero?
I couldn't really find a good answer in Annex A12.

Otherwise looks fine:

Reviewed-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
--
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 08/10] iser-target: Support the remote invalidation exception
       [not found]   ` <1449663128-368-9-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-12-09 19:37     ` Christoph Hellwig
  0 siblings, 0 replies; 32+ messages in thread
From: Christoph Hellwig @ 2015-12-09 19:37 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Jenny Derzhavetz, Nicholas A. Bellinger

> +		if (isert_conn->snd_w_inv)
> +			isert_info("Using remote invalidation\n");

Isn't this a little bit too chatty?

Otherwise looks good,

Reviewed-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
--
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 09/10] IB/iser: Increment the rkey when registering and not when invalidating
  2015-12-09 12:12 ` [PATCH v2 09/10] IB/iser: Increment the rkey when registering and not when invalidating Sagi Grimberg
@ 2015-12-09 19:38   ` Christoph Hellwig
  0 siblings, 0 replies; 32+ messages in thread
From: Christoph Hellwig @ 2015-12-09 19:38 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-rdma, target-devel, Or Gerlitz, Jenny Derzhavetz,
	Nicholas A. Bellinger

On Wed, Dec 09, 2015 at 02:12:07PM +0200, Sagi Grimberg wrote:
> With remote invalidate we won't local invalidate
> but we still want to increment the rkey.
> 
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 02/10] IB/iser: Reuse ib_sg_to_pages
       [not found]     ` <20151209192819.GA21477-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
@ 2015-12-10  8:28       ` Sagi Grimberg
  2015-12-10 14:49         ` Christoph Hellwig
  0 siblings, 1 reply; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-10  8:28 UTC (permalink / raw)
  To: Christoph Hellwig, Sagi Grimberg
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Jenny Derzhavetz, Nicholas A. Bellinger



On 09/12/2015 21:28, Christoph Hellwig wrote:
> On Wed, Dec 09, 2015 at 02:12:00PM +0200, Sagi Grimberg wrote:
>> We have in iser iser_sg_to_page_vec which has exactly
>> the same role as ib_sg_to_pages. Customize the page_vec
>> to hold a fake MR so we can reuse ib_sg_to_pages.
>
> Looks good.  In the long run we should simply kill struct ib_fmr
> and make FRMs operate on struct ib_mr so that it can use
> ib_sg_to_pages directly.

We can do that. We'd need to add ib_mr a list member just for fmr
routines.
--
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 03/10] IB/iser: Don't register memory for all immediate data writes
  2015-12-09 19:30   ` Christoph Hellwig
@ 2015-12-10  8:31     ` Sagi Grimberg
  0 siblings, 0 replies; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-10  8:31 UTC (permalink / raw)
  To: Christoph Hellwig, Sagi Grimberg
  Cc: linux-rdma, target-devel, Or Gerlitz, Jenny Derzhavetz,
	Nicholas A. Bellinger



On 09/12/2015 21:30, Christoph Hellwig wrote:
> The iser_reg_rdma_mem calling conventions seem rather confusing,
> and this patch doesn't help that.  But I think that's something
> to be addressed in bigger cleanup later on.

I do plan to rework this area. It would be nice to have it simpler,
But I want to rework the signature API a little bit before I do that.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 07/10] iser-target: Declare correct flags when accepting a connection
       [not found]       ` <20151209193614.GE21477-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
@ 2015-12-10  8:33         ` Sagi Grimberg
  0 siblings, 0 replies; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-10  8:33 UTC (permalink / raw)
  To: Christoph Hellwig, Sagi Grimberg
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Jenny Derzhavetz, Nicholas A. Bellinger



> Only mrginally related, but can someone explain what zero based
> virtual addresses means in this context?  Does this means it uses
> the old RFC5046-style header without the read/write_va fields?
> Or does it mean those fields exist but must always be zero?

That's correct, negotiating this bit means that the iser header
format must not include read/write_va and it is assumed to be 0.
--
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 02/10] IB/iser: Reuse ib_sg_to_pages
  2015-12-10  8:28       ` Sagi Grimberg
@ 2015-12-10 14:49         ` Christoph Hellwig
  0 siblings, 0 replies; 32+ messages in thread
From: Christoph Hellwig @ 2015-12-10 14:49 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: Christoph Hellwig, Sagi Grimberg, linux-rdma, target-devel,
	Or Gerlitz, Jenny Derzhavetz, Nicholas A. Bellinger

On Thu, Dec 10, 2015 at 10:28:59AM +0200, Sagi Grimberg wrote:
> We can do that. We'd need to add ib_mr a list member just for fmr
> routines.

We'll also need that for a FR pool abstraction that would be very
helpful.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] iSER support for remote invalidate
  2015-12-09 12:11 [PATCH v2 00/10] iSER support for remote invalidate Sagi Grimberg
                   ` (8 preceding siblings ...)
  2015-12-09 12:12 ` [PATCH v2 10/10] IB/iser: Support the remote invalidation exception Sagi Grimberg
@ 2015-12-21  4:20 ` Nicholas A. Bellinger
       [not found]   ` <1450671628.25674.27.camel-XoQW25Eq2zviZyQQd+hFbcojREIfoBdhmpATvIKMPHk@public.gmane.org>
  2015-12-24 10:15   ` Christoph Hellwig
  9 siblings, 2 replies; 32+ messages in thread
From: Nicholas A. Bellinger @ 2015-12-21  4:20 UTC (permalink / raw)
  To: Sagi Grimberg; +Cc: linux-rdma, target-devel, Or Gerlitz, Jenny Derzhavetz

Hi Sagi, Jenny & Co,

On Wed, 2015-12-09 at 14:11 +0200, Sagi Grimberg wrote:
> Changes from v1:
> - Fixed change-log typos
> 
> Changes from v0:
> - Rebased on top of 4.4-rc2
> - Removed iser_hello messages from the protocol header
> - Avoided from further breaking the non-existent bidi support
> - Fixed initiator remote invalidate support exposure only
>   for fastreg && iser_always_register
> - Removed patch 2/10 as it's still under testing.
> - Minor line-spacing nitpicks CR comments fixes.
> - Added a FIXME comment to declare our debt to Or and Jason
>   on the awkward device->mr->rkey deref.
> - Piggybacked another patch that reduces some iser code that
>   is now available by the ib_core (ib_sg_to_pages).
> 
> Thanks a lot to all the reviewers!
> 
> Code is available at:
> git@github.com:sagigrimberg/linux.git iser-remote-inv.2
> 
> Jenny Derzhavetz (5):
>   IB/iser: Don't register memory for all immediate data writes
>   IB/iser: set intuitive values for mr_valid
>   iser-target: Declare correct flags when accepting a connection
>   iser-target: Support the remote invalidation exception
>   IB/iser: Support the remote invalidation exception
> 
> Roi Dayan (1):
>   IB/iser: Fix module init not cleaning up on error flow
> 
> Sagi Grimberg (4):
>   IB/iser: Reuse ib_sg_to_pages
>   iser: Have initiator and target to share protocol structures and
>     definitions
>   iser-target: Remove unused file iser_proto.h
>   IB/iser: Increment the rkey when registering and not when invalidating
> 
>  drivers/infiniband/ulp/iser/iscsi_iser.c     |   9 +-
>  drivers/infiniband/ulp/iser/iscsi_iser.h     |  54 +++-------
>  drivers/infiniband/ulp/iser/iser_initiator.c |  70 +++++++++++--
>  drivers/infiniband/ulp/iser/iser_memory.c    | 150 +++++++++------------------
>  drivers/infiniband/ulp/iser/iser_verbs.c     |  30 ++++--
>  drivers/infiniband/ulp/isert/ib_isert.c      |  73 +++++++++----
>  drivers/infiniband/ulp/isert/ib_isert.h      |  40 ++++++-
>  drivers/infiniband/ulp/isert/isert_proto.h   |  47 ---------
>  include/scsi/iser.h                          |  78 ++++++++++++++
>  9 files changed, 322 insertions(+), 229 deletions(-)
>  delete mode 100644 drivers/infiniband/ulp/isert/isert_proto.h
>  create mode 100644 include/scsi/iser.h
> 

Applied to target-pending/for-next as v4.5-rc1 material, along with
Reviewed-by tags from HCH.

Thanks folks.

--nab

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] iSER support for remote invalidate
       [not found]   ` <1450671628.25674.27.camel-XoQW25Eq2zviZyQQd+hFbcojREIfoBdhmpATvIKMPHk@public.gmane.org>
@ 2015-12-21 11:53     ` Or Gerlitz
       [not found]       ` <CAJ3xEMi58s6bWv7cyb+3v3H7e=4t6hRaOX0TvTyXRXLiUjxq+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-12-21 13:27     ` Sagi Grimberg
  1 sibling, 1 reply; 32+ messages in thread
From: Or Gerlitz @ 2015-12-21 11:53 UTC (permalink / raw)
  To: Nicholas A. Bellinger, Sagi Grimberg
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Jenny Derzhavetz

On Mon, Dec 21, 2015 at 6:20 AM, Nicholas A. Bellinger
<nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org> wrote:

> Applied to target-pending/for-next as v4.5-rc1 material, along with
> Reviewed-by tags from HCH.

Hi Nic, thanks for stepping in and picking that.

Sagi, are you going to spin an increment in the initiator version?

Or.
--
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] iSER support for remote invalidate
       [not found]   ` <1450671628.25674.27.camel-XoQW25Eq2zviZyQQd+hFbcojREIfoBdhmpATvIKMPHk@public.gmane.org>
  2015-12-21 11:53     ` Or Gerlitz
@ 2015-12-21 13:27     ` Sagi Grimberg
  1 sibling, 0 replies; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-21 13:27 UTC (permalink / raw)
  To: Nicholas A. Bellinger, Sagi Grimberg, Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Jenny Derzhavetz

Hey Nic,

> Applied to target-pending/for-next as v4.5-rc1 material, along with
> Reviewed-by tags from HCH.

Thanks for picking this up!

Note that I expect this patchset will conflict with Doug's pull request
in case he's taking Christoph's device_attr and CQ abstraction patches
for 4.5.

Doug, would you work with Nic on this?

Sagi.
--
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] iSER support for remote invalidate
       [not found]       ` <CAJ3xEMi58s6bWv7cyb+3v3H7e=4t6hRaOX0TvTyXRXLiUjxq+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-12-21 13:29         ` Sagi Grimberg
       [not found]           ` <5677FEBB.7080904-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-21 13:29 UTC (permalink / raw)
  To: Or Gerlitz, Nicholas A. Bellinger, Sagi Grimberg
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Jenny Derzhavetz


> Sagi, are you going to spin an increment in the initiator version?

I don't know if it's worth a driver version update?

In case we do increment, I can send an incremental patch instead of
re-spinning the entire series.
--
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] iSER support for remote invalidate
       [not found]           ` <5677FEBB.7080904-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2015-12-23 20:53             ` Or Gerlitz
  2016-01-04  6:38               ` Or Gerlitz
  0 siblings, 1 reply; 32+ messages in thread
From: Or Gerlitz @ 2015-12-23 20:53 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: Nicholas A. Bellinger, Sagi Grimberg,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Jenny Derzhavetz

On Mon, Dec 21, 2015 at 3:29 PM, Sagi Grimberg <sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:

>> Sagi, are you going to spin an increment in the initiator version?

> I don't know if it's worth a driver version update?

yes, I think it does. Finally we're getting real close to the visions
of the spec authors...  do you have some performance data showing the
gain of remote invalidation on certain HWs and IO benchmarks patterns.
Did we make sure to interoperate between patched initiator to
unpatched LIO or other targets which don't have this now (SCST, TGT)
and the other way around (unpatched initiator, patched LIO)?

> In case we do increment, I can send an incremental patch instead of
> re-spinning the entire series.

lets do that.
--
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] iSER support for remote invalidate
  2015-12-21  4:20 ` [PATCH v2 00/10] iSER support for remote invalidate Nicholas A. Bellinger
       [not found]   ` <1450671628.25674.27.camel-XoQW25Eq2zviZyQQd+hFbcojREIfoBdhmpATvIKMPHk@public.gmane.org>
@ 2015-12-24 10:15   ` Christoph Hellwig
       [not found]     ` <20151224101514.GB6438-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
  1 sibling, 1 reply; 32+ messages in thread
From: Christoph Hellwig @ 2015-12-24 10:15 UTC (permalink / raw)
  To: Nicholas A. Bellinger
  Cc: Sagi Grimberg, linux-rdma, target-devel, Or Gerlitz, Jenny Derzhavetz

> Applied to target-pending/for-next as v4.5-rc1 material, along with
> Reviewed-by tags from HCH.

So this is both in your and Dougs now it seems.  Given the non-trivial
merge with the other RDMA updates I'd suggest to drop it from the
target tree as Doug already sorted out the merge.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] iSER support for remote invalidate
       [not found]     ` <20151224101514.GB6438-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
@ 2015-12-24 10:22       ` Sagi Grimberg
       [not found]         ` <567BC782.7090501-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Sagi Grimberg @ 2015-12-24 10:22 UTC (permalink / raw)
  To: Christoph Hellwig, Nicholas A. Bellinger
  Cc: Sagi Grimberg, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Jenny Derzhavetz


>> Applied to target-pending/for-next as v4.5-rc1 material, along with
>> Reviewed-by tags from HCH.
>
> So this is both in your and Dougs now it seems.  Given the non-trivial
> merge with the other RDMA updates I'd suggest to drop it from the
> target tree as Doug already sorted out the merge.

Yea, this conflicts with the CQ API stuff. Doug and I sorting it out.

Thanks,
Sagi.
--
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] iSER support for remote invalidate
  2015-12-23 20:53             ` Or Gerlitz
@ 2016-01-04  6:38               ` Or Gerlitz
  0 siblings, 0 replies; 32+ messages in thread
From: Or Gerlitz @ 2016-01-04  6:38 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: Nicholas A. Bellinger, Sagi Grimberg, linux-rdma, target-devel,
	Or Gerlitz, Jenny Derzhavetz

On Wed, Dec 23, 2015 at 10:53 PM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
> On Mon, Dec 21, 2015 at 3:29 PM, Sagi Grimberg <sagig@dev.mellanox.co.il> wrote:
>
>>> Sagi, are you going to spin an increment in the initiator version?
>
>> I don't know if it's worth a driver version update?
>
> yes, I think it does. Finally we're getting real close to the visions
> of the spec authors...  do you have some performance data showing the
> gain of remote invalidation on certain HWs and IO benchmarks patterns.
> Did we make sure to interoperate between patched initiator to
> unpatched LIO or other targets which don't have this now (SCST, TGT)
> and the other way around (unpatched initiator, patched LIO)?


Sagi?


>> In case we do increment, I can send an incremental patch instead of
>> re-spinning the entire series.
>
> lets do that.

lets

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] iSER support for remote invalidate
       [not found]         ` <567BC782.7090501-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2016-01-06 18:43           ` Nicholas A. Bellinger
  2016-01-07 15:26             ` Sagi Grimberg
  0 siblings, 1 reply; 32+ messages in thread
From: Nicholas A. Bellinger @ 2016-01-06 18:43 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: Christoph Hellwig, Sagi Grimberg,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Jenny Derzhavetz

On Thu, 2015-12-24 at 12:22 +0200, Sagi Grimberg wrote:
> >> Applied to target-pending/for-next as v4.5-rc1 material, along with
> >> Reviewed-by tags from HCH.
> >
> > So this is both in your and Dougs now it seems.  Given the non-trivial
> > merge with the other RDMA updates I'd suggest to drop it from the
> > target tree as Doug already sorted out the merge.
> 
> Yea, this conflicts with the CQ API stuff. Doug and I sorting it out.
> 

FYI, the only conflict as reported in linux-next last week is with nfsd
tree and "IB: merge struct ib_device_attr into struct ib_device" here:

http://marc.info/?l=linux-next&m=145155049101826&w=2

It looks like there is ongoing discussion this morning wrt rdma + nfsd
trees..

Do you still want this series dropped from target-pending/for-next..?







--
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] iSER support for remote invalidate
  2016-01-06 18:43           ` Nicholas A. Bellinger
@ 2016-01-07 15:26             ` Sagi Grimberg
  0 siblings, 0 replies; 32+ messages in thread
From: Sagi Grimberg @ 2016-01-07 15:26 UTC (permalink / raw)
  To: Nicholas A. Bellinger
  Cc: Christoph Hellwig, Sagi Grimberg, linux-rdma, target-devel,
	Or Gerlitz, Jenny Derzhavetz


> FYI, the only conflict as reported in linux-next last week is with nfsd
> tree and "IB: merge struct ib_device_attr into struct ib_device" here:
>
> http://marc.info/?l=linux-next&m=145155049101826&w=2
>
> It looks like there is ongoing discussion this morning wrt rdma + nfsd
> trees..
>
> Do you still want this series dropped from target-pending/for-next..?

Given that the series was modified on top of the CQ API work then it
makes better sense yes. Doug will take it.

Thanks Nic.

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2016-01-07 15:26 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 12:11 [PATCH v2 00/10] iSER support for remote invalidate Sagi Grimberg
2015-12-09 12:12 ` [PATCH v2 02/10] IB/iser: Reuse ib_sg_to_pages Sagi Grimberg
2015-12-09 19:28   ` Christoph Hellwig
     [not found]     ` <20151209192819.GA21477-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2015-12-10  8:28       ` Sagi Grimberg
2015-12-10 14:49         ` Christoph Hellwig
2015-12-09 12:12 ` [PATCH v2 03/10] IB/iser: Don't register memory for all immediate data writes Sagi Grimberg
2015-12-09 19:30   ` Christoph Hellwig
2015-12-10  8:31     ` Sagi Grimberg
2015-12-09 12:12 ` [PATCH v2 04/10] IB/iser: set intuitive values for mr_valid Sagi Grimberg
2015-12-09 19:32   ` Christoph Hellwig
     [not found] ` <1449663128-368-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-09 12:11   ` [PATCH v2 01/10] IB/iser: Fix module init not cleaning up on error flow Sagi Grimberg
2015-12-09 12:12   ` [PATCH v2 05/10] iser: Have initiator and target to share protocol structures and definitions Sagi Grimberg
2015-12-09 19:33     ` Christoph Hellwig
2015-12-09 12:12 ` [PATCH v2 06/10] iser-target: Remove unused file iser_proto.h Sagi Grimberg
2015-12-09 12:12 ` [PATCH v2 07/10] iser-target: Declare correct flags when accepting a connection Sagi Grimberg
     [not found]   ` <1449663128-368-8-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-09 19:36     ` Christoph Hellwig
     [not found]       ` <20151209193614.GE21477-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2015-12-10  8:33         ` Sagi Grimberg
2015-12-09 12:12 ` [PATCH v2 08/10] iser-target: Support the remote invalidation exception Sagi Grimberg
     [not found]   ` <1449663128-368-9-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-09 19:37     ` Christoph Hellwig
2015-12-09 12:12 ` [PATCH v2 09/10] IB/iser: Increment the rkey when registering and not when invalidating Sagi Grimberg
2015-12-09 19:38   ` Christoph Hellwig
2015-12-09 12:12 ` [PATCH v2 10/10] IB/iser: Support the remote invalidation exception Sagi Grimberg
2015-12-21  4:20 ` [PATCH v2 00/10] iSER support for remote invalidate Nicholas A. Bellinger
     [not found]   ` <1450671628.25674.27.camel-XoQW25Eq2zviZyQQd+hFbcojREIfoBdhmpATvIKMPHk@public.gmane.org>
2015-12-21 11:53     ` Or Gerlitz
     [not found]       ` <CAJ3xEMi58s6bWv7cyb+3v3H7e=4t6hRaOX0TvTyXRXLiUjxq+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-21 13:29         ` Sagi Grimberg
     [not found]           ` <5677FEBB.7080904-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-23 20:53             ` Or Gerlitz
2016-01-04  6:38               ` Or Gerlitz
2015-12-21 13:27     ` Sagi Grimberg
2015-12-24 10:15   ` Christoph Hellwig
     [not found]     ` <20151224101514.GB6438-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2015-12-24 10:22       ` Sagi Grimberg
     [not found]         ` <567BC782.7090501-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-01-06 18:43           ` Nicholas A. Bellinger
2016-01-07 15:26             ` Sagi Grimberg

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.