From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Benoit Hudzia <benoit.hudzia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: need pointer to Understand how to use IBV_WR_RDMA_WRITE_WITH_IMM
Date: Tue, 7 Jun 2011 10:43:33 -0600 [thread overview]
Message-ID: <20110607164333.GB24005@obsidianresearch.com> (raw)
In-Reply-To: <BANLkTikC6jPFJm=MxT5oNDoJH4Ex+j41XA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Tue, Jun 07, 2011 at 01:23:01PM +0100, Benoit Hudzia wrote:
> I would like to use IBV_WR_RDMA_WRITE_WITH_IMM , however I am facing
> difficulty to find documentation or example on how to use such
> feature. ?The idea would be to do an RDMA write and wake up the peer
> upon reception in order to process the received data.
You basically have it correct, but generally you also need to mix SEND
traffic on the same QP as you are doing these RDMAs, at a minimum to
manage the allocation of receive resources. Since you can't know if
the remote will place a RDMA+IMM or a SEND into your receive WR you
need to ensure that all of them that are posted are able to handle a
SEND. If you get an IMM then ignore the payload, process the imm_data
recycle the WR back into the HCA, and schedule a signal to the far
side you now have additional receive WR space.
> a.?????? Question : can i fill the imm_data with arbitrary data?
> I would like to use this field on the peer side to identify the
> request
Keep in mind the imm_data is copied byte-for-byte so you should put it
in a sensible endian-ness for your application.
A simple example of a protocol using this might be:
SEND [My RDMA Recv buffer is XX-YY, I have RR recv WRs posted]
SEND [OK, I have RR recv WRs posted]
RDMA WRITE [IMM = I wrote ZZ bytes]
RDMA WRITE [IMM = I wrote ZZ bytes]
RDMA WRITE [IMM = I wrote ZZ bytes]
RDMA WRITE [IMM = I wrote ZZ bytes]
RDMA WRITE [IMM = I wrote ZZ bytes]
SEND [I have RR recv WRs posted]
RDMA WRITE [IMM = I wrote ZZ bytes]
RDMA WRITE [IMM = I wrote ZZ bytes]
RDMA WRITE [IMM = I wrote ZZ bytes]
RDMA WRITE [IMM = I wrote ZZ bytes]
SEND [I have RR recv WRs posted]
RDMA WRITE [IMM = I wrote ZZ bytes]
RDMA WRITE [IMM = I wrote ZZ bytes]
SEND [I have RR recv WRs posted]
SEND [I have RR recv WRs posted]
RDMA WRITE [IMM = I wrote ZZ bytes]
RDMA WRITE [IMM = I wrote ZZ bytes]
[etc..]
With a scheme like this all recive work posts would include a recv
buffer to handle a SEND receive completion, and each side would stop
sending when it runs out of recv completion space on the far
side. Generally with a scheme like this some care is needed to avoid
deadlocking because you want to be a bit lazy with flow control sends.
Jason
--
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:[~2011-06-07 16:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-07 12:23 need pointer to Understand how to use IBV_WR_RDMA_WRITE_WITH_IMM Benoit Hudzia
[not found] ` <BANLkTikC6jPFJm=MxT5oNDoJH4Ex+j41XA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-07 14:18 ` Steven Dake
[not found] ` <4DEE3326.9050105-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-06-07 16:31 ` Jason Gunthorpe
[not found] ` <20110607163111.GA24005-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-06-07 16:36 ` Steve Wise
2011-06-07 14:23 ` Hefty, Sean
2011-06-07 16:43 ` Jason Gunthorpe [this message]
[not found] ` <20110607164333.GB24005-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-06-08 18:35 ` Benoit Hudzia
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=20110607164333.GB24005@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=benoit.hudzia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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