aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2007-05-20 20:15:11 -0700
committerRoland Dreier <rolandd@cisco.com>2007-05-20 20:15:11 -0700
commit6060de89330a327b45b42020db4fecc124885b18 (patch)
tree780d46bfdd1ec92c3937f788485990406e567ae3
parent20e2b7e6d66cfd43210a00fa0f19690f29de9ca4 (diff)
downloadlibmlx4-6060de89330a327b45b42020db4fecc124885b18.tar.gz
Check if SRQ is full when posting receive
Make mlx4_post_srq_recv() fail if the SRQ is full (head == tail). Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--src/srq.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/srq.c b/src/srq.c
index b6d7635..ba2ceb9 100644
--- a/src/srq.c
+++ b/src/srq.c
@@ -81,6 +81,13 @@ int mlx4_post_srq_recv(struct ibv_srq *ibsrq,
break;
}
+ if (srq->head == srq->tail) {
+ /* SRQ is full*/
+ err = -1;
+ *bad_wr = wr;
+ break;
+ }
+
srq->wrid[srq->head] = wr->wr_id;
next = get_wqe(srq, srq->head);