From: "Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>
To: Greg Sword <gregsword0@gmail.com>
Cc: "zyjzyj2000@gmail.com" <zyjzyj2000@gmail.com>,
"jgg@ziepe.ca" <jgg@ziepe.ca>,
"leon@kernel.org" <leon@kernel.org>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"rpearsonhpe@gmail.com" <rpearsonhpe@gmail.com>,
"Daisuke Matsuda (Fujitsu)" <matsuda-daisuke@fujitsu.com>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"yi.zhang@redhat.com" <yi.zhang@redhat.com>
Subject: Re: [PATCH RFC V2 0/6] rxe_map_mr_sg() fix cleanup and refactor
Date: Mon, 6 Nov 2023 09:55:27 +0000 [thread overview]
Message-ID: <f4b7cce6-ac65-4ffb-b972-5e784db939c8@fujitsu.com> (raw)
In-Reply-To: <CAEz=LcuKpkTfGZ44Kf3YamK=roa-OC=j47ZcHeLsuFe+FqOnaA@mail.gmail.com>
On 06/11/2023 17:35, Greg Sword wrote:
> On Mon, Nov 6, 2023 at 4:01 PM Zhijian Li (Fujitsu)
> <lizhijian@fujitsu.com> wrote:
>>
>>
>>
>> Very thanks for all your feedback.
>>
>> On 03/11/2023 17:55, Li Zhijian wrote:
>>> I don't collect the Reviewed-by to the patch1-2 this time, since i
>>> think we can make it better.
>>>
>>> Patch1-2: Fix kernel panic[1] and benifit to make srp work again.
>>> Almost nothing change from V1.
>>
>> Quote from Jason:
>> "
>>> The concept was that the xarray could store anything larger than
>>> PAGE_SIZE and the entry would point at the first struct page of the
>>> contiguous chunk
>>>
>>> That looks like it is right, or at least close to right, so lets try
>>> to keep it
>> "
>>
>>
>> It seems it's okay to access address/memory across pages on RXE even though
>> we only map the first page.
>
> Do you really make tests in your test environment? Do you have test environment?
> Do you really reproduce this problem in your test environment?
I did the test, the kernel panic[1] is gone after patch1-patch2
Thanks
Zhijian
> Your patches do not work actually. Please do not send these rubbish patches out.
>
>>
>> That also means PAGE_SIZE aligned MR is already supported, so only check
>> `if (IS_ALIGNED(page_size, PAGE_SIZE))` is sufficient, right?
>>
>> diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
>> index f54042e9aeb2..3755e530e6dc 100644
>> --- a/drivers/infiniband/sw/rxe/rxe_mr.c
>> +++ b/drivers/infiniband/sw/rxe/rxe_mr.c
>> @@ -234,6 +234,12 @@ int rxe_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sgl,
>> struct rxe_mr *mr = to_rmr(ibmr);
>> unsigned int page_size = mr_page_size(mr);
>>
>> + if (!IS_ALIGNED(page_size, PAGE_SIZE)) {
>> + rxe_err_mr(mr, "FIXME...\n")
>> + return -EINVAL;
>> + }
>> +
>> mr->nbuf = 0;
>> mr->page_shift = ilog2(page_size);
>> mr->page_mask = ~((u64)page_size - 1);
>> diff --git a/drivers/infiniband/sw/rxe/rxe_param.h b/drivers/infiniband/sw/rxe/rxe_param.h
>> index d2f57ead78ad..b1cf1e1c0ce1 100644
>> --- a/drivers/infiniband/sw/rxe/rxe_param.h
>> +++ b/drivers/infiniband/sw/rxe/rxe_param.h
>> @@ -38,7 +38,7 @@ static inline enum ib_mtu eth_mtu_int_to_enum(int mtu)
>> /* default/initial rxe device parameter settings */
>> enum rxe_device_param {
>> RXE_MAX_MR_SIZE = -1ull,
>> - RXE_PAGE_SIZE_CAP = 0xfffff000,
>> + RXE_PAGE_SIZE_CAP = 0xffffffff - (PAGE_SIZE - 1),
>> RXE_MAX_QP_WR = DEFAULT_MAX_VALUE,
>> RXE_DEVICE_CAP_FLAGS = IB_DEVICE_BAD_PKEY_CNTR
>> | IB_DEVICE_BAD_QKEY_CNTR
>>
>>
>> * minor cleanup will be done after this.
>>
>> Thanks
>> Zhijian
>>
>>> Patch3-5: cleanups # newly add
>>> Patch6: make RXE support PAGE_SIZE aligned mr # newly add, but not fully tested
>>>
>>> My bad arm64 mechine offten hangs when doing blktests even though i use the
>>> default siw driver.
>>>
>>> - nvme and ULPs(rtrs, iser) always registers 4K mr still don't supported yet.
>>>
>>> [1] https://lore.kernel.org/all/CAHj4cs9XRqE25jyVw9rj9YugffLn5+f=1znaBEnu1usLOciD+g@mail.gmail.com/T/
>>>
>>> Li Zhijian (6):
>>> RDMA/rxe: RDMA/rxe: don't allow registering !PAGE_SIZE mr
>>> RDMA/rxe: set RXE_PAGE_SIZE_CAP to PAGE_SIZE
>>> RDMA/rxe: remove unused rxe_mr.page_shift
>>> RDMA/rxe: Use PAGE_SIZE and PAGE_SHIFT to extract address from
>>> page_list
>>> RDMA/rxe: cleanup rxe_mr.{page_size,page_shift}
>>> RDMA/rxe: Support PAGE_SIZE aligned MR
>>>
>>> drivers/infiniband/sw/rxe/rxe_mr.c | 80 ++++++++++++++++-----------
>>> drivers/infiniband/sw/rxe/rxe_param.h | 2 +-
>>> drivers/infiniband/sw/rxe/rxe_verbs.h | 9 ---
>>> 3 files changed, 48 insertions(+), 43 deletions(-)
>>>
prev parent reply other threads:[~2023-11-06 9:55 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 9:55 Li Zhijian
2023-11-03 9:55 ` [PATCH RFC V2 1/6] RDMA/rxe: RDMA/rxe: don't allow registering !PAGE_SIZE mr Li Zhijian
2023-11-03 10:14 ` Greg Sword
2023-11-03 9:55 ` [PATCH RFC V2 2/6] RDMA/rxe: set RXE_PAGE_SIZE_CAP to PAGE_SIZE Li Zhijian
2023-11-03 9:55 ` [PATCH RFC V2 3/6] RDMA/rxe: remove unused rxe_mr.page_shift Li Zhijian
2023-11-03 9:55 ` [PATCH RFC V2 4/6] RDMA/rxe: Use PAGE_SIZE and PAGE_SHIFT to extract address from page_list Li Zhijian
2023-11-03 17:59 ` Jason Gunthorpe
2023-11-03 9:55 ` [PATCH RFC V2 5/6] RDMA/rxe: cleanup rxe_mr.{page_size,page_shift} Li Zhijian
2023-11-03 9:55 ` [PATCH RFC V2 6/6] RDMA/rxe: Support PAGE_SIZE aligned MR Li Zhijian
2023-11-03 15:04 ` Bart Van Assche
2023-11-06 3:07 ` Zhijian Li (Fujitsu)
2023-11-03 10:17 ` [PATCH RFC V2 0/6] rxe_map_mr_sg() fix cleanup and refactor Greg Sword
2023-11-06 3:46 ` Zhijian Li (Fujitsu)
2023-11-03 13:00 ` Zhu Yanjun
2023-11-06 4:07 ` Zhijian Li (Fujitsu)
2023-11-06 13:58 ` Zhu Yanjun
2023-11-09 2:24 ` Zhijian Li (Fujitsu)
2023-11-09 6:36 ` Zhu Yanjun
2023-11-09 7:16 ` Greg Sword
2023-11-09 7:26 ` Zhijian Li (Fujitsu)
2023-11-09 13:10 ` Jason Gunthorpe
2023-11-06 14:13 ` Jason Gunthorpe
2023-11-06 7:59 ` Zhijian Li (Fujitsu)
2023-11-06 9:35 ` Greg Sword
2023-11-06 9:55 ` Zhijian Li (Fujitsu) [this message]
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=f4b7cce6-ac65-4ffb-b972-5e784db939c8@fujitsu.com \
--to=lizhijian@fujitsu.com \
--cc=bvanassche@acm.org \
--cc=gregsword0@gmail.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=matsuda-daisuke@fujitsu.com \
--cc=rpearsonhpe@gmail.com \
--cc=yi.zhang@redhat.com \
--cc=zyjzyj2000@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®