Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56a8c8b6 authored by Roland Dreier's avatar Roland Dreier
Browse files

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: default avatarRoland Dreier <rolandd@cisco.com>
parent 2446304d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);