tcp: use tcp_jiffies32 to feed tp->snd_cwnd_stamp
Use tcp_jiffies32 instead of tcp_time_stamp to feed tp->snd_cwnd_stamp. tcp_time_stamp will soon be a litle bit more expensive than simply reading 'jiffies'. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
d635fbe27e
commit
c2203cf75e
@@ -151,7 +151,7 @@ void tcp_cwnd_restart(struct sock *sk, s32 delta)
|
||||
while ((delta -= inet_csk(sk)->icsk_rto) > 0 && cwnd > restart_cwnd)
|
||||
cwnd >>= 1;
|
||||
tp->snd_cwnd = max(cwnd, restart_cwnd);
|
||||
tp->snd_cwnd_stamp = tcp_time_stamp;
|
||||
tp->snd_cwnd_stamp = tcp_jiffies32;
|
||||
tp->snd_cwnd_used = 0;
|
||||
}
|
||||
|
||||
@@ -1576,7 +1576,7 @@ static void tcp_cwnd_application_limited(struct sock *sk)
|
||||
}
|
||||
tp->snd_cwnd_used = 0;
|
||||
}
|
||||
tp->snd_cwnd_stamp = tcp_time_stamp;
|
||||
tp->snd_cwnd_stamp = tcp_jiffies32;
|
||||
}
|
||||
|
||||
static void tcp_cwnd_validate(struct sock *sk, bool is_cwnd_limited)
|
||||
@@ -1597,14 +1597,14 @@ static void tcp_cwnd_validate(struct sock *sk, bool is_cwnd_limited)
|
||||
if (tcp_is_cwnd_limited(sk)) {
|
||||
/* Network is feed fully. */
|
||||
tp->snd_cwnd_used = 0;
|
||||
tp->snd_cwnd_stamp = tcp_time_stamp;
|
||||
tp->snd_cwnd_stamp = tcp_jiffies32;
|
||||
} else {
|
||||
/* Network starves. */
|
||||
if (tp->packets_out > tp->snd_cwnd_used)
|
||||
tp->snd_cwnd_used = tp->packets_out;
|
||||
|
||||
if (sysctl_tcp_slow_start_after_idle &&
|
||||
(s32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= inet_csk(sk)->icsk_rto &&
|
||||
(s32)(tcp_jiffies32 - tp->snd_cwnd_stamp) >= inet_csk(sk)->icsk_rto &&
|
||||
!ca_ops->cong_control)
|
||||
tcp_cwnd_application_limited(sk);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user