diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-07-26 02:49:34 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-31 05:27:57 -0400 |
commit | 30cfd0baf0a0c4329fff1ef4b622919297969ec8 (patch) | |
tree | 945a72f636ced1b443d894495704237e4cb7816d /net/ipv4/tcp_illinois.c | |
parent | 6a302358d87fedaf7bda12b8e909265ebf1ce674 (diff) |
[TCP]: congestion control API pass RTT in microseconds
This patch changes the API for the callback that is done after an ACK is
received. It solves a couple of issues:
* Some congestion controls want higher resolution value of RTT
(controlled by TCP_CONG_RTT_SAMPLE flag). These don't really want a ktime, but
all compute a RTT in microseconds.
* Other congestion control could use RTT at jiffies resolution.
To keep API consistent the units should be the same for both cases, just the
resolution should change.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_illinois.c')
-rw-r--r-- | net/ipv4/tcp_illinois.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/ipv4/tcp_illinois.c b/net/ipv4/tcp_illinois.c index cc5de6f69d46..64f1cbaf96e8 100644 --- a/net/ipv4/tcp_illinois.c +++ b/net/ipv4/tcp_illinois.c | |||
@@ -83,18 +83,16 @@ static void tcp_illinois_init(struct sock *sk) | |||
83 | } | 83 | } |
84 | 84 | ||
85 | /* Measure RTT for each ack. */ | 85 | /* Measure RTT for each ack. */ |
86 | static void tcp_illinois_acked(struct sock *sk, u32 pkts_acked, ktime_t last) | 86 | static void tcp_illinois_acked(struct sock *sk, u32 pkts_acked, s32 rtt) |
87 | { | 87 | { |
88 | struct illinois *ca = inet_csk_ca(sk); | 88 | struct illinois *ca = inet_csk_ca(sk); |
89 | u32 rtt; | ||
90 | 89 | ||
91 | ca->acked = pkts_acked; | 90 | ca->acked = pkts_acked; |
92 | 91 | ||
93 | if (ktime_equal(last, net_invalid_timestamp())) | 92 | /* dup ack, no rtt sample */ |
93 | if (rtt < 0) | ||
94 | return; | 94 | return; |
95 | 95 | ||
96 | rtt = ktime_to_us(net_timedelta(last)); | ||
97 | |||
98 | /* ignore bogus values, this prevents wraparound in alpha math */ | 96 | /* ignore bogus values, this prevents wraparound in alpha math */ |
99 | if (rtt > RTT_MAX) | 97 | if (rtt > RTT_MAX) |
100 | rtt = RTT_MAX; | 98 | rtt = RTT_MAX; |