diff --git a/src/perftest_parameters.c b/src/perftest_parameters.c index 752dc59b..fbaef093 100755 --- a/src/perftest_parameters.c +++ b/src/perftest_parameters.c @@ -321,7 +321,7 @@ static void usage(const char *argv0, VerbType verb, TestType tst, int connection printf(" -D, --duration "); printf(" Run test for a customized period of seconds. (SYMMETRIC)\n"); - if (verb != WRITE && verb != WRITE_IMM && connection_type != RawEth) { + if (verb != WRITE && connection_type != RawEth) { printf(" -e, --events "); printf(" Sleep on CQ events (default poll)\n"); @@ -1790,6 +1790,12 @@ static void force_dependecies(struct perftest_parameters *user_param) } } + if (user_param->use_event == ON && user_param->verb == WRITE) { + printf(RESULT_LINE); + fprintf(stderr," Events feature not available on WRITE verb\n"); + exit(1); + } + if ((user_param->use_srq && (user_param->tst == LAT || user_param->machine == SERVER || user_param->duplex == ON)) || user_param->use_xrc) user_param->srq_exists = 1; @@ -2949,12 +2955,8 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc) return FAILURE; } break; - case 'e': user_param->use_event = ON; - if (user_param->verb == WRITE || user_param->verb == WRITE_IMM) { - fprintf(stderr," Events feature not available on WRITE verb\n"); - free(duplicates_checker); - return FAILURE; - } + case 'e': + user_param->use_event = ON; break; case 'X': if (user_param->verb == WRITE || user_param->verb == WRITE_IMM) { diff --git a/src/perftest_resources.c b/src/perftest_resources.c index 2bf6307a..0eb6e263 100755 --- a/src/perftest_resources.c +++ b/src/perftest_resources.c @@ -5064,7 +5064,7 @@ int run_iter_lat_write_imm(struct pingpong_context *ctx,struct perftest_paramete uint64_t scnt = 0; uint64_t ccnt = 0; uint64_t rcnt = 0; - int ne; + int ne = 0; int err = 0; volatile char *post_buf = NULL; @@ -5111,8 +5111,15 @@ int run_iter_lat_write_imm(struct pingpong_context *ctx,struct perftest_paramete if ((rcnt < user_param->iters || user_param->test_type == DURATION) && !(scnt < 1 && user_param->machine == SERVER)) { rcnt++; + if (user_param->use_event) { + if (ctx_notify_events(ctx->recv_channel)) { + fprintf(stderr , " Failed to notify events to CQ\n"); + return 1; + } + } + /* Poll for a completion */ - do { ne = ibv_poll_cq(ctx->recv_cq, 1, &wc); } while (ne == 0 && !(user_param->test_type == DURATION && user_param->state == END_STATE)); + do { ne = ibv_poll_cq(ctx->recv_cq, 1, &wc); } while (!user_param->use_event && ne == 0 && !(user_param->test_type == DURATION && user_param->state == END_STATE)); if (ne > 0) { if (wc.status != IBV_WC_SUCCESS) { //coverity[uninit_use_in_call] @@ -5172,6 +5179,13 @@ int run_iter_lat_write_imm(struct pingpong_context *ctx,struct perftest_paramete if (ccnt < user_param->iters || user_param->test_type == DURATION) { + if (user_param->use_event && ne == 0) { + if (ctx_notify_events(ctx->send_channel)) { + fprintf(stderr, "Couldn't request CQ notification\n"); + return 1; + } + } + do { ne = ibv_poll_cq(ctx->send_cq, 1, &wc); } while (ne == 0); if(ne > 0) { diff --git a/src/write_bw.c b/src/write_bw.c index 14b9e128..381a8b52 100755 --- a/src/write_bw.c +++ b/src/write_bw.c @@ -222,6 +222,17 @@ int main(int argc, char *argv[]) ctx_print_pingpong_data(&rem_dest[i],&user_comm); } + if (user_param.use_event) { + if (ibv_req_notify_cq(ctx.send_cq, 0)) { + fprintf(stderr, " Couldn't request CQ notification\n"); + goto destroy_context; + } + if (ibv_req_notify_cq(ctx.recv_cq, 0)) { + fprintf(stderr, " Couldn't request CQ notification\n"); + goto destroy_context; + } + } + /* An additional handshake is required after moving qp to RTR. */ if (ctx_hand_shake(&user_comm,&my_dest[0],&rem_dest[0])) { fprintf(stderr," Failed to exchange data between server and clients\n"); diff --git a/src/write_lat.c b/src/write_lat.c index 3d96b54c..66794b9a 100755 --- a/src/write_lat.c +++ b/src/write_lat.c @@ -243,6 +243,17 @@ int main(int argc, char *argv[]) ctx_print_pingpong_data(&rem_dest[i],&user_comm); } + if (user_param.use_event) { + if (ibv_req_notify_cq(ctx.send_cq, 0)) { + fprintf(stderr, " Couldn't request CQ notification\n"); + goto destroy_context; + } + if (ibv_req_notify_cq(ctx.recv_cq, 0)) { + fprintf(stderr, " Couldn't request CQ notification\n"); + goto destroy_context; + } + } + /* An additional handshake is required after moving qp to RTR. */ if (ctx_hand_shake(&user_comm,my_dest,rem_dest)) { fprintf(stderr,"Failed to exchange data between server and clients\n");