Commit ebf692f8 authored by Mart van Santen's avatar Mart van Santen Committed by David S. Miller

xen-netback: vif counters from int/long to u64

This patch fixes an issue where the type of counters in the queue(s)
and interface are not in sync (queue counters are int, interface
counters are long), causing incorrect reporting of tx/rx values
of the vif interface and unclear counter overflows.
This patch sets both counters to the u64 type.
Signed-off-by: default avatarMart van Santen <mart@greenhost.nl>
Reviewed-by: default avatarPaul Durrant <paul.durrant@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0c59d281
...@@ -113,10 +113,10 @@ struct xenvif_stats { ...@@ -113,10 +113,10 @@ struct xenvif_stats {
* A subset of struct net_device_stats that contains only the * A subset of struct net_device_stats that contains only the
* fields that are updated in netback.c for each queue. * fields that are updated in netback.c for each queue.
*/ */
unsigned int rx_bytes; u64 rx_bytes;
unsigned int rx_packets; u64 rx_packets;
unsigned int tx_bytes; u64 tx_bytes;
unsigned int tx_packets; u64 tx_packets;
/* Additional stats used by xenvif */ /* Additional stats used by xenvif */
unsigned long rx_gso_checksum_fixup; unsigned long rx_gso_checksum_fixup;
......
...@@ -221,10 +221,10 @@ static struct net_device_stats *xenvif_get_stats(struct net_device *dev) ...@@ -221,10 +221,10 @@ static struct net_device_stats *xenvif_get_stats(struct net_device *dev)
{ {
struct xenvif *vif = netdev_priv(dev); struct xenvif *vif = netdev_priv(dev);
struct xenvif_queue *queue = NULL; struct xenvif_queue *queue = NULL;
unsigned long rx_bytes = 0; u64 rx_bytes = 0;
unsigned long rx_packets = 0; u64 rx_packets = 0;
unsigned long tx_bytes = 0; u64 tx_bytes = 0;
unsigned long tx_packets = 0; u64 tx_packets = 0;
unsigned int index; unsigned int index;
spin_lock(&vif->lock); spin_lock(&vif->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment