diff options
author | Eric Dumazet <edumazet@google.com> | 2017-05-16 17:00:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-17 16:06:01 -0400 |
commit | c2203cf75ed7dfab8dfc7ac915a726880ee7512f (patch) | |
tree | 502b28a4374307fe23a75adc34e167fdf7e3cba3 /net/ipv4/tcp_output.c | |
parent | d635fbe27ebee0f4b845abe5e9620c9400785a5c (diff) |
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>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index be9f8f483e21..4bd50f0b236b 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -151,7 +151,7 @@ void tcp_cwnd_restart(struct sock *sk, s32 delta) | |||
151 | while ((delta -= inet_csk(sk)->icsk_rto) > 0 && cwnd > restart_cwnd) | 151 | while ((delta -= inet_csk(sk)->icsk_rto) > 0 && cwnd > restart_cwnd) |
152 | cwnd >>= 1; | 152 | cwnd >>= 1; |
153 | tp->snd_cwnd = max(cwnd, restart_cwnd); | 153 | tp->snd_cwnd = max(cwnd, restart_cwnd); |
154 | tp->snd_cwnd_stamp = tcp_time_stamp; | 154 | tp->snd_cwnd_stamp = tcp_jiffies32; |
155 | tp->snd_cwnd_used = 0; | 155 | tp->snd_cwnd_used = 0; |
156 | } | 156 | } |
157 | 157 | ||
@@ -1576,7 +1576,7 @@ static void tcp_cwnd_application_limited(struct sock *sk) | |||
1576 | } | 1576 | } |
1577 | tp->snd_cwnd_used = 0; | 1577 | tp->snd_cwnd_used = 0; |
1578 | } | 1578 | } |
1579 | tp->snd_cwnd_stamp = tcp_time_stamp; | 1579 | tp->snd_cwnd_stamp = tcp_jiffies32; |
1580 | } | 1580 | } |
1581 | 1581 | ||
1582 | static void tcp_cwnd_validate(struct sock *sk, bool is_cwnd_limited) | 1582 | 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) | |||
1597 | if (tcp_is_cwnd_limited(sk)) { | 1597 | if (tcp_is_cwnd_limited(sk)) { |
1598 | /* Network is feed fully. */ | 1598 | /* Network is feed fully. */ |
1599 | tp->snd_cwnd_used = 0; | 1599 | tp->snd_cwnd_used = 0; |
1600 | tp->snd_cwnd_stamp = tcp_time_stamp; | 1600 | tp->snd_cwnd_stamp = tcp_jiffies32; |
1601 | } else { | 1601 | } else { |
1602 | /* Network starves. */ | 1602 | /* Network starves. */ |
1603 | if (tp->packets_out > tp->snd_cwnd_used) | 1603 | if (tp->packets_out > tp->snd_cwnd_used) |
1604 | tp->snd_cwnd_used = tp->packets_out; | 1604 | tp->snd_cwnd_used = tp->packets_out; |
1605 | 1605 | ||
1606 | if (sysctl_tcp_slow_start_after_idle && | 1606 | if (sysctl_tcp_slow_start_after_idle && |
1607 | (s32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= inet_csk(sk)->icsk_rto && | 1607 | (s32)(tcp_jiffies32 - tp->snd_cwnd_stamp) >= inet_csk(sk)->icsk_rto && |
1608 | !ca_ops->cong_control) | 1608 | !ca_ops->cong_control) |
1609 | tcp_cwnd_application_limited(sk); | 1609 | tcp_cwnd_application_limited(sk); |
1610 | 1610 | ||