[openib-general] ib_mad_recv_done_handler questions
Hal Rosenstock
halr at voltaire.com
Tue Nov 9 05:57:56 PST 2004
On Mon, 2004-11-08 at 18:48, Sean Hefty wrote:
> Looking at the latest changes to ib_mad_recv_done_handler, I have a
> couple of questions:
> * If process_mad consumes the MAD, should the code just goto out?
> Something more like:
>
> ret = port_priv->device->process_mad(...)
> if ((ret & IB_MAD_RESULT_SUCCESS) &&
> (ret & IB_MAD_RESULT_REPLY)) {
> ...
> } else
>
> becomes
>
> ret = port_priv->device->process_mad(...)
> if (ret & IB_MAD_RESULT_SUCCESS)) {
> if (ret & IB_MAD_RESULT_REPLY)) {
> ...
> }
> ...
> goto out;
> } else
Patch shortly on this.
> Does the MAD still need to be dispatched in this case?
I'm not sure exactly what all the reasons for !success being returned
from process_mad are but my reasoning was as follows:
In this error case, it is unclear whether the packet would have been
consumed or not. If it would not have been consumed, it should be
dispatched. It is only in the case where it would have been consumed
that dispatching it causes a potential issue. If the packet is indeed
dispatched to a client, wouldn't/shouldn't the client throw it away (as
unexpected) ?
If it is thrown away in this error case (a more conservative strategy),
some retransmission strategy would kick in on one side or the other.
I wasn't sure about this and chose the former strategy.
-- Hal
More information about the general
mailing list