summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc/efx_common.c
diff options
context:
space:
mode:
authorEdward Cree <ecree@solarflare.com>2020-09-29 23:25:24 +0300
committerDavid S. Miller <davem@davemloft.net>2020-09-30 00:02:54 +0300
commit623b9988bfd146a438e55816dbfdf8f9a5290dd5 (patch)
tree4e4aea723cd20c23ae603d4e2b37b000e934212a /drivers/net/ethernet/sfc/efx_common.c
parent606dbf8d5df129fd6b404f69c520e2d2feddc424 (diff)
downloadlinux-623b9988bfd146a438e55816dbfdf8f9a5290dd5.tar.xz
net: sfc: Replace in_interrupt() usage
efx_ef10_try_update_nic_stats_vf() used in_interrupt() to figure out whether it is safe to sleep (for MCDI) or not. The only caller from which it was not is efx_net_stats(), which can be invoked under dev_base_lock from net-sysfs::netstat_show(). So add a new update_stats_atomic() method to struct efx_nic_type, and call it from efx_net_stats(), removing the need for efx_ef10_try_update_nic_stats_vf() to behave differently for this case (which it wasn't doing correctly anyway). For all nic_types other than EF10 VF, this method is NULL so the the regular update_stats() methods are invoked , which are happy with being called from atomic contexts. Fixes: f00bf2305cab ("sfc: don't update stats on VF when called in atomic context") Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Martin Habets <mhabets@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/efx_common.c')
-rw-r--r--drivers/net/ethernet/sfc/efx_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
index c256db241570..72a3f0e09f52 100644
--- a/drivers/net/ethernet/sfc/efx_common.c
+++ b/drivers/net/ethernet/sfc/efx_common.c
@@ -602,7 +602,7 @@ void efx_net_stats(struct net_device *net_dev, struct rtnl_link_stats64 *stats)
struct efx_nic *efx = netdev_priv(net_dev);
spin_lock_bh(&efx->stats_lock);
- efx->type->update_stats(efx, NULL, stats);
+ efx_nic_update_stats_atomic(efx, NULL, stats);
spin_unlock_bh(&efx->stats_lock);
}