]> git.proxmox.com Git - mirror_ovs.git/blobdiff - lib/netdev-vport.c
Add support for extended netdev statistics based on RFC 2819.
[mirror_ovs.git] / lib / netdev-vport.c
index e398562c6973699a1a4f5c9885c21aa7410aa0a5..678c3f9cc76b1b0fe066131eab53fa4f577d0004 100644 (file)
@@ -851,7 +851,11 @@ get_stats(const struct netdev *netdev, struct netdev_stats *stats)
     struct netdev_vport *dev = netdev_vport_cast(netdev);
 
     ovs_mutex_lock(&dev->mutex);
-    *stats = dev->stats;
+    /* Passing only collected counters */
+    stats->tx_packets = dev->stats.tx_packets;
+    stats->tx_bytes = dev->stats.tx_bytes;
+    stats->rx_packets = dev->stats.rx_packets;
+    stats->rx_bytes = dev->stats.rx_bytes;
     ovs_mutex_unlock(&dev->mutex);
 
     return 0;