On Wed, Oct 26, 2011 at 10:06 PM, Roland Dreier <rol...@purestorage.com> wrote:
> On Wed, Oct 26, 2011 at 11:05 AM, Bart Van Assche <bvanass...@acm.org> wrote:
> > Can I conclude from your reply that the "last WQE" event refers to the
> > SRQ only and that it does not provide any information about the send
> > queue associated with the same QP ?
>
> That is correct as I understand things.  The "last WQE" event was added
> to handle the fact that if you have a QP associated to an SRQ, you can't
> know how many receives have been taken from the SRQ and are in flight
> on the receive queue.  The IB spec is a bit vague on what "last WQE"
> actually means but based on the background, I believe it means that the
> last request on the receive queue has been processed, without saying
> anything about the send queue.

Are you sure about this ? There is a paragraph in the InfiniBand
Architecture Manual that can only be correct if "last WQE" refers to
both SRQ and send queue and not to the SRQ only. It is mentioned in
that manual that it is safe to reset the QP immediately after the last
WQE event has been received. A quote:

Note, for QPs that are associated with an SRQ, the Consumer should
take the QP through the Error State before invoking a Destroy QP or a
Modify QP to the Reset State. The Consumer may invoke the Destroy QP
without first performing a Modify QP to the Error State and waiting
for the Affiliated Asynchronous Last WQE Reached Event. However, if
the Consumer does not wait for the Affiliated Asynchronous Last WQE
Reached Event, then WQE and Data Segment leakage may occur. Therefore,
it is good programming practice to tear down a QP that is associated
with an SRQ by using the following process:
• Put the QP in the Error State;
• wait for the Affiliated Asynchronous Last WQE Reached Event;
• either:
• drain the CQ by invoking the Poll CQ verb and either wait for CQ to
be empty or the number of Poll CQ operations has exceeded CQ capacity
size; or
• post another WR that completes on the same CQ and wait for this WR
to return as a WC;
• and then invoke a Destroy QP or Reset QP.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to