[Openib-windows] [IBAL][Patch] reference counter for IOC obj in IOC PnP manager

Fabian Tillier ftillier.sst at gmail.com
Mon Nov 27 10:10:02 PST 2006


Hi Yossi,

On 11/26/06, Yossi Leybovich <sleybo at mellanox.co.il> wrote:
>
>
> > -----Original Message-----
> > From: Fabian Tillier [mailto:ftillier.sst at gmail.com]
> > Sent: Thursday, November 23, 2006 6:55 AM
> > To: Yossi Leybovich
> > Cc: Estrin, Alex; openib-windows at openib.org
> > Subject: Re: [Openib-windows] [IBAL][Patch] reference counter
> > for IOC obj in IOC PnP manager
> >
> > Hi Yossi,
> >
> > On 11/1/06, Yossi Leybovich <sleybo at mellanox.co.il> wrote:
> > > I am also encountering case when ioc_async_cb was called when
> > > query_cnt != 0 , I am trying to solve this problem I hope it will
> > > solve also the ref_cnt problem .
> >
> > I think these are two different problems.  The problem you
> > are encountering is likely due to the timer firing while
> > queries are outstanding.  The only case where this could
> > happen that I can think of is on a PORT_UP event (where the
> > timer is set again).  Otherwise, the timer doesn't get sent
> > until the sweep is complete.
> >
> Yes that the problem I was addressed.
> (The SM moved up/down )
>
> > The problem Alex reported has to deal with PORT_DOWN, where
> > the IOC and IOU map is cleaned up immediately, even if there
> > are outstanding MADs.  In general, it's good practice to
> > reference count structures when they will be used as the
> > context for a callback.
> >
>
> Wouldn't it make more sense to change the port_down process to work like
> this:
> - change the SWEEP status to STOPPED (NO more query will be issue)
> - wait till all the svc->query_cnt will be zero .
> - destroy the IOU/ IOC maps
>
> In this state there shouldn't be any queries outstanding.
> And it safe to destroy the IOC/IOU
>
> What do you think ?

This causes the PnP port down callback to stall, which affects system
wide IB PnP event processing (there's a single system-wide thread to
deliver PnP notifications).  Anywhere we can avoid blocking we should.
 It's better IMO to reference count the IOC and IOU structures, and
remove them from the IOC and IOU maps during the port down callback,
and have them freed whenever the reference count reaches zero.  Plus,
you don't want to stop sweeps, as they could be happening on a
different port and don't need to be cancelled.

Is there something about Alex's fix that you don't like?  It seems to
do the right thing...

- Fab




More information about the ofw mailing list