Thread (40 messages) 40 messages, 9 authors, 2014-02-28

Re: [PATCH v4 net-next] tcp: switch rtt estimations to usec resolution

From: Julian Anastasov <ja@ssi.bg>
Date: 2014-02-24 23:02:05

	Hello,

On Mon, 24 Feb 2014, Eric Dumazet wrote:
On Mon, 2014-02-24 at 22:47 +0200, Julian Anastasov wrote:
quoted
	May be you missed my last email. In tcpm_suck_dst()
dst_metric_raw(dst, RTAX_RTT) returns msecs and we store
it in tcpm_vals[] which is now in usec units. If we want to keep
dst metrics in msec units we can fix this only in tcpm_suck_dst.
Otherwise, similar attributes for dst metrics in ip/iproute.c
are needed.
Well, I do not see an immediate need to support usec for these
attributes. This might be changed later if needed.
	Agreed.
quoted hunk ↗ jump to hunk
So I think we can simply do :

diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index d547075d8300..c8d0b1b18b8e 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
-static void tcpm_suck_dst(struct tcp_metrics_block *tm, struct dst_entry *dst,
+static void tcpm_suck_dst(struct tcp_metrics_block *tm,
+                         const struct dst_entry *dst,
                          bool fastopen_clear)
 {
+       u32 msval;
        u32 val;
 
        tm->tcpm_stamp = jiffies;
@@ -121,8 +115,11 @@ static void tcpm_suck_dst(struct tcp_metrics_block *tm, struct dst_entry *dst,
                val |= 1 << TCP_METRIC_REORDERING;
        tm->tcpm_lock = val;
 
-       tm->tcpm_vals[TCP_METRIC_RTT] = dst_metric_raw(dst, RTAX_RTT);
-       tm->tcpm_vals[TCP_METRIC_RTTVAR] = dst_metric_raw(dst, RTAX_RTTVAR);
+       msval = dst_metric_raw(dst, RTAX_RTT);
+       tm->tcpm_vals[TCP_METRIC_RTT] = msval * USEC_PER_MSEC;
+
+       msval = dst_metric_raw(dst, RTAX_RTTVAR);
+       tm->tcpm_vals[TCP_METRIC_RTTVAR] = msval * USEC_PER_MSEC;
        tm->tcpm_vals[TCP_METRIC_SSTHRESH] = dst_metric_raw(dst, RTAX_SSTHRESH);
        tm->tcpm_vals[TCP_METRIC_CWND] = dst_metric_raw(dst, RTAX_CWND);
        tm->tcpm_vals[TCP_METRIC_REORDERING] = dst_metric_raw(dst, RTAX_REORDERING);
Is that ok ?
	Yes, looks fine. Thanks!

Regards

--
Julian Anastasov [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help