RE: [PATCH 19/32] cxgb4: Convert atid_idr to XArray

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Matthew Wilcox <willy@xxxxxxxxxxxxx>
> Sent: Thursday, February 21, 2019 1:52 PM
> To: Steve Wise <swise@xxxxxxxxxxxxxxxxxxxxx>
> Cc: 'Jason Gunthorpe' <jgg@xxxxxxxx>; linux-rdma@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH 19/32] cxgb4: Convert atid_idr to XArray
> 
> On Thu, Feb 21, 2019 at 01:45:26PM -0600, Steve Wise wrote:
> > > @@ -2147,7 +2147,9 @@ static int c4iw_reconnect(struct c4iw_ep *ep)
> > >  		err = -ENOMEM;
> > >  		goto fail2;
> > >  	}
> > > -	insert_handle(ep->com.dev, &ep->com.dev->atid_idr, ep, ep->atid);
> > > +	err = xa_insert_irq(&ep->com.dev->atids, ep->atid, ep,
> > > GFP_KERNEL);
> > > +	if (err)
> > > +		goto fail5;
> > >
> > >  	/* find a route */
> > >  	if (ep->com.cm_id->m_local_addr.ss_family == AF_INET) {
> > > @@ -2198,7 +2200,8 @@ static int c4iw_reconnect(struct c4iw_ep *ep)
> > >  fail4:
> > >  	dst_release(ep->dst);
> > >  fail3:
> > > -	remove_handle(ep->com.dev, &ep->com.dev->atid_idr, ep->atid);
> > > +	xa_erase_irq(&ep->com.dev->atids, ep->atid);
> > > +fail5:
> > >  	cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid);
> > >  fail2:
> >
> > Don't like the out-of-order label.  Care to rename all of them to make them
> > more descriptive and avoid this 4, 3, 5, 2 sequence?
> 
> That seemed incredibly dangerous to me.  I'm not sure I could get it right.
> How about I introduce this one with a name, like most drivers do?

Sure.  I was asking if you'd do that for all of them in this func while you were at it. 😊

fail4 could be err_dst_release, fail3 could be err_xa_erase, fail5 -> err_free_atid, etc... 




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux