[ofw] How to block waiting for a CQE?

Diego Guella diego.guella at sircomtech.com
Wed Feb 18 07:02:39 PST 2009


On Linux, I can block waiting for CQE using a comp_channel and blocking on 
the ibv_get_cq_events function.
It seems that on Windows there isn't such function.

Looking into iba/ib_al.h it seems to me that the same behavior can be 
achieved creating a CQ with an associated h_wait_obj:
-----
HANDLE event_h;
ib_cq_create_t cq_create;

event_h = CreateEvent(NULL, false, false, NULL);
cq_create.size = 10;
cq_create.pfn_comp_cb = NULL;
cq_create.h_wait_obj = event_h;
ib_create_cq(hca_h, &cq_create, NULL, NULL, &cq_h);
-----

Then, I should call ib_rearm_cq to get a notification.
But, if I expect 32 CQE, can I call ib_rearm_cq 32 times to get 32 
notifications?
for (i=0; i<32; i++)
    ib_rearm_cq(cq_h, 0);


Is this the recommended way to achieve the blocking behavior, or there is a 
better approach?

Thanks,
Diego




More information about the ofw mailing list