summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc/efx.c
diff options
context:
space:
mode:
authorEdward Cree <ecree@solarflare.com>2014-07-15 14:58:12 +0400
committerDavid S. Miller <davem@davemloft.net>2014-07-16 09:53:34 +0400
commite4d112e4f9502083fd27f9ac1a4cd690e3f01421 (patch)
tree1e6d9f30d787d9df8214378923ea621af2afb0be /drivers/net/ethernet/sfc/efx.c
parentd762d038497c9df51c19fcbe69b094b3bf8e5568 (diff)
downloadlinux-e4d112e4f9502083fd27f9ac1a4cd690e3f01421.tar.xz
sfc: add extra RX drop counters for nodesc_trunc and noskb_drop
Added a counter rx_noskb_drop for failure to allocate an skb. Summed the per-channel rx_nodesc_trunc counters earlier so that they can be included in rx_dropped. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/efx.c')
-rw-r--r--drivers/net/ethernet/sfc/efx.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 2d8622430012..4b80c0be6e57 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2724,6 +2724,17 @@ static void efx_fini_struct(struct efx_nic *efx)
}
}
+void efx_update_sw_stats(struct efx_nic *efx, u64 *stats)
+{
+ u64 n_rx_nodesc_trunc = 0;
+ struct efx_channel *channel;
+
+ efx_for_each_channel(channel, efx)
+ n_rx_nodesc_trunc += channel->n_rx_nodesc_trunc;
+ stats[GENERIC_STAT_rx_nodesc_trunc] = n_rx_nodesc_trunc;
+ stats[GENERIC_STAT_rx_noskb_drops] = atomic_read(&efx->n_rx_noskb_drops);
+}
+
/**************************************************************************
*
* PCI interface