summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/igbvf/igbvf.h
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2013-01-31 07:15:51 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-02-15 21:46:51 -0800
commit3eb1a40f4b6d0c41feb60e55b53d11f70fc8ee8e (patch)
tree832de933f9b809bb53ec4071442ebb9d7e300aeb /drivers/net/ethernet/intel/igbvf/igbvf.h
parente792cd916cf74315bddb2c8b2323ef498cd7bfde (diff)
downloadkernel-common-3eb1a40f4b6d0c41feb60e55b53d11f70fc8ee8e.tar.gz
kernel-common-3eb1a40f4b6d0c41feb60e55b53d11f70fc8ee8e.tar.bz2
kernel-common-3eb1a40f4b6d0c41feb60e55b53d11f70fc8ee8e.zip
igbvf: Make next_to_watch a pointer and adjust memory barriers to avoid races
This change is meant to address several race issues that become possible because next_to_watch could possibly be set to a value that shows that the descriptor is done when it is not. In order to correct that we instead make next_to_watch a pointer that is set to NULL during cleanup, and set to the eop_desc after the descriptor rings have been written. To enforce proper ordering the next_to_watch pointer is not set until after a wmb writing the values to the last descriptor in a transmit. In order to guarantee that the descriptor is not read until after the eop_desc we use the read_barrier_depends which is only really necessary on the alpha architecture. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Acked-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igbvf/igbvf.h')
-rw-r--r--drivers/net/ethernet/intel/igbvf/igbvf.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/igbvf/igbvf.h b/drivers/net/ethernet/intel/igbvf/igbvf.h
index fdca7b672776..a1463e3d14c0 100644
--- a/drivers/net/ethernet/intel/igbvf/igbvf.h
+++ b/drivers/net/ethernet/intel/igbvf/igbvf.h
@@ -127,8 +127,8 @@ struct igbvf_buffer {
/* Tx */
struct {
unsigned long time_stamp;
+ union e1000_adv_tx_desc *next_to_watch;
u16 length;
- u16 next_to_watch;
u16 mapped_as_page;
};
/* Rx */