diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-09-02 18:23:00 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-26 19:10:45 -0500 |
commit | 1cb345220f135dcca24f01cc04cbb97a8242d419 (patch) | |
tree | 059ec907cd50bd10114bd942d0ffbfa7fd080aa2 /drivers/net/ethernet/sfc/net_driver.h | |
parent | 788ec41cc843f12e8d0eba5f2b37af18b76654a5 (diff) |
sfc: Hold efx_nic::stats_lock while reading efx_nic::mac_stats
efx_nic::stats_lock is used to serialise stats updates, but each
reader was dropping it before it finished reading efx_nic::mac_stats.
If there were concurrent stats reads using procfs, or one using procfs
and one using ethtool, an update could race with a read. On a 32-bit
system, the reader could see word-tearing of 64-bit stats (32 bits of
the old value and 32 bits of the new).
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/net_driver.h')
-rw-r--r-- | drivers/net/ethernet/sfc/net_driver.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 9353ce801752..b6040141ef79 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h | |||
@@ -704,6 +704,7 @@ struct efx_filter_state; | |||
704 | * can provide. Generic code converts these into a standard | 704 | * can provide. Generic code converts these into a standard |
705 | * &struct net_device_stats. | 705 | * &struct net_device_stats. |
706 | * @stats_lock: Statistics update lock. Serialises statistics fetches | 706 | * @stats_lock: Statistics update lock. Serialises statistics fetches |
707 | * and access to @mac_stats. | ||
707 | * | 708 | * |
708 | * This is stored in the private area of the &struct net_device. | 709 | * This is stored in the private area of the &struct net_device. |
709 | */ | 710 | */ |