aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_lp.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_lp.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_lp.c')
-rw-r--r--net/ipv4/tcp_lp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c
index 80e140e3ec2d..e7f5ef92cbd8 100644
--- a/net/ipv4/tcp_lp.c
+++ b/net/ipv4/tcp_lp.c
@@ -260,13 +260,13 @@ static void tcp_lp_rtt_sample(struct sock *sk, u32 rtt)
260 * newReno in increase case. 260 * newReno in increase case.
261 * We work it out by following the idea from TCP-LP's paper directly 261 * We work it out by following the idea from TCP-LP's paper directly
262 */ 262 */
263static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked, ktime_t last) 263static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked, s32 rtt_us)
264{ 264{
265 struct tcp_sock *tp = tcp_sk(sk); 265 struct tcp_sock *tp = tcp_sk(sk);
266 struct lp *lp = inet_csk_ca(sk); 266 struct lp *lp = inet_csk_ca(sk);
267 267
268 if (!ktime_equal(last, net_invalid_timestamp())) 268 if (rtt_us > 0)
269 tcp_lp_rtt_sample(sk, ktime_to_us(net_timedelta(last))); 269 tcp_lp_rtt_sample(sk, rtt_us);
270 270
271 /* calc inference */ 271 /* calc inference */
272 if (tcp_time_stamp > tp->rx_opt.rcv_tsecr) 272 if (tcp_time_stamp > tp->rx_opt.rcv_tsecr)