]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Revert "Increase internal clock resolution to nsec"
authorStephen Hemminger <shemminger@linux-foundation.org>
Wed, 14 Mar 2007 17:14:07 +0000 (10:14 -0700)
committerStephen Hemminger <shemminger@linux-foundation.org>
Wed, 14 Mar 2007 17:14:07 +0000 (10:14 -0700)
This reverts fd784ccaf649128965be016f857708669e798479 commit.

Thanks Stephen, but actually I think the last patch (increase clock
resolution) shouldn't go in yet. I'm not done yet looking at all
the compatibility issues and it does change the range of valid
values for everything dealing with times. Most places I looked
at still accept reasonable ranges, but I would feel more comfortable
to make sure everything is fine first.

tc/tc_core.h
tc/tc_util.c

index 28bf97a2e8f97ad7d413e2cf87ef6d3212375e72..a139da6f6652d37d209677aeaff60874b9c147c6 100644 (file)
@@ -4,7 +4,7 @@
 #include <asm/types.h>
 #include <linux/pkt_sched.h>
 
-#define TIME_UNITS_PER_SEC     1000000000
+#define TIME_UNITS_PER_SEC     1000000
 
 int  tc_core_time2big(long time);
 long tc_core_time2tick(long time);
index a07c6aad9ee55d0ca51987d6cc1891990b8401b9..a7e42572db19d44a81ab10d9176ff85cced1d846 100644 (file)
@@ -228,9 +228,6 @@ int get_time(unsigned *time, const char *str)
                else if (strcasecmp(p, "us") == 0 || strcasecmp(p, "usec")==0 ||
                         strcasecmp(p, "usecs") == 0)
                        t *= TIME_UNITS_PER_SEC/1000000;
-               else if (strcasecmp(p, "ns") == 0 || strcasecmp(p, "nsec")==0 ||
-                        strcasecmp(p, "nsecs") == 0)
-                       t *= TIME_UNITS_PER_SEC/1000000000;
                else
                        return -1;
        }
@@ -248,10 +245,8 @@ void print_time(char *buf, int len, __u32 time)
                snprintf(buf, len, "%.1fs", tmp/TIME_UNITS_PER_SEC);
        else if (tmp >= TIME_UNITS_PER_SEC/1000)
                snprintf(buf, len, "%.1fms", tmp/(TIME_UNITS_PER_SEC/1000));
-       else if (tmp >= TIME_UNITS_PER_SEC/1000000)
-               snprintf(buf, len, "%.1fus", tmp/(TIME_UNITS_PER_SEC/1000000));
        else
-               snprintf(buf, len, "%uns", time);
+               snprintf(buf, len, "%uus", time);
 }
 
 char * sprint_time(__u32 time, char *buf)