]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[karo-tx-linux.git] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_cmn.c
index dd57c7c5a3da8e011a83e257832a05326147b64e..47c5814114e1764145f18c9c2088e8395214602e 100644 (file)
@@ -6,7 +6,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation.
  *
- * Maintained by: Eilon Greenstein <eilong@broadcom.com>
+ * Maintained by: Ariel Elior <ariel.elior@qlogic.com>
  * Written by: Eliezer Tamir
  * Based on code from Michael Chan's bnx2 driver
  * UDP CSUM errata workaround by Arik Gendelman
@@ -906,6 +906,18 @@ static 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.
+                */
+               rmb();
+
                cqe_fp_flags = cqe_fp->type_error_flags;
                cqe_fp_type = cqe_fp_flags & ETH_FAST_PATH_RX_CQE_TYPE;