Fixed an issue with ib_write_bw, test hangs randomly with qp > 5.
Completion count is incorrectly incremented by cq_mod even if posted work 
requests are less than cq_mod.

Signed-off-by: Mitesh Ahuja <[email protected]>
---
src/perftest_resources.c |   10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/perftest_resources.c b/src/perftest_resources.c
index ac03c88..822690d 100755
--- a/src/perftest_resources.c
+++ b/src/perftest_resources.c
@@ -2400,6 +2400,7 @@ int run_iter_bw(struct pingpong_context *ctx,struct 
perftest_parameters *user_pa
        int                     is_sending_burst = 0;
        int                     cpu_mhz = 0;
        int                     return_value = 0;
+       int                     qp_poll_ccnt = 0;

        ALLOCATE(wc ,struct ibv_wc ,CTX_POLL_BATCH);

@@ -2584,8 +2585,13 @@ int run_iter_bw(struct pingpong_context *ctx,struct 
perftest_parameters *user_pa
                                                return_value = 1;
                                                goto cleaning;
                                        }
-                                       ctx->ccnt[(int)wc[i].wr_id] += 
user_param->cq_mod;
-                                       totccnt += user_param->cq_mod;
+                                       qp_poll_ccnt = 
ctx->scnt[(int)wc[i].wr_id] - ctx->ccnt[(int)wc[i].wr_id];
+
+                                       if (qp_poll_ccnt > user_param->cq_mod)
+                                               qp_poll_ccnt = 
user_param->cq_mod;
+
+                                       ctx->ccnt[(int)wc[i].wr_id] += 
qp_poll_ccnt;
+                                       totccnt += qp_poll_ccnt;

                                        if (user_param->noPeak == OFF) {

--

<<attachment: winmail.dat>>

Reply via email to