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

Yossi Leybovich sleybo at mellanox.co.il
Mon Nov 27 11:00:43 PST 2006


 Hi
See my comments

> -----Original Message-----
> From: Estrin, Alex [mailto:aestrin at silverstorm.com] 
> Sent: Monday, October 30, 2006 4:28 PM
> To: Yossi Leybovich
> Cc: openib-windows at openib.org
> Subject: RE: [Openib-windows] [IBAL][Patch] reference counter 
> for IOC obj in IOC PnP manager
> 
> 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.

What about decrement in case the we did not success to send all the MADs
( similar to the query_cnt counter)
I think we should decrement the ref_cnt for each mad we tried to send
but failed.
Otherwise we will never will decrement the counter , because we will
never get complition.
What do you think ?




> 




More information about the ofw mailing list