[ofa-general] Re: Requesting CQ notifications

Michael S. Tsirkin mst at dev.mellanox.co.il
Tue May 1 19:50:55 PDT 2007


> Quoting Roland Dreier <rdreier at cisco.com>:
> Subject: Re: Requesting CQ notifications
> 
>  > Is there a differentiation between multiple CQE's being in the CQ
>  > vs. CQE's being arriving into the CQ when using completion
>  > notifications?
>  > 
>  > For example, assume I have the following order of events:
>  > 
>  > 
>  > 	2 CQEs arrive
>  > 
>  > 	select() returns readable for comp. channel
>  > 
>  > 	ibv_get_cq_event() returns event
>  > 
>  > 	ibv_req_notify_cq(cq, 0)
>  > 
>  > 	ibv_poll_cq(cq, 1, &cqe) returns 1
>  > 
>  > 	ibv_ack_cq_events(cq, 1)
>  > 
>  > 
>  > Will the comp. channel receive another event for the second CQE even
>  > if it had arrived before ibv_req_notify_cq() was called?
> 
> This is really an ill-posed question: according to the semantics
> defined by the verbs spec, the presence or absence of the second CQE
> is not defined until you poll the CQ again.
> 
> In practice we can look at what real hardware does, and the answer is
> "it depends."  Some adapters (eg mthca, mlx4) will generate an event
> immediately if ibv_req_notify_cq() is called for a CQ that contains an
> unpolled CQE,

This is not exact. mthca/mlx4 will generate an event immediately
only for unpolled CQE *that was not present in CQ at the
time the previous event was generated*.
So the answer for mthca is yes only if the CQE arrived
between calls to select and ibv_req_notify_cq.

> while other adapters (eg ipath, ehca) will only generate
> an event when a CQE is added after the cal to ibv_req_notify_cq().


-- 
MST



More information about the general mailing list