+2006-01-17 Ralph Campbell <ralphc@pathscale.com>
+
+ * examples/rc_pingpong.c (main), examples/srq_pingpong.c (main),
+ examples/uc_pingpong.c (main), examples/ud_pingpong.c (main): Fix
+ race when using CQ events by arming CQ before allowing remote side
+ to start sending.
+
2006-01-06 Roland Dreier <rdreier@cisco.com>
* examples/srq_pingpong.c (main): Fix SRQ example to avoid
return 1;
}
+ if (use_event)
+ if (ibv_req_notify_cq(ctx->cq, 0)) {
+ fprintf(stderr, "Couldn't request CQ notification\n");
+ return 1;
+ }
+
my_dest.lid = pp_get_local_lid(ctx, ib_port);
my_dest.qpn = ctx->qp->qp_num;
my_dest.psn = lrand48() & 0xffffff;
if (pp_connect_ctx(ctx, ib_port, my_dest.psn, rem_dest))
return 1;
- if (use_event)
- if (ibv_req_notify_cq(ctx->cq, 0)) {
- fprintf(stderr, "Couldn't request CQ notification\n");
- return 1;
- }
-
ctx->pending = PINGPONG_RECV_WRID;
if (servername) {
return 1;
}
+ if (use_event)
+ if (ibv_req_notify_cq(ctx->cq, 0)) {
+ fprintf(stderr, "Couldn't request CQ notification\n");
+ return 1;
+ }
+
memset(my_dest, 0, sizeof my_dest);
for (i = 0; i < num_qp; ++i) {
if (pp_connect_ctx(ctx, ib_port, my_dest, rem_dest))
return 1;
- if (use_event)
- if (ibv_req_notify_cq(ctx->cq, 0)) {
- fprintf(stderr, "Couldn't request CQ notification\n");
- return 1;
- }
-
if (servername)
for (i = 0; i < num_qp; ++i) {
if (pp_post_send(ctx, i)) {
return 1;
}
+ if (use_event)
+ if (ibv_req_notify_cq(ctx->cq, 0)) {
+ fprintf(stderr, "Couldn't request CQ notification\n");
+ return 1;
+ }
+
my_dest.lid = pp_get_local_lid(ctx, ib_port);
my_dest.qpn = ctx->qp->qp_num;
my_dest.psn = lrand48() & 0xffffff;
if (pp_connect_ctx(ctx, ib_port, my_dest.psn, rem_dest))
return 1;
- if (use_event)
- if (ibv_req_notify_cq(ctx->cq, 0)) {
- fprintf(stderr, "Couldn't request CQ notification\n");
- return 1;
- }
-
ctx->pending = PINGPONG_RECV_WRID;
if (servername) {
return 1;
}
+ if (use_event)
+ if (ibv_req_notify_cq(ctx->cq, 0)) {
+ fprintf(stderr, "Couldn't request CQ notification\n");
+ return 1;
+ }
+
my_dest.lid = pp_get_local_lid(ctx, ib_port);
my_dest.qpn = ctx->qp->qp_num;
my_dest.psn = lrand48() & 0xffffff;
if (pp_connect_ctx(ctx, ib_port, my_dest.psn, rem_dest))
return 1;
- if (use_event)
- if (ibv_req_notify_cq(ctx->cq, 0)) {
- fprintf(stderr, "Couldn't request CQ notification\n");
- return 1;
- }
-
ctx->pending = PINGPONG_RECV_WRID;
if (servername) {