mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
IB/mlx4: 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>
This commit is contained in:
parent
2446304dd6
commit
56a8c8b6ac
1 changed files with 6 additions and 0 deletions
|
@ -297,6 +297,12 @@ int mlx4_ib_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unlikely(srq->head == srq->tail)) {
|
||||||
|
err = -ENOMEM;
|
||||||
|
*bad_wr = wr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
srq->wrid[srq->head] = wr->wr_id;
|
srq->wrid[srq->head] = wr->wr_id;
|
||||||
|
|
||||||
next = get_wqe(srq, srq->head);
|
next = get_wqe(srq, srq->head);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue