[ofa-general] [PATCH] perftest : Corrected ibv_poll_cq calls

Nicolas Morey Chaisemartin nicolas.morey-chaisemartin at ext.bull.net
Tue Oct 21 23:10:28 PDT 2008


Hi,

WHile reading the code to undertsand the perftests, I noticed that in 2 
of them, the loop on ibv_poll_cq only exists when the call read a CQE, 
but not in the case of an error (though the code looks for an error 
return value right after).
(My apologies if patch isn't at the right format...First time using git.)

Nicolas Morey-Chaisemartin
______

diff --git a/read_lat.c b/read_lat.c
index 8119f57..bf3f5fd 100755
--- a/read_lat.c
+++ b/read_lat.c
@@ -706,7 +706,7 @@ int run_iter(struct pingpong_context *ctx, struct 
user_parameters *user_param,
                }
                do {
                        ne = ibv_poll_cq(ctx->cq, 1, &wc);
-               } while (!user_param->use_event && ne < 1);
+               } while (!user_param->use_event && ne ==0);
 
                if (ne < 0) {
                        fprintf(stderr, "poll CQ failed %d\n", ne);
diff --git a/send_lat.c b/send_lat.c
index b2796d6..f69e9a8 100755
--- a/send_lat.c
+++ b/send_lat.c
@@ -887,7 +887,7 @@ int run_iter(struct pingpong_context *ctx, struct 
user_parameters *user_param,
             }
                        do {
                                ne = ibv_poll_cq(ctx->rcq, 1, &wc);
-                       } while (!user_param->use_event && ne < 1);
+                       } while (!user_param->use_event && ne == 0);
 
                        if (ne < 0) {
                                fprintf(stderr, "Poll Recieve CQ failed 
%d\n", ne);
@@ -950,7 +950,7 @@ int run_iter(struct pingpong_context *ctx, struct 
user_parameters *user_param,
                        /* poll on scq */
                        do {
                                ne = ibv_poll_cq(ctx->scq, 1, &wc);
-                       } while (!user_param->use_event && ne < 1);
+                       } while (!user_param->use_event && ne == 0);
 
                        if (ne < 0) {
                                fprintf(stderr, "poll SCQ failed %d\n", ne);




More information about the general mailing list