]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: mana: Add WARN_ON_ONCE in case of CQE read overflow
authorHaiyang Zhang <haiyangz@microsoft.com>
Tue, 24 Aug 2021 16:46:01 +0000 (09:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Aug 2021 10:06:54 +0000 (11:06 +0100)
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>
drivers/net/ethernet/microsoft/mana/gdma_main.c

index 798099d642027044b18c301f985c2b4ad05e1707..cee75b561f59d0ff9b8b293139a599260887aa0a 100644 (file)
@@ -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;