aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti/netcp.h
diff options
context:
space:
mode:
authorMichael Scherban <m-scherban@ti.com>2017-01-06 15:37:41 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-07 21:03:50 -0500
commit6a8162e99ef344fcffe14c9a4d1061493c4a81a4 (patch)
treef5d36a7bdeb9c8260d1dd537599ae34bba0675ab /drivers/net/ethernet/ti/netcp.h
parentnet: netcp: remove the redundant memmov() (diff)
downloadlinux-dev-6a8162e99ef344fcffe14c9a4d1061493c4a81a4.tar.xz
linux-dev-6a8162e99ef344fcffe14c9a4d1061493c4a81a4.zip
net: netcp: store network statistics in 64 bits
Previously the network statistics were stored in 32 bit variable which can cause some stats to roll over after several minutes of high traffic. This implements 64 bit storage so larger numbers can be stored. Signed-off-by: Michael Scherban <m-scherban@ti.com> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/netcp.h')
-rw-r--r--drivers/net/ethernet/ti/netcp.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/netcp.h b/drivers/net/ethernet/ti/netcp.h
index a92abd62ec60..d243c5df9d6b 100644
--- a/drivers/net/ethernet/ti/netcp.h
+++ b/drivers/net/ethernet/ti/netcp.h
@@ -23,6 +23,7 @@
#include <linux/netdevice.h>
#include <linux/soc/ti/knav_dma.h>
+#include <linux/u64_stats_sync.h>
/* Maximum Ethernet frame size supported by Keystone switch */
#define NETCP_MAX_FRAME_SIZE 9504
@@ -68,6 +69,20 @@ struct netcp_addr {
struct list_head node;
};
+struct netcp_stats {
+ struct u64_stats_sync syncp_rx ____cacheline_aligned_in_smp;
+ u64 rx_packets;
+ u64 rx_bytes;
+ u32 rx_errors;
+ u32 rx_dropped;
+
+ struct u64_stats_sync syncp_tx ____cacheline_aligned_in_smp;
+ u64 tx_packets;
+ u64 tx_bytes;
+ u32 tx_errors;
+ u32 tx_dropped;
+};
+
struct netcp_intf {
struct device *dev;
struct device *ndev_dev;
@@ -88,6 +103,9 @@ struct netcp_intf {
struct napi_struct rx_napi;
struct napi_struct tx_napi;
+ /* 64-bit netcp stats */
+ struct netcp_stats stats;
+
void *rx_channel;
const char *dma_chan_name;
u32 rx_pool_size;