aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-05-16 17:00:04 -0400
committerDavid S. Miller <davem@davemloft.net>2017-05-17 16:06:01 -0400
commitc2203cf75ed7dfab8dfc7ac915a726880ee7512f (patch)
tree502b28a4374307fe23a75adc34e167fdf7e3cba3 /net/ipv4/tcp_input.c
parentd635fbe27ebee0f4b845abe5e9620c9400785a5c (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_input.c')
-rw-r--r--net/ipv4/tcp_input.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index c0b3f909df39..6a15c9b80b09 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -463,7 +463,7 @@ void tcp_init_buffer_space(struct sock *sk)
463 tp->window_clamp = max(2 * tp->advmss, maxwin - tp->advmss); 463 tp->window_clamp = max(2 * tp->advmss, maxwin - tp->advmss);
464 464
465 tp->rcv_ssthresh = min(tp->rcv_ssthresh, tp->window_clamp); 465 tp->rcv_ssthresh = min(tp->rcv_ssthresh, tp->window_clamp);
466 tp->snd_cwnd_stamp = tcp_time_stamp; 466 tp->snd_cwnd_stamp = tcp_jiffies32;
467} 467}
468 468
469/* 5. Recalculate window clamp after socket hit its memory bounds. */ 469/* 5. Recalculate window clamp after socket hit its memory bounds. */
@@ -1954,7 +1954,7 @@ void tcp_enter_loss(struct sock *sk)
1954 } 1954 }
1955 tp->snd_cwnd = 1; 1955 tp->snd_cwnd = 1;
1956 tp->snd_cwnd_cnt = 0; 1956 tp->snd_cwnd_cnt = 0;
1957 tp->snd_cwnd_stamp = tcp_time_stamp; 1957 tp->snd_cwnd_stamp = tcp_jiffies32;
1958 1958
1959 tp->retrans_out = 0; 1959 tp->retrans_out = 0;
1960 tp->lost_out = 0; 1960 tp->lost_out = 0;
@@ -2383,7 +2383,7 @@ static void tcp_undo_cwnd_reduction(struct sock *sk, bool unmark_loss)
2383 tcp_ecn_withdraw_cwr(tp); 2383 tcp_ecn_withdraw_cwr(tp);
2384 } 2384 }
2385 } 2385 }
2386 tp->snd_cwnd_stamp = tcp_time_stamp; 2386 tp->snd_cwnd_stamp = tcp_jiffies32;
2387 tp->undo_marker = 0; 2387 tp->undo_marker = 0;
2388} 2388}
2389 2389
@@ -2520,7 +2520,7 @@ static inline void tcp_end_cwnd_reduction(struct sock *sk)
2520 if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR || 2520 if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR ||
2521 (tp->undo_marker && tp->snd_ssthresh < TCP_INFINITE_SSTHRESH)) { 2521 (tp->undo_marker && tp->snd_ssthresh < TCP_INFINITE_SSTHRESH)) {
2522 tp->snd_cwnd = tp->snd_ssthresh; 2522 tp->snd_cwnd = tp->snd_ssthresh;
2523 tp->snd_cwnd_stamp = tcp_time_stamp; 2523 tp->snd_cwnd_stamp = tcp_jiffies32;
2524 } 2524 }
2525 tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR); 2525 tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR);
2526} 2526}
@@ -2590,7 +2590,7 @@ static void tcp_mtup_probe_success(struct sock *sk)
2590 tcp_mss_to_mtu(sk, tp->mss_cache) / 2590 tcp_mss_to_mtu(sk, tp->mss_cache) /
2591 icsk->icsk_mtup.probe_size; 2591 icsk->icsk_mtup.probe_size;
2592 tp->snd_cwnd_cnt = 0; 2592 tp->snd_cwnd_cnt = 0;
2593 tp->snd_cwnd_stamp = tcp_time_stamp; 2593 tp->snd_cwnd_stamp = tcp_jiffies32;
2594 tp->snd_ssthresh = tcp_current_ssthresh(sk); 2594 tp->snd_ssthresh = tcp_current_ssthresh(sk);
2595 2595
2596 icsk->icsk_mtup.search_low = icsk->icsk_mtup.probe_size; 2596 icsk->icsk_mtup.search_low = icsk->icsk_mtup.probe_size;
@@ -2976,7 +2976,7 @@ static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
2976 const struct inet_connection_sock *icsk = inet_csk(sk); 2976 const struct inet_connection_sock *icsk = inet_csk(sk);
2977 2977
2978 icsk->icsk_ca_ops->cong_avoid(sk, ack, acked); 2978 icsk->icsk_ca_ops->cong_avoid(sk, ack, acked);
2979 tcp_sk(sk)->snd_cwnd_stamp = tcp_time_stamp; 2979 tcp_sk(sk)->snd_cwnd_stamp = tcp_jiffies32;
2980} 2980}
2981 2981
2982/* Restart timer after forward progress on connection. 2982/* Restart timer after forward progress on connection.
@@ -5019,7 +5019,7 @@ static void tcp_new_space(struct sock *sk)
5019 5019
5020 if (tcp_should_expand_sndbuf(sk)) { 5020 if (tcp_should_expand_sndbuf(sk)) {
5021 tcp_sndbuf_expand(sk); 5021 tcp_sndbuf_expand(sk);
5022 tp->snd_cwnd_stamp = tcp_time_stamp; 5022 tp->snd_cwnd_stamp = tcp_jiffies32;
5023 } 5023 }
5024 5024
5025 sk->sk_write_space(sk); 5025 sk->sk_write_space(sk);