aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_illinois.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-04-24 01:26:16 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:29:45 -0400
commit164891aadf1721fca4dce473bb0e0998181537c6 (patch)
tree991393ec7306da475cb306fcc7cb084f737ebadc /net/ipv4/tcp_illinois.c
parent65d1b4a7e73fe0e1f5275ad7d2d3547981480886 (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_illinois.c')
-rw-r--r--net/ipv4/tcp_illinois.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/net/ipv4/tcp_illinois.c b/net/ipv4/tcp_illinois.c
index ae6298600886..8e3165917f72 100644
--- a/net/ipv4/tcp_illinois.c
+++ b/net/ipv4/tcp_illinois.c
@@ -83,9 +83,14 @@ static void tcp_illinois_init(struct sock *sk)
83} 83}
84 84
85/* Measure RTT for each ack. */ 85/* Measure RTT for each ack. */
86static void tcp_illinois_rtt_sample(struct sock *sk, u32 rtt) 86static void tcp_illinois_acked(struct sock *sk, u32 pkts_acked, ktime_t last)
87{ 87{
88 struct illinois *ca = inet_csk_ca(sk); 88 struct illinois *ca = inet_csk_ca(sk);
89 u32 rtt;
90
91 ca->acked = pkts_acked;
92
93 rtt = ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC;
89 94
90 /* ignore bogus values, this prevents wraparound in alpha math */ 95 /* ignore bogus values, this prevents wraparound in alpha math */
91 if (rtt > RTT_MAX) 96 if (rtt > RTT_MAX)
@@ -103,13 +108,6 @@ static void tcp_illinois_rtt_sample(struct sock *sk, u32 rtt)
103 ca->sum_rtt += rtt; 108 ca->sum_rtt += rtt;
104} 109}
105 110
106/* Capture count of packets covered by ack, to adjust for delayed acks */
107static void tcp_illinois_acked(struct sock *sk, u32 pkts_acked)
108{
109 struct illinois *ca = inet_csk_ca(sk);
110 ca->acked = pkts_acked;
111}
112
113/* Maximum queuing delay */ 111/* Maximum queuing delay */
114static inline u32 max_delay(const struct illinois *ca) 112static inline u32 max_delay(const struct illinois *ca)
115{ 113{
@@ -325,12 +323,12 @@ static void tcp_illinois_info(struct sock *sk, u32 ext,
325} 323}
326 324
327static struct tcp_congestion_ops tcp_illinois = { 325static struct tcp_congestion_ops tcp_illinois = {
326 .flags = TCP_CONG_RTT_STAMP,
328 .init = tcp_illinois_init, 327 .init = tcp_illinois_init,
329 .ssthresh = tcp_illinois_ssthresh, 328 .ssthresh = tcp_illinois_ssthresh,
330 .min_cwnd = tcp_reno_min_cwnd, 329 .min_cwnd = tcp_reno_min_cwnd,
331 .cong_avoid = tcp_illinois_cong_avoid, 330 .cong_avoid = tcp_illinois_cong_avoid,
332 .set_state = tcp_illinois_state, 331 .set_state = tcp_illinois_state,
333 .rtt_sample = tcp_illinois_rtt_sample,
334 .get_info = tcp_illinois_info, 332 .get_info = tcp_illinois_info,
335 .pkts_acked = tcp_illinois_acked, 333 .pkts_acked = tcp_illinois_acked,
336 334