From 612eae1f6fe3320a9a657b99b130a9dc6db53858 Mon Sep 17 00:00:00 2001 From: Hariprasad S Date: Thu, 6 Nov 2014 14:42:57 +0530 Subject: [PATCH] rping: ignore flushed completions Based on original work by Steve Wise Signed-off-by: Hariprasad Shenai Signed-off-by: Sean Hefty --- examples/rping.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/rping.c b/examples/rping.c index f0414dec..58b642e6 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; -- 2.41.0