[openib-general] [PATCH] ib_cancel_mad API

Fab Tillier ftillier at infiniconsys.com
Wed Sep 29 15:50:45 PDT 2004


> From: Sean Hefty [mailto:mshefty at ichips.intel.com]
> Sent: Wednesday, September 29, 2004 3:27 PM
> 
> On Wed, 29 Sep 2004 15:20:20 -0700
> Roland Dreier <roland at topspin.com> wrote:
> 
> >     Sean> Currently, the consumer _only_ has to free their send
> >     Sean> context in their send MAD completion handler.  No reference
> >     Sean> counting by the consumer is needed.  And it doesn't matter
> >     Sean> if a send succeeds, timeouts, has an error, or is canceled.
> >
> > The consumer does need to do reference counting.  If I cancel a MAD
> > and get -EINVAL back, I might still get a completion later, so I have
> > to have a count of the number of MADs outstanding and wait for that to
> > go to zero.
> 
> What is the client doing with the reference counting?  When their send
> handler gets called, they free their send context.  After they deregister,
> they free their mad_agent context.

If deregistration is synchronous then as long as the MAD layer keeps
reference counts for outstanding sends, the client does not need to.  The
client is guaranteed that their send callback will not be called after
deregistration completes.

As Sean mentioned, it's simpler for clients to know they will *always* get a
send completion regardless of status.  It allows them to do all the send
completion processing in their handler, rather than having it split between
the send handler and the cancel logic.

In fact, I'd just rather remove the return value all together - what can a
client do with the return value that they wouldn't know from the status
reported to the send handler?

- Fab






More information about the general mailing list