Re: [PATCH 2/9] IB: add a proper completion queue abstraction

Jason Gunthorpe
2015-11-25T06:21:29Z

On Tue, Nov 24, 2015 at 06:47:14PM -0800, Caitlin Bestler wrote:
> Acknowledge packet for the last packet of the request has been
> committed to the wire (including the appropriate fields for RDMA
> READ response).

> The target side cannot generate a response before it receives the request.
> The target side verbs cannot generate the completion before the acknowledge
> packet has been
> committed to the wire.

Sure, but, I keep saying this, the responder behavior is largely
irrelevant to what the target is able/required to do.

> Therefore the initiating side cannot receive a response before the write
> operation has completed.

Wrong. The ladder diagram would be

Requestor Responder Responder Verbs

SEND1 -----------> Process
X--------- ACK (lost)
--------> recv1 CQ
<------- send2 WQE
recv2 CQE <-------- SEND2 Packet
[..]
send1 CQE <-------- ACK (resent)

The Ack may be lost, causing the send CQE to arrive after the recv
CQE, even though the responder did everything in a specific order.

The fundamental issue is that the responder cannot detect the lost
ACK. The PSN of the ACK packet is part of the Requestor's PSN space,
not part of the Responders:

9.7.5.1.1 GENERATING PSNs FOR ACKNOWLEDGE MESSAGES

C9-95: For responses to SEND requests or RDMA WRITE requests the
responder shall insert in the PSN field of the response the PSN of the
most recent request packet being acknowledged.

Or stated another way, the value of the AckReq bit in SEND1 has no
impact on the contents of the SEND2 packet - thus there is no way for
the requestor to detect the loss of the ACK and hold off delivering
recv2 CQE.

Jason