[ewg] Re: [PATCH] libibverbs - return valid bad_wr from ibv_cmd_post_send()
Ralph Campbell
ralph.campbell at qlogic.com
Tue Nov 13 16:02:36 PST 2007
On Tue, 2007-11-13 at 14:50 -0800, Roland Dreier wrote:
> > + } else if (ret)
> > + *bad_wr = wr;
>
> Hmm... it seems a little strange to pick the first WR for no reason
> when the kernel didn't point at a particular work request. Maybe it
> would make more sense to set bad_wr to NULL in this case?
Well, ibv_cmd_post_send() isn't going to know if the EINVAL is due
to the size of the write being different from what the kernel expects
(i.e., unrelated to WRs) or if the ID of the address handle
is invalid and thus it is related to the WR. Now that I look
at ib_uverbs_post_send() again, it seems that this later case should
set resp.bad_wr and copy out the index of the WR that had the error.
But even if there is an error not related to any WR directly,
it is still the first WR that is not sent. I guess NULL could
be used to give slightly more information to the caller but
I don't really expect most application error recovery code to
make the distinction.
More information about the ewg
mailing list