diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-04-24 01:26:16 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:29:45 -0400 |
commit | 164891aadf1721fca4dce473bb0e0998181537c6 (patch) | |
tree | 991393ec7306da475cb306fcc7cb084f737ebadc /net/ipv4/tcp_vegas.c | |
parent | 65d1b4a7e73fe0e1f5275ad7d2d3547981480886 (diff) |
[TCP]: Congestion control API update.
Do some simple changes to make congestion control API faster/cleaner.
* use ktime_t rather than timeval
* merge rtt sampling into existing ack callback
this means one indirect call versus two per ack.
* use flags bits to store options/settings
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_vegas.c')
-rw-r--r-- | net/ipv4/tcp_vegas.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c index 87e72bef6d08..f4104eeb5f26 100644 --- a/net/ipv4/tcp_vegas.c +++ b/net/ipv4/tcp_vegas.c | |||
@@ -120,10 +120,13 @@ static void tcp_vegas_init(struct sock *sk) | |||
120 | * o min-filter RTT samples from a much longer window (forever for now) | 120 | * o min-filter RTT samples from a much longer window (forever for now) |
121 | * to find the propagation delay (baseRTT) | 121 | * to find the propagation delay (baseRTT) |
122 | */ | 122 | */ |
123 | static void tcp_vegas_rtt_calc(struct sock *sk, u32 usrtt) | 123 | static void tcp_vegas_pkts_acked(struct sock *sk, u32 cnt, ktime_t last) |
124 | { | 124 | { |
125 | struct vegas *vegas = inet_csk_ca(sk); | 125 | struct vegas *vegas = inet_csk_ca(sk); |
126 | u32 vrtt = usrtt + 1; /* Never allow zero rtt or baseRTT */ | 126 | u32 vrtt; |
127 | |||
128 | /* Never allow zero rtt or baseRTT */ | ||
129 | vrtt = (ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC) + 1; | ||
127 | 130 | ||
128 | /* Filter to find propagation delay: */ | 131 | /* Filter to find propagation delay: */ |
129 | if (vrtt < vegas->baseRTT) | 132 | if (vrtt < vegas->baseRTT) |
@@ -353,11 +356,12 @@ static void tcp_vegas_get_info(struct sock *sk, u32 ext, | |||
353 | } | 356 | } |
354 | 357 | ||
355 | static struct tcp_congestion_ops tcp_vegas = { | 358 | static struct tcp_congestion_ops tcp_vegas = { |
359 | .flags = TCP_CONG_RTT_STAMP, | ||
356 | .init = tcp_vegas_init, | 360 | .init = tcp_vegas_init, |
357 | .ssthresh = tcp_reno_ssthresh, | 361 | .ssthresh = tcp_reno_ssthresh, |
358 | .cong_avoid = tcp_vegas_cong_avoid, | 362 | .cong_avoid = tcp_vegas_cong_avoid, |
359 | .min_cwnd = tcp_reno_min_cwnd, | 363 | .min_cwnd = tcp_reno_min_cwnd, |
360 | .rtt_sample = tcp_vegas_rtt_calc, | 364 | .pkts_acked = tcp_vegas_pkts_acked, |
361 | .set_state = tcp_vegas_state, | 365 | .set_state = tcp_vegas_state, |
362 | .cwnd_event = tcp_vegas_cwnd_event, | 366 | .cwnd_event = tcp_vegas_cwnd_event, |
363 | .get_info = tcp_vegas_get_info, | 367 | .get_info = tcp_vegas_get_info, |