[openib-general] Re: OpenIB documentation

Michael S. Tsirkin mst at mellanox.co.il
Wed Mar 22 09:44:41 PST 2006


Quoting r. Christopher C. Aycock <christopher.aycock at chch.ox.ac.uk>:
> For example, is there any way to have IBverbs invoke a callback  
> function when an item arrives on the completion queue? The IBA spec  
> mentions a "Completion Event Handler"; is this what I'm looking for?  
> If so, how do I use it in IBverbs?

No. This would require creating a thread behind the scenes and Roland
didn't want to do that. You can create a thread yourself and
call ibv_get_cq_event from there.

> One function I'm kind of confused with is ibv_req_notify_cq(). Is the  
> second parameter simply a true / false value? This isn't very obvious  
> since the rc_pingpong.c example file passes a 0 value when it  
> requests CQ notification.

Yes.

> Another confusing one is ibv_get_cq_event(). Am I correct in assuming  
> that this is a blocking function? That's the impression I get from  
> the example codes and from the fact that struct ibv_comp_channel  
> appears to merely consist of a file descriptor. My impression is that  
> it "wakes up" when an element appears on the CQ,

No, when a completion event is triggered. A single event might
signal multiple completions.

> but that it requires  
> the use of ibv_poll_cq() to actually obtain that element. Is this  
> correct?

Yes.

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies



More information about the general mailing list