Based on original work by Steve Wise <st...@opengridcomputing.com>

Signed-off-by: Hariprasad Shenai <haripra...@chelsio.com>
---
 examples/rping.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/examples/rping.c b/examples/rping.c
index f0414de..58b642e 100644
--- a/examples/rping.c
+++ b/examples/rping.c
@@ -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;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to