aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2012-03-06 17:30:40 -0800
committerRoland Dreier <roland@purestorage.com>2012-03-06 17:30:40 -0800
commited13892a51d2ba852bf4fe7ac8b149c34134334e (patch)
tree2d86cecce445f965055467c29f8d049df941a977
parent60dade7a5e97da3b2eedf5839169c044f67577b3 (diff)
downloadlibmlx4-ed13892a51d2ba852bf4fe7ac8b149c34134334e.tar.gz
Fix possible missed completion event
If an erroneous CQE is polled in the first iteration (i.e. npolled == 0), we don't update the consumer index and hence the hardware could get a wrong notion of how many CQEs software polled. Fix this by updating the doorbell record on error too. Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--src/cq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cq.c b/src/cq.c
index 8226b6b..0e24fea 100644
--- a/src/cq.c
+++ b/src/cq.c
@@ -340,7 +340,7 @@ int mlx4_poll_cq(struct ibv_cq *ibcq, int ne, struct ibv_wc *wc)
break;
}
- if (npolled)
+ if (npolled || err == CQ_POLL_ERR)
update_cons_index(cq);
pthread_spin_unlock(&cq->lock);