[ovs-dev] [stress 2/4] netdev-linux: Remove counter double-increments.

Ben Pfaff blp at nicira.com
Mon Nov 1 23:13:47 UTC 2010


A few coverage counters were incremented both in netdev generic code and
in netdev_linux code.  This commit drops the increments from the
lower-level code.

(This is not an actual bug because these counters are used only for
logging.)
---
 lib/netdev-linux.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 0c5ba8b..a86af4d 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -1057,8 +1057,6 @@ netdev_linux_get_stats(const struct netdev *netdev_,
     static int use_netlink_stats = -1;
     int error;
 
-    COVERAGE_INC(netdev_get_stats);
-
     if (netdev_dev->have_vport_stats ||
         !(netdev_dev->cache_valid & VALID_HAVE_VPORT_STATS)) {
 
@@ -1873,7 +1871,6 @@ netdev_linux_add_router(struct netdev *netdev OVS_UNUSED, struct in_addr router)
     make_in4_sockaddr(&rt.rt_gateway, router);
     make_in4_sockaddr(&rt.rt_genmask, any);
     rt.rt_flags = RTF_UP | RTF_GATEWAY;
-    COVERAGE_INC(netdev_add_router);
     error = ioctl(af_inet_sock, SIOCADDRT, &rt) < 0 ? errno : 0;
     if (error) {
         VLOG_WARN("ioctl(SIOCADDRT): %s", strerror(error));
-- 
1.7.1





More information about the dev mailing list