diff options
author | Yousuk Seung <ysseung@google.com> | 2018-03-16 13:51:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-16 15:07:48 -0400 |
commit | 53794570049d314742f156c99022914840a3d5ab (patch) | |
tree | 9156f86891850f0c12fa1cfcdf718c08fe424914 | |
parent | 7156d194a0772f733865267e7207e0b08f81b02b (diff) |
net-tcp_bbr: set tp->snd_ssthresh to BDP upon STARTUP exit
Set tp->snd_ssthresh to BDP upon STARTUP exit. This allows us
to check if a BBR flow exited STARTUP and the BDP at the
time of STARTUP exit with SCM_TIMESTAMPING_OPT_STATS. Since BBR does not
use snd_ssthresh this fix has no impact on BBR's behavior.
Signed-off-by: Yousuk Seung <ysseung@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Priyaranjan Jha <priyarjha@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/tcp_bbr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c index c92014cb1e16..158d105e76da 100644 --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c | |||
@@ -731,6 +731,8 @@ static void bbr_check_drain(struct sock *sk, const struct rate_sample *rs) | |||
731 | bbr->mode = BBR_DRAIN; /* drain queue we created */ | 731 | bbr->mode = BBR_DRAIN; /* drain queue we created */ |
732 | bbr->pacing_gain = bbr_drain_gain; /* pace slow to drain */ | 732 | bbr->pacing_gain = bbr_drain_gain; /* pace slow to drain */ |
733 | bbr->cwnd_gain = bbr_high_gain; /* maintain cwnd */ | 733 | bbr->cwnd_gain = bbr_high_gain; /* maintain cwnd */ |
734 | tcp_sk(sk)->snd_ssthresh = | ||
735 | bbr_target_cwnd(sk, bbr_max_bw(sk), BBR_UNIT); | ||
734 | } /* fall through to check if in-flight is already small: */ | 736 | } /* fall through to check if in-flight is already small: */ |
735 | if (bbr->mode == BBR_DRAIN && | 737 | if (bbr->mode == BBR_DRAIN && |
736 | tcp_packets_in_flight(tcp_sk(sk)) <= | 738 | tcp_packets_in_flight(tcp_sk(sk)) <= |
@@ -834,6 +836,7 @@ static void bbr_init(struct sock *sk) | |||
834 | struct bbr *bbr = inet_csk_ca(sk); | 836 | struct bbr *bbr = inet_csk_ca(sk); |
835 | 837 | ||
836 | bbr->prior_cwnd = 0; | 838 | bbr->prior_cwnd = 0; |
839 | tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; | ||
837 | bbr->rtt_cnt = 0; | 840 | bbr->rtt_cnt = 0; |
838 | bbr->next_rtt_delivered = 0; | 841 | bbr->next_rtt_delivered = 0; |
839 | bbr->prev_ca_state = TCP_CA_Open; | 842 | bbr->prev_ca_state = TCP_CA_Open; |
@@ -886,7 +889,7 @@ static u32 bbr_undo_cwnd(struct sock *sk) | |||
886 | static u32 bbr_ssthresh(struct sock *sk) | 889 | static u32 bbr_ssthresh(struct sock *sk) |
887 | { | 890 | { |
888 | bbr_save_cwnd(sk); | 891 | bbr_save_cwnd(sk); |
889 | return TCP_INFINITE_SSTHRESH; /* BBR does not use ssthresh */ | 892 | return tcp_sk(sk)->snd_ssthresh; |
890 | } | 893 | } |
891 | 894 | ||
892 | static size_t bbr_get_info(struct sock *sk, u32 ext, int *attr, | 895 | static size_t bbr_get_info(struct sock *sk, u32 ext, int *attr, |