aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dst.h
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-07-19 02:02:15 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-19 02:02:15 -0400
commitc1e20f7c8b9ccbafc9ea78f2b406738728ce6b81 (patch)
tree807dacbfdc6ebfde27ba4d4f46dd1572c4a07cde /include/net/dst.h
parent30ee42be00b7a50929a73cb617f70b1d3219eb69 (diff)
tcp: RTT metrics scaling
Some of the metrics (RTT, RTTVAR and RTAX_RTO_MIN) are stored in kernel units (jiffies) and this leaks out through the netlink API to user space where the units for jiffies are unknown. This patches changes the kernel to convert to/from milliseconds. This changes the ABI, but milliseconds seemed like the most natural unit for these parameters. Values available via syscall in /proc/net/rt_cache and netlink will be in milliseconds. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dst.h')
-rw-r--r--include/net/dst.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 002500e631f5..c5c318a628f8 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -128,6 +128,18 @@ static inline u32 dst_mtu(const struct dst_entry *dst)
128 return mtu; 128 return mtu;
129} 129}
130 130
131/* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */
132static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metric)
133{
134 return msecs_to_jiffies(dst_metric(dst, metric));
135}
136
137static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric,
138 unsigned long rtt)
139{
140 dst->metrics[metric-1] = jiffies_to_msecs(rtt);
141}
142
131static inline u32 143static inline u32
132dst_allfrag(const struct dst_entry *dst) 144dst_allfrag(const struct dst_entry *dst)
133{ 145{