summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/microsoft/mana/gdma_main.c
diff options
context:
space:
mode:
authorHaiyang Zhang <haiyangz@microsoft.com>2021-08-24 09:46:01 -0700
committerDavid S. Miller <davem@davemloft.net>2021-08-25 11:06:54 +0100
commitc1a3e9f98dde4782290d2c4871e42b7e76ad5593 (patch)
tree813314a6d6a41b496b8df6dffe437fbd91ee189f /drivers/net/ethernet/microsoft/mana/gdma_main.c
parent1e2d0824a9c3de5371a46601aac0c14af5c0a50a (diff)
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: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/microsoft/mana/gdma_main.c')
-rw-r--r--drivers/net/ethernet/microsoft/mana/gdma_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
index 798099d64202..cee75b561f59 100644
--- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
+++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
@@ -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;