Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: Tom Talpey <tom@talpey.com>,
	"Daisuke Matsuda (Fujitsu)" <matsuda-daisuke@fujitsu.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"zyjzyj2000@gmail.com" <zyjzyj2000@gmail.com>,
	"leonro@nvidia.com" <leonro@nvidia.com>,
	"yangx.jy@fujitsu.com" <yangx.jy@fujitsu.com>,
	"lizhijian@fujitsu.com" <lizhijian@fujitsu.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH for-next v3] Subject: RDMA/rxe: Handle zero length rdma
Date: Wed, 1 Feb 2023 21:45:53 -0600	[thread overview]
Message-ID: <0cb0e3e1-de90-3267-5a84-082321a10d9d@gmail.com> (raw)
In-Reply-To: <24a30a4b-ab51-b24a-7976-eeefabb99619@talpey.com>

On 2/1/23 09:38, Tom Talpey wrote:
> On 2/1/2023 6:06 AM, Daisuke Matsuda (Fujitsu) wrote:
>> On Sat, Jan 28, 2023 6:10 AM Bob Pearson wrote:
>>>
>>> Currently the rxe driver does not handle all cases of zero length
>>> rdma operations correctly. The client does not have to provide an
>>> rkey for zero length RDMA operations so the rkey provided may be
>>> invalid and should not be used to lookup an mr.
>>>
>>> This patch corrects the driver to ignore the provided rkey if the
>>> reth length is zero and make sure to set the mr to NULL. In read_reply()
>>> if length is zero rxe_recheck_mr() is not called. Warnings are added in
>>> the routines in rxe_mr.c to catch NULL MRs when the length is non-zero.
>>>
>>> Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
>>> ---
>>
>> When I applied this change, a testcase in rdma-core failed as shown below:
>> ======================================================================
>> ERROR: test_qp_ex_rc_flush (tests.test_qpex.QpExTestCase)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>    File "/root/rdma-core/tests/test_qpex.py", line 258, in test_qp_ex_rc_flush
>>      raise PyverbsError(f'Unexpected {wc_status_to_str(wcs[0].status)}')
>> pyverbs.pyverbs_error.PyverbsError: Unexpected Remote access error
>>
>> ----------------------------------------------------------------------
>>
>> In my opinion, your change makes sense within the range of traditional
>> RDMA operations, but conflicts with the new RDMA FLUSH operation.
>> Responder cannot access the target MR because of invalid rkey. The
>> root cause is written in IBA Annex A19, especially 'oA19-2'.
>> We thus cannot set qp->resp.rkey to 0 in qp_resp_from_reth().
>>
>> Do you have anything to say about this? > Li Zhijian
>>
>> Thanks,
>> Daisuke Matsuda
> 
> I'm confused too, Bob can you point to the section of the spec
> that allows the rkey to be zero? It's my understanding that
> a zero-length RDMA Read must always check for access, even
> though no data is actually fetched. That would not be possible
> without an rkey.
> 
> Tom.
> 
Tom, Daisuke,

C9-88: For an HCA responder using Reliable Connection service, for
each zero-length RDMA READ or WRITE request, the R_Key shall not be
validated, even if the request includes Immediate data.

Further I have seen the pyverbs test suite sending a totally bogus rkey on a zero length rdma read. That was the impetus for me looking at this.

Daisuke has a different issue since flush is a different operation than read or write.
I need to look into what a zero length flush means.

Bob



  reply	other threads:[~2023-02-02  3:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 21:09 [PATCH for-next v3] Subject: RDMA/rxe: Handle zero length rdma Bob Pearson
2023-02-01 11:06 ` Daisuke Matsuda (Fujitsu)
2023-02-01 15:38   ` Tom Talpey
2023-02-02  3:45     ` Bob Pearson [this message]
2023-02-02  5:49       ` lizhijian
2023-02-02 13:02       ` Tom Talpey

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=0cb0e3e1-de90-3267-5a84-082321a10d9d@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=jgg@nvidia.com \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lizhijian@fujitsu.com \
    --cc=matsuda-daisuke@fujitsu.com \
    --cc=tom@talpey.com \
    --cc=yangx.jy@fujitsu.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