]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fm10k: prevent multiple threads updating statistics
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 7 Jun 2016 23:08:45 +0000 (16:08 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 26 Feb 2017 06:04:17 +0000 (22:04 -0800)
commit1298bad2db9a04456e0a2179eb48d7b55945c67d
treea42594d58a565198adbed52864008d153125d48c
parent13c47e6ddd6dba02719922e39a1dbb5838b628fc
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>
Orabug: 25394529
(cherry picked from commit 9d73edee5900baff47887b36e9b97f45a7d13b6d)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
drivers/net/ethernet/intel/fm10k/fm10k.h
drivers/net/ethernet/intel/fm10k/fm10k_pci.c