[openib-general] ib_cancel_mad and the CM

Libor Michalek libor at topspin.com
Wed Feb 23 15:52:45 PST 2005


On Wed, Feb 23, 2005 at 03:07:27PM -0800, Sean Hefty wrote:
> Libor Michalek wrote:
> 
>   >   No, what I'm saying is that having the CM assigns the wr_id, and then
> > having the mad code actually executes the cancel, is a problem. There is
> > nothing to prevent multiple mad consumers from using the same wr_id, in
> > fact I would assume it. If you want to use wr_id as a handle that the
> > mad layer can use to lookup a message, then the mad layer needs to be
> > where the wr_id is assigned/generated. Either that or you need some other
> > identifier which you can use to cancel messages.
> 
> The scope of the MAD is limited by the mad_agent, which is defined per 
> consumer of the MAD layer, so the re-use of wr_id's between consumers 
> isn't an issue.

  Ahh, got it, that was the source of my confusion. In which case it's
just a race condition between executing the callback and the cancel,
right? In which case the two have to occur under some form of exclusion.
  In the past I've used a spinlock protected variable to mark that the
callback is being executed, in which case the cancel fails with a
specific error code...

-Libor



More information about the general mailing list