[3.13.y.z extended stable] Patch "bnx2x: Fix kernel crash and data miscompare after EEH recovery" has been added to staging queue
kamal at canonical.com
Tue Sep 2 21:37:13 UTC 2014
This is a note to let you know that I have just added a patch titled
bnx2x: Fix kernel crash and data miscompare after EEH recovery
to the linux-3.13.y-queue branch of the 3.13.y.z extended stable tree
which can be found at:
This patch is scheduled to be released in version 188.8.131.52.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.13.y.z tree, see
>From 7a12d009299eb202e322764e0a5fa8926a7ea28d Mon Sep 17 00:00:00 2001
From: "wenxiong at linux.vnet.ibm.com" <wenxiong at linux.vnet.ibm.com>
Date: Tue, 3 Jun 2014 14:14:46 -0500
Subject: bnx2x: Fix kernel crash and data miscompare after EEH recovery
commit 9aaae044abe95de182d09004cc3fa181bf22e6e0 upstream.
A rmb() is required to ensure that the CQE is not read before it
is written by the adapter DMA. PCI ordering rules will make sure
the other fields are written before the marker at the end of struct
eth_fast_path_rx_cqe but without rmb() a weakly ordered processor can
process stale data.
Without the barrier we have observed various crashes including
bnx2x_tpa_start being called on queues not stopped (resulting in message
start of bin not in stop) and NULL pointer exceptions from bnx2x_rx_int.
Signed-off-by: Milton Miller <miltonm at us.ibm.com>
Signed-off-by: Wen Xiong <wenxiong at linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Cc: Andy Whitcroft <apw at canonical.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 6089bc4..a9324f4 100644
@@ -868,6 +868,18 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
bd_prod = RX_BD(bd_prod);
bd_cons = RX_BD(bd_cons);
+ /* A rmb() is required to ensure that the CQE is not read
+ * before it is written by the adapter DMA. PCI ordering
+ * rules will make sure the other fields are written before
+ * the marker at the end of struct eth_fast_path_rx_cqe
+ * but without rmb() a weakly ordered processor can process
+ * stale data. Without the barrier TPA state-machine might
+ * enter inconsistent state and kernel stack might be
+ * provided with incorrect packet description - these lead
+ * to various kernel crashed.
cqe_fp_flags = cqe_fp->type_error_flags;
cqe_fp_type = cqe_fp_flags & ETH_FAST_PATH_RX_CQE_TYPE;
More information about the kernel-team