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

Estrin, Alex aestrin at silverstorm.com
Mon Oct 30 06:27:35 PST 2006


Yossi,
Please see comments below.

> -----Original Message-----
> From: Yossi Leybovich [mailto:sleybo at mellanox.co.il]
> Sent: Sunday, October 29, 2006 8:07 AM
> To: Estrin, Alex; Yossi Leybovich
> Cc: openib-windows at openib.org
> Subject: RE: [Openib-windows] [IBAL][Patch] reference counter for IOC
> obj in IOC PnP manager
> 
> 
> Hi
> 
> Thanks for the patch I am reviewing it to check if the query_cnt field
> can be use to track the outstanding queries.
> Any way see below my comment 
> 
> > -----Original Message-----
> > From: openib-windows-bounces at openib.org 
> > [mailto:openib-windows-bounces at openib.org] On Behalf Of Estrin, Alex
> > Sent: Friday, October 27, 2006 1:43 AM
> > To: Yossi Leybovich
> > Cc: openib-windows at openib.org
> > Subject: [Openib-windows] [IBAL][Patch] reference counter for 
> > IOC obj in IOC PnP manager
> > 
> > Hi Yossi,
> > 
> > This patch introduces a reference counter to protect ioc obj 
> > from double memory free.
> > 
> > Possible scenario - IOC Manager handles PORT_DOWN event, 
> > frees ioc obj and put it back to the pool, while there are 
> > outstanding send MAD svc that has reference to that ioc obj.
> > On timeout send callback will try to free ioc obj again.
> > 
> > By using this counter we also protect ioc obj from return to 
> > the pool and possible reusage while outstanding send mad 
> > keeps it's reference.
> > Please review.
> > 
> > Thanks,
> > Alex
> > 
> ...
> >  
> >  				cl_atomic_inc( 
> > &p_results->p_svc->query_cnt );
> >  			}
> > +			if( status == IB_SUCCESS )
> > +				cl_atomic_inc( &p_ioc->ref_cnt );
> 
> The AL create mad for each chunk of 4 service entries it create list
> from the mad and post it.
> I think that we need to take reference for each mad we send 
> and not for
> each mad list we post ( same as the query_cnt) 
> What do you think ?
> 
You are right.
We should increment counter for every mad element
that holds reference to ioc object.
Thanks.




More information about the ofw mailing list