[PATCH 5/7][Focal/linux-azure] net: mana: Add WARN_ON_ONCE in case of CQE read overflow
Tim Gardner
tim.gardner at canonical.com
Thu Oct 21 12:23:39 UTC 2021
From: Haiyang Zhang <haiyangz at microsoft.com>
BugLink: https://bugs.launchpad.net/bugs/1947859
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 at microsoft.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit c1a3e9f98dde4782290d2c4871e42b7e76ad5593)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
drivers/net/ethernet/microsoft/mana/gdma_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
index 798099d642027..cee75b561f59d 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;
--
2.33.1
More information about the kernel-team
mailing list