[ofa-general] ibv_get_cq_event problem~

yangdong yangdong at ncic.ac.cn
Sat Oct 27 11:44:33 PDT 2007


when i was using ibv_get_cq_event in my thread just as follow (this is
similar to some codes in rping.c), i post a send op by ibv_post_send,
but thread find ibv_get_cq_event cannot get a cq event. why ? send is
post successfully , matbe any other errors ? when i cannot get a cq
event, which may happen?

void thread() {
...
while (1) {
ret = ibv_get_cq_event(conn->ac_rdma->cr_send_comp_channel, &ev_cq,
&ev_ctx);
if (ret) {
AMP_ERROR("__amp_rdma_scq_thread:Failed to get scq event!\n");
goto EXIT;
}
AMP_DEBUG(AMP_DEBUG_MSG, "__amp_rdma_sendcompletion_thread:
ibv_get_cq_event.\n");

if (ev_cq != conn->ac_rdma->cr_scq) {
AMP_ERROR("__amp_rdma_scq_thread: Unkown SCQ!\n");
ret = -1;
goto EXIT;
}

ret = ibv_req_notify_cq(conn->ac_rdma->cr_scq, 0);
if (ret) {
AMP_ERROR("__amp_rdma_scq_thread: Failed to set notify!\n");
goto EXIT;
}
AMP_DEBUG(AMP_DEBUG_MSG, "__amp_rdma_scq_thread: ibv_req_notify_cq.\n");

ret = __amp_sq_cq_reap(conn->ac_rdma, NULL);
AMP_DEBUG(AMP_DEBUG_MSG, "__amp_rdma_scq_thread: __amp_rq_cq_reap.\n");

ibv_ack_cq_events(conn->ac_rdma->cr_scq, 1);
if (ret) {
AMP_ERROR("__amp_rdma_scq_thread: Failed to ack scq event!\n");
goto EXIT;
}
AMP_DEBUG(AMP_DEBUG_MSG, "__amp_rdma_scq_thread: ibv_ack_cq_events.\n");
}
}




More information about the general mailing list