Using libibverbs
, to do a send
operation, these actions happen in this order:
receive
request using ibv_post_receive()
send
request using ibv_post_send()
IBV_WC_RECV
get pushed on the queue of the receiveribv_poll_cq()
IBV_WC_SEND
get pushed on the queue of the senderibv_poll_cq()
My question are the followings:
You can't really put an exact order between things that happen on the sender and on the receiver, since the only way they causally interact is by sending network messages, with have a non-zero latency.
Another way to think about what happens is:
Now at this point there is no strict order required by the spec, since the ACK packet travels over the network independently of how the receiver adapter proceeds to the next step, but things that happen next:
If the network latency is extremely low and the receiver adapter runs slowly for some reason, it is possible that by some external timebase the sender completion appears before the receive completion.
The one guarantee that we can make is that the contents of the receive buffer are updated strictly before both the receive completion and send completion are pushed. But there are corner cases, for example if the network fails before delivering the ACK packet back to the sender, it's possible that no successful send completion is generated even though the receiver will see the buffer updated and the receive completion generated.