From: Pravin B Shelar Date: Mon, 5 Mar 2012 23:44:30 +0000 (-0800) Subject: netdev-linux: Make netdev_set_policing coverage counter consistent with other counters. X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=5d16a02100f9b7a1904a9f297501feae33eebfb1 netdev-linux: Make netdev_set_policing coverage counter consistent with other counters. Most of coverage counters in netdev-linux are counting actual system calls rather than reads from cached data. Following patch fixes it by incrementing it after cache check. Signed-off-by: Pravin B Shelar --- diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 5c322ca08..8a8f91275 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -1589,7 +1589,6 @@ netdev_linux_set_policing(struct netdev *netdev, const char *netdev_name = netdev_get_name(netdev); int error; - COVERAGE_INC(netdev_set_policing); kbits_burst = (!kbits_rate ? 0 /* Force to 0 if no rate specified. */ : !kbits_burst ? 1000 /* Default to 1000 kbits if 0. */ @@ -1602,6 +1601,7 @@ netdev_linux_set_policing(struct netdev *netdev, return 0; } + COVERAGE_INC(netdev_set_policing); /* Remove any existing ingress qdisc. */ error = tc_add_del_ingress_qdisc(netdev, false); if (error) {