0

I have N qps and I will send M RDMA Read requests through the send queue in each qp. The read request is sent by ibv_post_send() and the cq is polled iteratively using ibv_poll_cq().

The question is, if I get some work completions (WC) after calling ibv_poll_cq(), how do I know the WC corresponds to which read request? I am using Reliable Connection mode.

Bloodmoon
  • 1,308
  • 1
  • 19
  • 34

1 Answers1

2

When you send Read request through ibv_post_send() you are using ibv_send_wr struct, that has uint64_t wr_id; field that you've set

wr_id - A 64 bits value associated with this WR. If a Work Completion will be generated when this Work Request ends, it will contain this value.

Then when you do ibv_poll_cq() you're passing ibv_wc struct that will filled with

wr_id - The 64 bits value that was associated with the corresponding Work Request.

prudenko
  • 1,663
  • 13
  • 19
  • 1
    You are right. I thought this id in wr was uniquely generated by the rdma protocol, but later found out that it's user-defined so I could set it by myself. – Bloodmoon Aug 20 '18 at 14:17