Re: [RFC rdma-core 2/2] srp_daemon: fix CQ handling

Nicolas Morey-Chaisemartin
2017-12-11T16:38:07Z

Le 11/12/2017 à 17:30, Bart Van Assche a écrit :
> On Mon, 2017-12-11 at 15:46 +0100, Nicolas Morey-Chaisemartin wrote:
>> +tatic int poll_cq_once(struct sync_resources *sync_res, struct ibv_cq *cq,
>> + struct ibv_wc *wc)
> Has this patch been tested? I don't think that "tatic" is a valid keyword?

Typo during the rebase. But the overall fix was tested yes. I'm looking for insight to make sure my understanding of the issue (and the way to fix it) is valid.
>
>> + /* Poll CQ once. There may be extra completion that
>> + * were associated to the previous event */
>> + ret = poll_cq_once(sync_res, cq, wc);
>> + if (ret)
>> + return ret;
> How many extra completions can be associated with an event? Is polling once
> sufficient? If so, please update the comment ("an" is missing / "were" ->
> "was").
There can be more than one.
This should be enough becausethey would all be consumed through the call to poll_cq.
As long as there as completion in the CQ, they will be returned directly without waiting for an event.
Once there are no more, the code will wait for the next event again.

I'll fix the typo and the log.

Thanks

Nicolas