aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_veno.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_veno.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_veno.c')
-rw-r--r--net/ipv4/tcp_veno.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c
index ce57bf302f6..0b50d0607a0 100644
--- a/net/ipv4/tcp_veno.c
+++ b/net/ipv4/tcp_veno.c
@@ -69,10 +69,13 @@ 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. */
72static void tcp_veno_rtt_calc(struct sock *sk, u32 usrtt) 72static void tcp_veno_pkts_acked(struct sock *sk, u32 cnt, ktime_t last)
73{ 73{
74 struct veno *veno = inet_csk_ca(sk); 74 struct veno *veno = inet_csk_ca(sk);
75 u32 vrtt = usrtt + 1; /* Never allow zero rtt or basertt */ 75 u32 vrtt;
76
77 /* Never allow zero rtt or baseRTT */
78 vrtt = (ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC) + 1;
76 79
77 /* Filter to find propagation delay: */ 80 /* Filter to find propagation delay: */
78 if (vrtt < veno->basertt) 81 if (vrtt < veno->basertt)
@@ -199,10 +202,11 @@ static u32 tcp_veno_ssthresh(struct sock *sk)
199} 202}
200 203
201static struct tcp_congestion_ops tcp_veno = { 204static struct tcp_congestion_ops tcp_veno = {
205 .flags = TCP_CONG_RTT_STAMP,
202 .init = tcp_veno_init, 206 .init = tcp_veno_init,
203 .ssthresh = tcp_veno_ssthresh, 207 .ssthresh = tcp_veno_ssthresh,
204 .cong_avoid = tcp_veno_cong_avoid, 208 .cong_avoid = tcp_veno_cong_avoid,
205 .rtt_sample = tcp_veno_rtt_calc, 209 .pkts_acked = tcp_veno_pkts_acked,
206 .set_state = tcp_veno_state, 210 .set_state = tcp_veno_state,
207 .cwnd_event = tcp_veno_cwnd_event, 211 .cwnd_event = tcp_veno_cwnd_event,
208 212