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_veno.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_veno.c')
-rw-r--r-- | net/ipv4/tcp_veno.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c index 7a55ddf86032..8fb2aee0b1a4 100644 --- a/net/ipv4/tcp_veno.c +++ b/net/ipv4/tcp_veno.c | |||
@@ -69,16 +69,16 @@ static void tcp_veno_init(struct sock *sk) | |||
69 | } | 69 | } |
70 | 70 | ||
71 | /* Do rtt sampling needed for Veno. */ | 71 | /* Do rtt sampling needed for Veno. */ |
72 | static void tcp_veno_pkts_acked(struct sock *sk, u32 cnt, ktime_t last) | 72 | static void tcp_veno_pkts_acked(struct sock *sk, u32 cnt, s32 rtt_us) |
73 | { | 73 | { |
74 | struct veno *veno = inet_csk_ca(sk); | 74 | struct veno *veno = inet_csk_ca(sk); |
75 | u32 vrtt; | 75 | u32 vrtt; |
76 | 76 | ||
77 | if (ktime_equal(last, net_invalid_timestamp())) | 77 | if (rtt_us < 0) |
78 | return; | 78 | return; |
79 | 79 | ||
80 | /* Never allow zero rtt or baseRTT */ | 80 | /* Never allow zero rtt or baseRTT */ |
81 | vrtt = ktime_to_us(net_timedelta(last)) + 1; | 81 | vrtt = rtt_us + 1; |
82 | 82 | ||
83 | /* Filter to find propagation delay: */ | 83 | /* Filter to find propagation delay: */ |
84 | if (vrtt < veno->basertt) | 84 | if (vrtt < veno->basertt) |