[PATCH v2] staging/rdma/hfi1: check for ARMED->ACTIVE transition in receive interrupt

Jubin John jubin.john at intel.com
Tue Jan 5 18:48:17 UTC 2016


On Mon, Jan 04, 2016 at 10:23:46PM +0200, Leon Romanovsky wrote:
> On Mon, Jan 04, 2016 at 11:21:19AM -0500, Jubin John wrote:
> > From: Jim Snow <jim.m.snow at intel.com>
> > 
> >  		} else {
> > +			/* Auto activate link on non-SC15 packet receive */
> > +			if (unlikely(rcd->ppd->host_link_state ==
> > +				     HLS_UP_ARMED))
> > +				if (set_armed_to_active(rcd, packet, dd))
> > +					goto bail;
> 
> What is the advantage of double "if" over one "if"?
> Something like that
> + if (unlikely(rcd->ppd->host_link_state == HLS_UP_ARMED) && (set_armed_to_active(rcd, packet, dd))
> +		goto bail;

I don't think there is an advantage to the double if, so I will change
it to the single if in v3.

> 
> >  			last = process_rcv_packet(&packet, thread);
> >  		}
> >  
> > @@ -984,6 +1020,42 @@ bail:
> >  }
> >  


More information about the devel mailing list