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

Sagi Grimberg
2017-03-08T22:59:55Z

>>>> - 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)?

Yep, I'll do that, thanks Bart.