提交 56a8c8b6 编写于 作者: R Roland Dreier

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: NRoland Dreier <rolandd@cisco.com>
上级 2446304d
......@@ -297,6 +297,12 @@ int mlx4_ib_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
break;
}
if (unlikely(srq->head == srq->tail)) {
err = -ENOMEM;
*bad_wr = wr;
break;
}
srq->wrid[srq->head] = wr->wr_id;
next = get_wqe(srq, srq->head);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册