[openib-general] wr_id in solicited receive requests
Roland Dreier
Fri Oct 22 13:55:52 PDT 2004
In ib_mad.h, we have the following comment for ib_mad_recv_wc:
* For received response, the wr_id field of the wc is set to the wr_id
* for the corresponding send request.
However, I can't find where this is done in the code in ib_mad.c. The
only thing that looks close is in ib_mad_send_done_handler():
/* Restore client wr_id in WC */
wc->wr_id = mad_send_wr->wr_id;
ib_mad_complete_send_wr(mad_send_wr, (struct ib_mad_send_wc*)wc);
return;
but that's for send completions.
By the way, why is the cast (struct ib_mad_send_wc*)wc in the call to
ib_mad_complete_send_wr() valid? It looks like ib_mad_completion_handler()
calls ib_mad_send_done_handler() with the address of a struct ib_wc on
the stack; the layouts of struct ib_mad_send_wc and struct ib_wc don't
match so I'm a little confused as to what that cast is trying to do.
Thanks,
Roland
More information about the openib-general mailing list