Skip to content

Commit

Permalink
netdev-linux: remove sum of vport stats and kernel netdev stats.
Browse files Browse the repository at this point in the history
When using kernel veth as OVS interface, doubled drop counter
value is shown when veth drops packets due to traffic overrun.

In netdev_linux_get_stats, it reads both vport stats and kernel
netdev stats, in case vport stats retrieve failure. If both of
them success, error counters are added to include errors from
different layers. But implementation of ovs_vport_get_stats in
kernel data path has included kernel netdev stats by calling
dev_get_stats. When drop or other error counters is not zero,
its value is doubled by netdev_linux_get_stats.

In this change, adding kernel netdev stats into vport stats
is removed, since vport stats includes all information of
kernel netdev stats.

Signed-off-by: Jiang Lidong <jianglidong3@jd.com>
Signed-off-by: William Tu <u9012063@gmail.com>
  • Loading branch information
winter4ling authored and williamtu committed Apr 30, 2020
1 parent f5a36db commit b9f825a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions lib/netdev-linux.c
Expand Up @@ -2208,18 +2208,6 @@ netdev_linux_get_stats(const struct netdev *netdev_,
/* 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;
stats->tx_dropped += dev_stats.tx_dropped;
stats->multicast += dev_stats.multicast;
stats->collisions += dev_stats.collisions;
stats->rx_length_errors += dev_stats.rx_length_errors;
Expand Down

0 comments on commit b9f825a

Please sign in to comment.