]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
[2/2] rping: ignore flushed completions
authorHariprasad S <hariprasad@chelsio.com>
Thu, 6 Nov 2014 09:12:57 +0000 (14:42 +0530)
committerSean Hefty <sean.hefty@intel.com>
Fri, 14 Nov 2014 18:47:25 +0000 (10:47 -0800)
Based on original work by Steve Wise <steve@opengridcomputing.com>

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
examples/rping.c

index f0414dec7e4ae6771b9dcecf46eb8fbe5d40c075..58b642e62c0c76493a444cf0baa13da8186082cb 100644 (file)
@@ -277,15 +277,20 @@ static int rping_cq_event_handler(struct rping_cb *cb)
        struct ibv_wc wc;
        struct ibv_recv_wr *bad_wr;
        int ret;
+       int flushed = 0;
 
        while ((ret = ibv_poll_cq(cb->cq, 1, &wc)) == 1) {
                ret = 0;
 
                if (wc.status) {
-                       if (wc.status != IBV_WC_WR_FLUSH_ERR)
-                               fprintf(stderr,
-                                       "cq completion failed status %d\n",
-                                       wc.status);
+                       if (wc.status == IBV_WC_WR_FLUSH_ERR) {
+                               flushed = 1;
+                               continue;
+
+                       }
+                       fprintf(stderr,
+                               "cq completion failed status %d\n",
+                               wc.status);
                        ret = -1;
                        goto error;
                }
@@ -334,7 +339,7 @@ static int rping_cq_event_handler(struct rping_cb *cb)
                fprintf(stderr, "poll error %d\n", ret);
                goto error;
        }
-       return 0;
+       return flushed;
 
 error:
        cb->state = ERROR;