[openib-general] [PATCH] ib_cancel_mad API

Roland Dreier roland at topspin.com
Wed Sep 29 18:14:14 PDT 2004


    Fab> I think as long as ib_cancel_mad can return before the
    Fab> corresponding send completes (i.e. return -EBUSY), you have
    Fab> this problem and client must provide their own
    Fab> synchronization, whether through reference counting or some
    Fab> other means.

    Fab> Returning -EBUSY from ib_cancel requires the caller to block
    Fab> until the send handler is invoked.  This in turn means that
    Fab> there needs to be code so that the send handler can wakeup
    Fab> the canceling thread once the send is complete.  I don't see
    Fab> the difference between such synchronization requirements to
    Fab> the client and reference counting.

    Fab> To solve this, you would need ib_cancel_mad to be a
    Fab> synchronous call that would block in the -EBUSY case (at
    Fab> which point the return value is also pointless).  However,
    Fab> making this change requires all callers to be in a thread
    Fab> context suitable for blocking.  I don't think we want to
    Fab> impose this sort of requirement for MAD cancellation.  I
    Fab> think such a requirement is fine for MAD agent destruction
    Fab> though.

That's fine, I can live with this.  Then all we need to change is that
ib_cancel_mad should not have a return value.

 - Roland



More information about the general mailing list