
From: Guofeng Yue <yueguofeng@h-partners.com> In perform_warm_up mode, if the length of post_list is 1 and the message size is less than or equal to 8192, all send_flags in WRs are 0 and CQEs will not be generated since IBV_SEND_SIGNALED is not set. As a result, the perform_warm_up process will stuck in an infinite poll-CQ loop. Set IBV_SEND_SIGNALED in this case to requiring CQE, and clear the flag after post_send_method to avoid affecting subsequent tests. Fixes: 56d025e4f19a ("Allow overriding CQ moderation on post list mode (#58)") Signed-off-by: Guofeng Yue <yueguofeng@h-partners.com> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> --- src/perftest_resources.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/perftest_resources.c b/src/perftest_resources.c index 6543bc7..582d00b 100755 --- a/src/perftest_resources.c +++ b/src/perftest_resources.c @@ -3448,6 +3448,7 @@ int perform_warm_up(struct pingpong_context *ctx,struct perftest_parameters *use struct ibv_wc *wc_for_cleaning = NULL; int num_of_qps = user_param->num_of_qps; int return_value = 0; + int flag = 0; if(user_param->duplex && (user_param->use_xrc || user_param->connection_type == DC)) num_of_qps /= 2; @@ -3464,9 +3465,13 @@ int perform_warm_up(struct pingpong_context *ctx,struct perftest_parameters *use ne = ibv_poll_cq(ctx->send_cq,user_param->tx_depth,wc_for_cleaning); for (index=0 ; index < num_of_qps ; index++) { + /* ask for completion on this wr */ + if (user_param->post_list == 1 && !(ctx->wr[index].send_flags & IBV_SEND_SIGNALED)) { + ctx->wr[index].send_flags |= IBV_SEND_SIGNALED; + flag = 1; + } for (warmindex = 0 ;warmindex < warmupsession ;warmindex += user_param->post_list) { - err = post_send_method(ctx, index, user_param); if (err) { fprintf(stderr,"Couldn't post send during warm up: qp %d scnt=%d \n",index,warmindex); @@ -3475,6 +3480,12 @@ int perform_warm_up(struct pingpong_context *ctx,struct perftest_parameters *use } } + /* Clear the flag to avoid affecting subsequent tests. */ + if (flag) { + ctx->wr[index].send_flags &= ~IBV_SEND_SIGNALED; + flag = 0; + } + do { ne = ibv_poll_cq(ctx->send_cq,1,&wc); -- 2.33.0