aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Campbell <ralphc@pathscale.com>2006-01-07 01:00:16 +0000
committerRoland Dreier <rolandd@cisco.com>2006-11-09 11:35:58 -0800
commit813f1bfc4df520f63698ace8c79635b2e08df291 (patch)
tree88e70b58ae381e6f9324b49df27284bd9cf92cd4
parent94e471bbaa07945adbc77f2dc025ce226ce3433b (diff)
downloadlibibverbs-813f1bfc4df520f63698ace8c79635b2e08df291.tar.gz
Fix test of return value of ibv_poll_cq() in pingpong examples
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--ChangeLog6
-rw-r--r--examples/rc_pingpong.c9
-rw-r--r--examples/srq_pingpong.c9
-rw-r--r--examples/uc_pingpong.c9
-rw-r--r--examples/ud_pingpong.c9
5 files changed, 22 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 863103d..692f55d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-01-06 Ralph Campbell <ralphc@pathscale.com>
+
+ * examples/rc_pingpong.c (main), examples/srq_pingpong.c (main),
+ examples/uc_pingpong.c (main), examples/ud_pingpong.c (main): Fix
+ test of return value of ibv_poll_cq().
+
2006-01-04 Dotan Barak <dotanb@mellanox.co.il>
* include/infiniband/verbs.h: Fix mask names in description of
diff --git a/examples/rc_pingpong.c b/examples/rc_pingpong.c
index 7c5e448..72a076b 100644
--- a/examples/rc_pingpong.c
+++ b/examples/rc_pingpong.c
@@ -643,13 +643,12 @@ int main(int argc, char *argv[])
do {
ne = ibv_poll_cq(ctx->cq, 2, wc);
+ if (ne < 0) {
+ fprintf(stderr, "poll CQ failed %d\n", ne);
+ return 1;
+ }
} while (!use_event && ne < 1);
- if (ne < 0) {
- fprintf(stderr, "poll CQ failed %d\n", ne);
- return 1;
- }
-
for (i = 0; i < ne; ++i) {
if (wc[i].status != IBV_WC_SUCCESS) {
fprintf(stderr, "Failed status %d for wr_id %d\n",
diff --git a/examples/srq_pingpong.c b/examples/srq_pingpong.c
index 8a68dd7..70c59ab 100644
--- a/examples/srq_pingpong.c
+++ b/examples/srq_pingpong.c
@@ -719,13 +719,12 @@ int main(int argc, char *argv[])
do {
ne = ibv_poll_cq(ctx->cq, 2, wc);
+ if (ne < 0) {
+ fprintf(stderr, "poll CQ failed %d\n", ne);
+ return 1;
+ }
} while (!use_event && ne < 1);
- if (ne < 0) {
- fprintf(stderr, "poll CQ failed %d\n", ne);
- return 1;
- }
-
for (i = 0; i < ne; ++i) {
if (wc[i].status != IBV_WC_SUCCESS) {
fprintf(stderr, "Failed status %d for wr_id %d\n",
diff --git a/examples/uc_pingpong.c b/examples/uc_pingpong.c
index fdaa3cb..76ea8e9 100644
--- a/examples/uc_pingpong.c
+++ b/examples/uc_pingpong.c
@@ -631,13 +631,12 @@ int main(int argc, char *argv[])
do {
ne = ibv_poll_cq(ctx->cq, 2, wc);
+ if (ne < 0) {
+ fprintf(stderr, "poll CQ failed %d\n", ne);
+ return 1;
+ }
} while (!use_event && ne < 1);
- if (ne < 0) {
- fprintf(stderr, "poll CQ failed %d\n", ne);
- return 1;
- }
-
for (i = 0; i < ne; ++i) {
if (wc[i].status != IBV_WC_SUCCESS) {
fprintf(stderr, "Failed status %d for wr_id %d\n",
diff --git a/examples/ud_pingpong.c b/examples/ud_pingpong.c
index 0ddd839..e364cd5 100644
--- a/examples/ud_pingpong.c
+++ b/examples/ud_pingpong.c
@@ -639,13 +639,12 @@ int main(int argc, char *argv[])
do {
ne = ibv_poll_cq(ctx->cq, 2, wc);
+ if (ne < 0) {
+ fprintf(stderr, "poll CQ failed %d\n", ne);
+ return 1;
+ }
} while (!use_event && ne < 1);
- if (ne < 0) {
- fprintf(stderr, "poll CQ failed %d\n", ne);
- return 1;
- }
-
for (i = 0; i < ne; ++i) {
if (wc[i].status != IBV_WC_SUCCESS) {
fprintf(stderr, "Failed status %d for wr_id %d\n",