Commit c1a3e9f9 authored by Haiyang Zhang's avatar Haiyang Zhang Committed by David S. Miller
Browse files

net: mana: Add WARN_ON_ONCE in case of CQE read overflow



This is not an expected case normally.
Add WARN_ON_ONCE in case of CQE read overflow, instead of failing
silently.

Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1e2d0824
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1093,7 +1093,7 @@ static int mana_gd_read_cqe(struct gdma_queue *cq, struct gdma_comp *comp)

	new_bits = (cq->head / num_cqe) & GDMA_CQE_OWNER_MASK;
	/* Return -1 if overflow detected. */
	if (owner_bits != new_bits)
	if (WARN_ON_ONCE(owner_bits != new_bits))
		return -1;

	comp->wq_num = cqe->cqe_info.wq_num;