X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev-linux.c;fp=lib%2Fnetdev-linux.c;h=c1d93237eb59165d9fbd13b008d1812dcde0bce3;hb=7d78f21c057ff50a823220d809ac38c3d907243c;hp=f9634b6a4c973abdf1644d8791f8368d9f4b6787;hpb=8d25251929c8f325bed0fff24192d5a87034b32e;p=sliver-openvswitch.git diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index f9634b6a4..c1d93237e 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -47,7 +47,6 @@ #include #include -#include "connectivity.h" #include "coverage.h" #include "dpif-linux.h" #include "dpif-netdev.h" @@ -66,7 +65,6 @@ #include "packets.h" #include "poll-loop.h" #include "rtnetlink-link.h" -#include "seq.h" #include "shash.h" #include "socket-util.h" #include "sset.h" @@ -616,7 +614,7 @@ netdev_linux_changed(struct netdev_linux *dev, unsigned int ifi_flags, unsigned int mask) OVS_REQUIRES(dev->mutex) { - seq_change(connectivity_seq_get()); + netdev_change_seq_changed(&dev->up); if ((dev->ifi_flags ^ ifi_flags) & IFF_RUNNING) { dev->carrier_resets++; @@ -1565,9 +1563,17 @@ netdev_linux_get_stats(const struct netdev *netdev_, error = 0; } } else if (netdev->vport_stats_error) { - /* stats not available from OVS then use ioctl stats. */ + /* stats not available from OVS then use netdev stats. */ *stats = dev_stats; } else { + /* Use kernel netdev's packet and byte counts since vport's counters + * do not reflect packet counts on the wire when GSO, TSO or GRO are + * enabled. */ + stats->rx_packets = dev_stats.rx_packets; + stats->rx_bytes = dev_stats.rx_bytes; + stats->tx_packets = dev_stats.tx_packets; + stats->tx_bytes = dev_stats.tx_bytes; + stats->rx_errors += dev_stats.rx_errors; stats->tx_errors += dev_stats.tx_errors; stats->rx_dropped += dev_stats.rx_dropped; @@ -1631,6 +1637,14 @@ netdev_tap_get_stats(const struct netdev *netdev_, struct netdev_stats *stats) stats->tx_heartbeat_errors = 0; stats->tx_window_errors = 0; } else { + /* Use kernel netdev's packet and byte counts since vport counters + * do not reflect packet counts on the wire when GSO, TSO or GRO + * are enabled. */ + stats->rx_packets = dev_stats.tx_packets; + stats->rx_bytes = dev_stats.tx_bytes; + stats->tx_packets = dev_stats.rx_packets; + stats->tx_bytes = dev_stats.rx_bytes; + stats->rx_dropped += dev_stats.tx_dropped; stats->tx_dropped += dev_stats.rx_dropped;