aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnxt/bnxt.h
diff options
context:
space:
mode:
authorMichael Chan <michael.chan@broadcom.com>2016-05-10 19:17:59 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-11 23:46:09 -0400
commit376a5b8647d6c56cb8f104d7ad0390b4f4057e70 (patch)
tree5a55fdc7b2d013effdf0fdd7c5e4217deb754e16 /drivers/net/ethernet/broadcom/bnxt/bnxt.h
parentqlcnic: potential NULL dereference in qlcnic_83xx_get_minidump_template() (diff)
downloadlinux-dev-376a5b8647d6c56cb8f104d7ad0390b4f4057e70.tar.xz
linux-dev-376a5b8647d6c56cb8f104d7ad0390b4f4057e70.zip
bnxt_en: Add workaround to detect bad opaque in rx completion (part 1)
There is a rare hardware bug that can cause a bad opaque value in the RX or TPA completion. When this happens, the hardware may have used the same buffer twice for 2 rx packets. In addition, the driver will also crash later using the bad opaque as the index into the ring. The rx opaque value is predictable and is always monotonically increasing. The workaround is to keep track of the expected next opaque value and compare it with the one returned by hardware during RX and TPA start completions. If they miscompare, we will not process any more RX and TPA completions and exit NAPI. We will then schedule a workqueue to reset the function. This patch adds the logic to keep track of the next rx consumer index. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 8b823ff558ff..52f2d74a0d04 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -584,6 +584,7 @@ struct bnxt_rx_ring_info {
u16 rx_prod;
u16 rx_agg_prod;
u16 rx_sw_agg_prod;
+ u16 rx_next_cons;
void __iomem *rx_doorbell;
void __iomem *rx_agg_doorbell;