[Stgt-devel] [PATCH 2/2] IB/iSER: Use offset from r2t header for rdma

Eli Dorfman dorfman.eli
Sun Apr 27 14:55:00 CEST 2008


Use offset from r2t header for rdma instead of using
internal offset counter.

Signed-off-by: Eli Dorfman <elid at voltaire.com>
---
 usr/iscsi/iscsi_rdma.c |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/usr/iscsi/iscsi_rdma.c b/usr/iscsi/iscsi_rdma.c
index d46ddff..84f5949 100644
--- a/usr/iscsi/iscsi_rdma.c
+++ b/usr/iscsi/iscsi_rdma.c
@@ -1447,28 +1447,22 @@ static int iscsi_rdma_rdma_read(struct
iscsi_connection *conn)
 	struct iscsi_r2t_rsp *r2t = (struct iscsi_r2t_rsp *) &conn->rsp.bhs;
 	uint8_t *buf;
 	uint32_t len;
+	uint32_t offset;
 	int ret;

 	buf = (uint8_t *) task->data + task->offset;
 	len = be32_to_cpu(r2t->data_length);
+	offset = be32_to_cpu(r2t->data_offset);

-	dprintf("len %u stag %x va %llx\n",
+	dprintf("len %u stag %x va %llx offset %x\n",
 		len, itask->rem_write_stag,
-		(unsigned long long) itask->rem_write_va);
+		(unsigned long long) itask->rem_write_va, offset);

 	ret = iser_post_rdma_wr(ci, task, buf, len, IBV_WR_RDMA_READ,
-				itask->rem_write_va, itask->rem_write_stag);
+				itask->rem_write_va + offset, itask->rem_write_stag);
 	if (ret < 0)
 		return ret;

-	/*
-	 * Initiator registers the entire buffer, but gives us a VA that
-	 * is advanced by immediate + unsolicited data amounts.  Advance
-	 * rem_va as we read, knowing that the target always grabs segments
-	 * in order.
-	 */
-	itask->rem_write_va += len;
-
 	return 0;
 }

-- 
1.5.5



More information about the stgt mailing list