[ofa-general] Re: [PATCH] libibverbs: increment comp_events_completed only if channel is set

Roland Dreier rdreier at cisco.com
Fri Aug 31 13:55:39 PDT 2007


 > increment counter comp_events_completed only if channel is set
 > this will prevent the while loop below in ibv_cmd_destroy_cq() to
 > hang if consumer calls ibv_ack_cq_events() without any assigned
 > channel

Is there any valid reason a consumer would ack events if no channel is
set?  There's no way to get an event to ack in that case, as far as I know.

Maybe the real bug is in:

	while (cq->comp_events_completed  != resp.comp_events_reported ||
	       cq->async_events_completed != resp.async_events_reported)

it might be safer to change the != to a < (actually to a subtraction
to handle wraparound), just to avoid hanging if someone accidentally
acks too many events.



More information about the general mailing list