[ofa-general] Managing work completions (libibverbs)
Kelly Burkhart
kelly at tradebotsystems.com
Wed Nov 5 13:04:00 PST 2008
> -----Original Message-----
> From: Roland Dreier [mailto:rdreier at cisco.com]
>
> You can use epoll to get comp channel events, but you'll need
> to collect
> the event with ibv_get_cq_event() to rearm things. epoll
> tells you when
> the fd becomes readable, but you'll need to actually read all the
> events queued on the fd before waiting again. The overhead of
> ibv_get_cq_event() should not be too high compared to the overhead of
> sleeping and getting woken up again by an interrupt, and you
> can always
> amortize ibv_ack_cq_events() by just keeping a counter of the
> number of
> events you read and only calling ibv_ack_cq_events() occasionally.
Digging through the code to see what resource I hog if I don't ack
frequently enough: It appears that ibv_ack_cq_events only increments
an integer in the CQ (and doesn't free or return some resource). So I
could just count gets and ack them all immediately prior to
destructing the CQ.
Why be so picky about matching acks with gets?
-K
More information about the general
mailing list