[openib-general] [PATCH] cancel outstanding MADs when deregistering

Krishna Kumar krkumar at us.ibm.com
Tue Sep 28 13:21:51 PDT 2004


Sean,

I have a couple of questions regarding your patch, not real problems :-)

In cancel_mads() :
> if (mad_send_wr->refcount <= 0) {

If there is no good reason for the refcount to drop below zero, it is
better to put BUG_ON for such code to catch potential bugs much earlier,
while keeping the check as "if (x == 0)", etc.

Also, if timeout_ms is set, will those entries get removed from the
list (since they have refcnt of two) ?

Finally, do you want to wake up threads waiting on mad_agent_priv->wait
once finally out of the loop or each time when the refcnt drops to zero ?
If there is no reason to do so each time, you can do once you finish the
cancel list. BTW, in this case you can also call wake_up_nr() if you
keep track of the number of times you want to wake up based on the return
value of atomic_dec_* call.

thx,

- KK




More information about the general mailing list