Skip to content

Commit 146d533

Browse files
bjking1gregkh
authored andcommitted
i40e: Use smp_rmb rather than read_barrier_depends
commit 52c6912fde0133981ee50ba08808f257829c4c93 upstream. The original issue being fixed in this patch was seen with the ixgbe driver, but the same issue exists with i40e as well, as the code is very similar. read_barrier_depends is not sufficient to ensure loads following it are not speculatively loaded out of order by the CPU, which can result in stale data being loaded, causing potential system crashes. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 76c389c commit 146d533

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3595,7 +3595,7 @@ static bool i40e_clean_fdir_tx_irq(struct i40e_ring *tx_ring, int budget)
35953595
break;
35963596

35973597
/* prevent any other reads prior to eop_desc */
3598-
read_barrier_depends();
3598+
smp_rmb();
35993599

36003600
/* if the descriptor isn't done, no work yet to do */
36013601
if (!(eop_desc->cmd_type_offset_bsz &

drivers/net/ethernet/intel/i40e/i40e_txrx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
663663
break;
664664

665665
/* prevent any other reads prior to eop_desc */
666-
read_barrier_depends();
666+
smp_rmb();
667667

668668
/* we have caught up to head, no work left to do */
669669
if (tx_head == tx_desc)

0 commit comments

Comments
 (0)