aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/netdevice.h6
-rw-r--r--net/core/dev.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index fdc3f2992230..b6262898ece0 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -501,9 +501,9 @@ struct netdev_queue {
501 * please use this field instead of dev->trans_start 501 * please use this field instead of dev->trans_start
502 */ 502 */
503 unsigned long trans_start; 503 unsigned long trans_start;
504 unsigned long tx_bytes; 504 u64 tx_bytes;
505 unsigned long tx_packets; 505 u64 tx_packets;
506 unsigned long tx_dropped; 506 u64 tx_dropped;
507} ____cacheline_aligned_in_smp; 507} ____cacheline_aligned_in_smp;
508 508
509#ifdef CONFIG_RPS 509#ifdef CONFIG_RPS
diff --git a/net/core/dev.c b/net/core/dev.c
index 1c002c7ef5d5..9de75cdade56 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5282,15 +5282,17 @@ void netdev_run_todo(void)
5282void dev_txq_stats_fold(const struct net_device *dev, 5282void dev_txq_stats_fold(const struct net_device *dev,
5283 struct rtnl_link_stats64 *stats) 5283 struct rtnl_link_stats64 *stats)
5284{ 5284{
5285 unsigned long tx_bytes = 0, tx_packets = 0, tx_dropped = 0; 5285 u64 tx_bytes = 0, tx_packets = 0, tx_dropped = 0;
5286 unsigned int i; 5286 unsigned int i;
5287 struct netdev_queue *txq; 5287 struct netdev_queue *txq;
5288 5288
5289 for (i = 0; i < dev->num_tx_queues; i++) { 5289 for (i = 0; i < dev->num_tx_queues; i++) {
5290 txq = netdev_get_tx_queue(dev, i); 5290 txq = netdev_get_tx_queue(dev, i);
5291 spin_lock_bh(&txq->_xmit_lock);
5291 tx_bytes += txq->tx_bytes; 5292 tx_bytes += txq->tx_bytes;
5292 tx_packets += txq->tx_packets; 5293 tx_packets += txq->tx_packets;
5293 tx_dropped += txq->tx_dropped; 5294 tx_dropped += txq->tx_dropped;
5295 spin_unlock_bh(&txq->_xmit_lock);
5294 } 5296 }
5295 if (tx_bytes || tx_packets || tx_dropped) { 5297 if (tx_bytes || tx_packets || tx_dropped) {
5296 stats->tx_bytes = tx_bytes; 5298 stats->tx_bytes = tx_bytes;