aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_westwood.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-07-26 02:49:34 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-31 05:27:57 -0400
commit30cfd0baf0a0c4329fff1ef4b622919297969ec8 (patch)
tree945a72f636ced1b443d894495704237e4cb7816d /net/ipv4/tcp_westwood.c
parent6a302358d87fedaf7bda12b8e909265ebf1ce674 (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_westwood.c')
-rw-r--r--net/ipv4/tcp_westwood.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/tcp_westwood.c b/net/ipv4/tcp_westwood.c
index e61e09dd513..20151d6a624 100644
--- a/net/ipv4/tcp_westwood.c
+++ b/net/ipv4/tcp_westwood.c
@@ -100,11 +100,12 @@ static void westwood_filter(struct westwood *w, u32 delta)
100 * Called after processing group of packets. 100 * Called after processing group of packets.
101 * but all westwood needs is the last sample of srtt. 101 * but all westwood needs is the last sample of srtt.
102 */ 102 */
103static void tcp_westwood_pkts_acked(struct sock *sk, u32 cnt, ktime_t last) 103static void tcp_westwood_pkts_acked(struct sock *sk, u32 cnt, s32 rtt)
104{ 104{
105 struct westwood *w = inet_csk_ca(sk); 105 struct westwood *w = inet_csk_ca(sk);
106 if (cnt > 0) 106
107 w->rtt = tcp_sk(sk)->srtt >> 3; 107 if (rtt > 0)
108 w->rtt = usecs_to_jiffies(rtt);
108} 109}
109 110
110/* 111/*