All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perftest: Incorrect completion count in ib_write_bw.
@ 2015-03-25  9:23 Mitesh Ahuja
  0 siblings, 0 replies; only message in thread
From: Mitesh Ahuja @ 2015-03-25  9:23 UTC (permalink / raw)
  To: gilr-VPRAkNaXOzVWk0Htik3J/w; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1848 bytes --]

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 <mitesh.ahuja-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
---
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 #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 10161 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-25  9:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25  9:23 [PATCH] perftest: Incorrect completion count in ib_write_bw Mitesh Ahuja

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.