summaryrefslogtreecommitdiff
path: root/lib/netdev-linux.c
diff options
context:
space:
mode:
authorJiang Lidong <jianglidong3@jd.com>2020-04-23 05:35:14 +0000
committerWilliam Tu <u9012063@gmail.com>2020-04-30 07:35:54 -0700
commitb9f825a5442a979b28a5ec18640129058d334e85 (patch)
treed58c08d4eca51b4198e86af1b1ac0516de301826 /lib/netdev-linux.c
parentf5a36db10b1ffe243a64f650e24160eb985c8eac (diff)
downloadopenvswitch-b9f825a5442a979b28a5ec18640129058d334e85.tar.gz
netdev-linux: remove sum of vport stats and kernel netdev stats.
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>
Diffstat (limited to 'lib/netdev-linux.c')
-rw-r--r--lib/netdev-linux.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 1d7ed0145..40d0cc110 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -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;