From: santosh shilimkar <santosh.shilimkar@oracle.com>
To: Sagi Grimberg <sagig@mellanox.com>,
Sagi Grimberg <sagig@dev.mellanox.co.il>,
linux-rdma@vger.kernel.org
Cc: linux-nfs@vger.kernel.org, "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Subject: Re: [PATCH v1 00/24] New fast registration API
Date: Tue, 22 Sep 2015 11:23:29 -0700 [thread overview]
Message-ID: <56019CA1.5010703@oracle.com> (raw)
In-Reply-To: <560109B7.8070005@mellanox.com>
On 9/22/2015 12:56 AM, Sagi Grimberg wrote:
> On 9/22/2015 10:19 AM, Sagi Grimberg wrote:
>>>
>>> As mentioned earlier, I have a WIP RDS fastreg branch [3]
>>> which is functional (at least I can RDMA messages across
>>> nodes ;-)).
>>
>> Nice!
>>
>>> So merging [2] and [3], I created [4] and applied
>>> a delta change based on your other patches. I saw ib_post_send
>>> failure with my HCA driver returning '-EINVAL'. I didn't
>>> debug it further but at least opcode and num_sge were set
>>> correctly so I shouldn't have seen it. So I did memset()
>>> on reg_wr which seems to have helped to fix the ib_post_send()
>>> failure.
>>
>> Yep - that was my fault. When converting the ULPs I optimized by
>> removing the memset but I forgot to set reg_wr.wr.next = NULL when
>> the ULP needed. This caused the driver to read a second bogus work
>> request. Steve just reported this as well so I'll fix that in v2.
>>
Ahh, right. There can be chain of wr.
>>>
>>> But I got into remote access errors which tells me that I
>>> have messed up setup(rkey, sge setup or access flags)
>>
>> One thing that pops is that in the old API the MR was registered
>> with iova_start = 0 (which is probably what was sent to the peer),
>> but the new API the iova is implicitly sg_dma_address(&sg[0]).
>>
>> The registered MR holds these attributes in:
>> mr->rkey
>> mr->iova
>> mr->length
>>
>> These should be passed to a peer to perform rdma.
>>
right.
> ohh, I just read the RDS 3.1 specification (for the first time..) and I
> noticed that RDS 3.1 header extension contains only a 32bit offset
> parameter. Why is that anyway? why not 64bit so it can be a valid mapped
> address? Also the code doesn't use it at all and always passes 0 (which
> is buggy if sg[0] has an offset from a page).
>
> This won't work with the proposed API as the iova is 64bit (as all other
> existing RDMA protocols use 64bit addresses).
>
> In any event, I'd much rather to add ib_map_mr_sg_zbva() just for RDS
> to use instead of polluting the API with an iova argument, but I think
> that the RDS spec can be updated to use 64bit offsets and align to all
> other RDMA protocols (it has enough space in h_exthdr which is 128bit).
>
RDS assumes it's an offset and hence it has been used as 32 bit. I need
to look through this carefully though because all the existing
application use this header format. There is also RDMA read/write
byte information sent as part of the header(Not in upstream code yet)
so the space might be less. But point taken. Will look into it.
> I was thinking of:
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index e7e0251..61fcab4 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -3033,6 +3033,21 @@ int ib_map_mr_sg(struct ib_mr *mr,
> unsigned int sg_nents,
> unsigned int page_size);
>
> +static inline int
> +ib_map_mr_sg_zbva(struct ib_mr *mr,
> + struct scatterlist *sg,
> + unsigned int sg_nents,
> + unsigned int page_size)
> +{
> + int rc;
> +
> + rc = ib_map_mr_sg(mr, sg, sg_nents, page_size);
> + if (likely(!rc))
> + mr->iova &= ((u64)page_size - 1);
> +
> + return rc;
> +}
> +
> int ib_sg_to_pages(struct ib_mr *mr,
> struct scatterlist *sgl,
> unsigned int sg_nents,
> --
>
> Thoughts?
>
> Santosh, can you use that one instead and let us know if
> it resolves your issue?
>
Unfortunately this change still doesn't fix the issue.
> I think you should make sure to correctly construct the
> h_exthdr with: rds_rdma_make_cookie(mr->rkey, (32)mr->iova)
Will look into it. Thanks for suggestion.
Regards,
Santosh
WARNING: multiple messages have this Message-ID (diff)
From: santosh shilimkar <santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Sagi Grimberg
<sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Nicholas A. Bellinger"
<nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
Subject: Re: [PATCH v1 00/24] New fast registration API
Date: Tue, 22 Sep 2015 11:23:29 -0700 [thread overview]
Message-ID: <56019CA1.5010703@oracle.com> (raw)
In-Reply-To: <560109B7.8070005-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
On 9/22/2015 12:56 AM, Sagi Grimberg wrote:
> On 9/22/2015 10:19 AM, Sagi Grimberg wrote:
>>>
>>> As mentioned earlier, I have a WIP RDS fastreg branch [3]
>>> which is functional (at least I can RDMA messages across
>>> nodes ;-)).
>>
>> Nice!
>>
>>> So merging [2] and [3], I created [4] and applied
>>> a delta change based on your other patches. I saw ib_post_send
>>> failure with my HCA driver returning '-EINVAL'. I didn't
>>> debug it further but at least opcode and num_sge were set
>>> correctly so I shouldn't have seen it. So I did memset()
>>> on reg_wr which seems to have helped to fix the ib_post_send()
>>> failure.
>>
>> Yep - that was my fault. When converting the ULPs I optimized by
>> removing the memset but I forgot to set reg_wr.wr.next = NULL when
>> the ULP needed. This caused the driver to read a second bogus work
>> request. Steve just reported this as well so I'll fix that in v2.
>>
Ahh, right. There can be chain of wr.
>>>
>>> But I got into remote access errors which tells me that I
>>> have messed up setup(rkey, sge setup or access flags)
>>
>> One thing that pops is that in the old API the MR was registered
>> with iova_start = 0 (which is probably what was sent to the peer),
>> but the new API the iova is implicitly sg_dma_address(&sg[0]).
>>
>> The registered MR holds these attributes in:
>> mr->rkey
>> mr->iova
>> mr->length
>>
>> These should be passed to a peer to perform rdma.
>>
right.
> ohh, I just read the RDS 3.1 specification (for the first time..) and I
> noticed that RDS 3.1 header extension contains only a 32bit offset
> parameter. Why is that anyway? why not 64bit so it can be a valid mapped
> address? Also the code doesn't use it at all and always passes 0 (which
> is buggy if sg[0] has an offset from a page).
>
> This won't work with the proposed API as the iova is 64bit (as all other
> existing RDMA protocols use 64bit addresses).
>
> In any event, I'd much rather to add ib_map_mr_sg_zbva() just for RDS
> to use instead of polluting the API with an iova argument, but I think
> that the RDS spec can be updated to use 64bit offsets and align to all
> other RDMA protocols (it has enough space in h_exthdr which is 128bit).
>
RDS assumes it's an offset and hence it has been used as 32 bit. I need
to look through this carefully though because all the existing
application use this header format. There is also RDMA read/write
byte information sent as part of the header(Not in upstream code yet)
so the space might be less. But point taken. Will look into it.
> I was thinking of:
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index e7e0251..61fcab4 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -3033,6 +3033,21 @@ int ib_map_mr_sg(struct ib_mr *mr,
> unsigned int sg_nents,
> unsigned int page_size);
>
> +static inline int
> +ib_map_mr_sg_zbva(struct ib_mr *mr,
> + struct scatterlist *sg,
> + unsigned int sg_nents,
> + unsigned int page_size)
> +{
> + int rc;
> +
> + rc = ib_map_mr_sg(mr, sg, sg_nents, page_size);
> + if (likely(!rc))
> + mr->iova &= ((u64)page_size - 1);
> +
> + return rc;
> +}
> +
> int ib_sg_to_pages(struct ib_mr *mr,
> struct scatterlist *sgl,
> unsigned int sg_nents,
> --
>
> Thoughts?
>
> Santosh, can you use that one instead and let us know if
> it resolves your issue?
>
Unfortunately this change still doesn't fix the issue.
> I think you should make sure to correctly construct the
> h_exthdr with: rds_rdma_make_cookie(mr->rkey, (32)mr->iova)
Will look into it. Thanks for suggestion.
Regards,
Santosh
--
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
next prev parent reply other threads:[~2015-09-22 18:23 UTC|newest]
Thread overview: 134+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-17 9:42 [PATCH v1 00/24] New fast registration API Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 01/24] IB/core: Introduce new " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-22 21:21 ` Bart Van Assche
2015-09-22 21:21 ` Bart Van Assche
2015-09-24 7:37 ` Sagi Grimberg
2015-09-24 7:37 ` Sagi Grimberg
2015-09-28 20:57 ` Bart Van Assche
2015-09-28 20:57 ` Bart Van Assche
2015-09-29 5:59 ` Christoph Hellwig
2015-09-29 5:59 ` Christoph Hellwig
2015-09-29 6:47 ` Sagi Grimberg
2015-09-29 6:47 ` Sagi Grimberg
2015-09-29 6:49 ` Sagi Grimberg
2015-09-29 6:49 ` Sagi Grimberg
2015-09-29 6:42 ` Sagi Grimberg
2015-09-29 6:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 02/24] IB/mlx5: Remove dead fmr code Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-22 21:24 ` Bart Van Assche
2015-09-22 21:24 ` Bart Van Assche
2015-09-17 9:42 ` [PATCH v1 03/24] IB/mlx5: Support the new memory registration API Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-22 21:27 ` Bart Van Assche
2015-09-22 21:27 ` Bart Van Assche
2015-09-24 7:39 ` Sagi Grimberg
2015-09-24 7:39 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 04/24] IB/mlx4: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 05/24] RDMA/ocrdma: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 06/24] RDMA/cxgb3: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 07/24] iw_cxgb4: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 08/24] IB/qib: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 09/24] RDMA/nes: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 10/24] IB/iser: Port to new fast " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 11/24] iser-target: Port to new memory " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 12/24] xprtrdma: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 13/24] svcrdma: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 14/24] RDS/IW: Convert " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 15/24] IB/srp: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-22 21:58 ` Bart Van Assche
2015-09-22 21:58 ` Bart Van Assche
2015-09-24 9:06 ` Sagi Grimberg
2015-09-24 9:06 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 16/24] IB/mlx5: Remove old FRWR API support Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 17/24] IB/mlx4: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 18/24] RDMA/ocrdma: Remove old FRWR API Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 19/24] RDMA/cxgb3: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 20/24] iw_cxgb4: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 21/24] IB/qib: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 22/24] RDMA/nes: " Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 23/24] IB/hfi1: Remove Old fast registraion API support Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-17 9:42 ` [PATCH v1 24/24] IB/core: Remove old fast registration API Sagi Grimberg
2015-09-17 9:42 ` Sagi Grimberg
2015-09-19 22:45 ` [PATCH v1 00/24] New " Christoph Hellwig
2015-09-19 22:45 ` Christoph Hellwig
2015-09-24 6:53 ` Sagi Grimberg
2015-09-24 6:53 ` Sagi Grimberg
2015-09-24 13:39 ` Christoph Hellwig
2015-09-24 13:39 ` Christoph Hellwig
2015-09-19 23:20 ` santosh.shilimkar
2015-09-19 23:20 ` santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA
2015-09-20 9:36 ` Sagi Grimberg
2015-09-20 9:36 ` Sagi Grimberg
2015-09-21 23:28 ` santosh.shilimkar
2015-09-21 23:28 ` santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA
2015-09-22 7:19 ` Sagi Grimberg
2015-09-22 7:19 ` Sagi Grimberg
2015-09-22 7:56 ` Sagi Grimberg
2015-09-22 7:56 ` Sagi Grimberg
2015-09-22 18:23 ` santosh shilimkar [this message]
2015-09-22 18:23 ` santosh shilimkar
2015-09-22 21:22 ` Bart Van Assche
2015-09-22 21:22 ` Bart Van Assche
2015-09-24 7:40 ` Sagi Grimberg
2015-09-24 7:40 ` Sagi Grimberg
2015-09-29 19:03 ` Bart Van Assche
2015-09-29 19:03 ` Bart Van Assche
2015-09-29 20:58 ` Sagi Grimberg
2015-09-29 20:58 ` Sagi Grimberg
2015-09-30 6:47 ` Sagi Grimberg
2015-09-30 6:47 ` Sagi Grimberg
2015-09-30 18:59 ` Bart Van Assche
2015-09-30 18:59 ` Bart Van Assche
2015-09-30 20:15 ` Bart Van Assche
2015-09-30 20:15 ` Bart Van Assche
2015-10-01 7:16 ` Sagi Grimberg
2015-10-01 7:16 ` Sagi Grimberg
2015-10-01 17:53 ` Bart Van Assche
2015-10-01 17:53 ` Bart Van Assche
2015-10-01 20:58 ` Bart Van Assche
2015-10-01 20:58 ` Bart Van Assche
[not found] ` <35618B90-4D6E-4036-A69B-4405F020D440@dev.mellanox.co.il>
2015-10-02 15:37 ` Bart Van Assche
2015-10-02 15:37 ` Bart Van Assche
2015-10-06 8:37 ` Sagi Grimberg
2015-10-06 8:37 ` Sagi Grimberg
2015-10-06 18:49 ` Bart Van Assche
2015-10-06 18:49 ` Bart Van Assche
2015-10-07 6:42 ` Sagi Grimberg
2015-10-07 6:42 ` Sagi Grimberg
2015-10-07 15:46 ` Bart Van Assche
2015-10-07 15:46 ` Bart Van Assche
2015-10-07 15:48 ` Sagi Grimberg
2015-10-07 15:48 ` Sagi Grimberg
2015-10-07 9:20 ` Christoph Hellwig
2015-10-07 9:20 ` Christoph Hellwig
2015-10-07 9:25 ` Sagi Grimberg
2015-10-07 9:25 ` Sagi Grimberg
2015-10-07 9:36 ` Christoph Hellwig
2015-10-07 9:36 ` Christoph Hellwig
2015-10-07 10:00 ` Sagi Grimberg
2015-10-07 10:00 ` Sagi Grimberg
2015-10-07 16:30 ` Bart Van Assche
2015-10-07 16:30 ` Bart Van Assche
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=56019CA1.5010703@oracle.com \
--to=santosh.shilimkar@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=sagig@dev.mellanox.co.il \
--cc=sagig@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.