Re: [PATCH] IB/cq: Don't process more than the given budget

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

 



On Wed, 2017-03-08 at 23:12 +0100, hch@xxxxxx wrote:
> On Wed, Mar 08, 2017 at 10:09:08PM +0000, Bart Van Assche wrote:
> > > -	while ((n = ib_poll_cq(cq, IB_POLL_BATCH, cq->wc)) > 0) {
> > > +	while ((n = ib_poll_cq(cq, min(IB_POLL_BATCH, budget - completed),
> > > +			cq->wc)) > 0) {
> > >  		for (i = 0; i < n; i++) {
> > >  			struct ib_wc *wc = &cq->wc[i];
> > >  
> > 
> > This breaks the SRP initiator driver since that driver can pass -1 as budget.
> 
> Good point, we'd need to special case that.

How about using min_t(u32, IB_POLL_BATCH, budget - completed)?

Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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