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_lp.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_lp.c')
-rw-r--r-- | net/ipv4/tcp_lp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c index f0ebaf0e21cb..b4e062ab24a1 100644 --- a/net/ipv4/tcp_lp.c +++ b/net/ipv4/tcp_lp.c | |||
@@ -218,7 +218,7 @@ static u32 tcp_lp_owd_calculator(struct sock *sk) | |||
218 | * 3. calc smoothed OWD (SOWD). | 218 | * 3. calc smoothed OWD (SOWD). |
219 | * Most ideas come from the original TCP-LP implementation. | 219 | * Most ideas come from the original TCP-LP implementation. |
220 | */ | 220 | */ |
221 | static void tcp_lp_rtt_sample(struct sock *sk, u32 usrtt) | 221 | static void tcp_lp_rtt_sample(struct sock *sk, u32 rtt) |
222 | { | 222 | { |
223 | struct lp *lp = inet_csk_ca(sk); | 223 | struct lp *lp = inet_csk_ca(sk); |
224 | s64 mowd = tcp_lp_owd_calculator(sk); | 224 | s64 mowd = tcp_lp_owd_calculator(sk); |
@@ -261,11 +261,13 @@ static void tcp_lp_rtt_sample(struct sock *sk, u32 usrtt) | |||
261 | * newReno in increase case. | 261 | * newReno in increase case. |
262 | * We work it out by following the idea from TCP-LP's paper directly | 262 | * We work it out by following the idea from TCP-LP's paper directly |
263 | */ | 263 | */ |
264 | static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked) | 264 | static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked, ktime_t last) |
265 | { | 265 | { |
266 | struct tcp_sock *tp = tcp_sk(sk); | 266 | struct tcp_sock *tp = tcp_sk(sk); |
267 | struct lp *lp = inet_csk_ca(sk); | 267 | struct lp *lp = inet_csk_ca(sk); |
268 | 268 | ||
269 | tcp_lp_rtt_sample(sk, ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC); | ||
270 | |||
269 | /* calc inference */ | 271 | /* calc inference */ |
270 | if (tcp_time_stamp > tp->rx_opt.rcv_tsecr) | 272 | if (tcp_time_stamp > tp->rx_opt.rcv_tsecr) |
271 | lp->inference = 3 * (tcp_time_stamp - tp->rx_opt.rcv_tsecr); | 273 | lp->inference = 3 * (tcp_time_stamp - tp->rx_opt.rcv_tsecr); |
@@ -312,11 +314,11 @@ static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked) | |||
312 | } | 314 | } |
313 | 315 | ||
314 | static struct tcp_congestion_ops tcp_lp = { | 316 | static struct tcp_congestion_ops tcp_lp = { |
317 | .flags = TCP_CONG_RTT_STAMP, | ||
315 | .init = tcp_lp_init, | 318 | .init = tcp_lp_init, |
316 | .ssthresh = tcp_reno_ssthresh, | 319 | .ssthresh = tcp_reno_ssthresh, |
317 | .cong_avoid = tcp_lp_cong_avoid, | 320 | .cong_avoid = tcp_lp_cong_avoid, |
318 | .min_cwnd = tcp_reno_min_cwnd, | 321 | .min_cwnd = tcp_reno_min_cwnd, |
319 | .rtt_sample = tcp_lp_rtt_sample, | ||
320 | .pkts_acked = tcp_lp_pkts_acked, | 322 | .pkts_acked = tcp_lp_pkts_acked, |
321 | 323 | ||
322 | .owner = THIS_MODULE, | 324 | .owner = THIS_MODULE, |