summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/fm10k/fm10k.h
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2016-06-08 02:08:45 +0300
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-07-21 01:22:10 +0300
commit9d73edee5900baff47887b36e9b97f45a7d13b6d (patch)
treea0422d066915f931b98a2955b0e9aa5f4bc83154 /drivers/net/ethernet/intel/fm10k/fm10k.h
parentb624714bc90064eeefd9ba7564e90865eef00421 (diff)
downloadlinux-9d73edee5900baff47887b36e9b97f45a7d13b6d.tar.xz
fm10k: prevent multiple threads updating statistics
Also prevent updating stats while the interface is down. If we're already updating stats, just return doing nothing. When we take the device down, block stat updates until we come back up. This ensures that we avoid tearing down rings when we're updating statistics, and prevents updating statistics until we're up. We can't re-use the __FM10K_DOWN for this because it wouldn't prevent multiple threads from accessing statistics. Neither does it prevent the case where we start updating stats and then start going down in another thread. The fm10k_get_stats64 is except from this, because it has a completely different flow which does not suffer from the same issues as fm10k_update_stats might. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/fm10k/fm10k.h')
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h
index e98b86bf0ca1..c8d0817766bf 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k.h
+++ b/drivers/net/ethernet/intel/fm10k/fm10k.h
@@ -362,6 +362,7 @@ enum fm10k_state_t {
__FM10K_SERVICE_DISABLE,
__FM10K_MBX_LOCK,
__FM10K_LINK_DOWN,
+ __FM10K_UPDATING_STATS,
};
static inline void fm10k_mbx_lock(struct fm10k_intfc *interface)