[Stgt-devel] [PATCH 2/2] IB/iSER: Use offset from r2t header for rdma
Eli Dorfman
dorfman.eli
Thu May 1 16:32:13 CEST 2008
On Sun, Apr 27, 2008 at 3:55 PM, Eli Dorfman <dorfman.eli at gmail.com> wrote:
> 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
>
Please do not apply this patch until we decide how to sync this with
the initiator side.
See the following discussion for details:
http://www.ietf.org/mail-archive/web/ips/current/msg02506.html
I tend to agree with Pete's option (3) implementing iSER HELLO message
in the initiator and target.
Then adding this patch and the corresponding initiator patch so that we have:
Old initiator working with old target, AND
New initiator working with new target.
Eli
More information about the stgt
mailing list