diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index ad70a962c20e..a759e19496d2 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -81,8 +81,6 @@ int sysctl_tcp_sack __read_mostly = 1; | |||
81 | int sysctl_tcp_fack __read_mostly = 1; | 81 | int sysctl_tcp_fack __read_mostly = 1; |
82 | int sysctl_tcp_reordering __read_mostly = TCP_FASTRETRANS_THRESH; | 82 | int sysctl_tcp_reordering __read_mostly = TCP_FASTRETRANS_THRESH; |
83 | EXPORT_SYMBOL(sysctl_tcp_reordering); | 83 | EXPORT_SYMBOL(sysctl_tcp_reordering); |
84 | int sysctl_tcp_ecn __read_mostly = 2; | ||
85 | EXPORT_SYMBOL(sysctl_tcp_ecn); | ||
86 | int sysctl_tcp_dsack __read_mostly = 1; | 84 | int sysctl_tcp_dsack __read_mostly = 1; |
87 | int sysctl_tcp_app_win __read_mostly = 31; | 85 | int sysctl_tcp_app_win __read_mostly = 31; |
88 | int sysctl_tcp_adv_win_scale __read_mostly = 1; | 86 | int sysctl_tcp_adv_win_scale __read_mostly = 1; |
@@ -100,7 +98,6 @@ int sysctl_tcp_frto_response __read_mostly; | |||
100 | int sysctl_tcp_thin_dupack __read_mostly; | 98 | int sysctl_tcp_thin_dupack __read_mostly; |
101 | 99 | ||
102 | int sysctl_tcp_moderate_rcvbuf __read_mostly = 1; | 100 | int sysctl_tcp_moderate_rcvbuf __read_mostly = 1; |
103 | int sysctl_tcp_abc __read_mostly; | ||
104 | int sysctl_tcp_early_retrans __read_mostly = 2; | 101 | int sysctl_tcp_early_retrans __read_mostly = 2; |
105 | 102 | ||
106 | #define FLAG_DATA 0x01 /* Incoming frame contained data. */ | 103 | #define FLAG_DATA 0x01 /* Incoming frame contained data. */ |
@@ -2009,7 +2006,6 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag) | |||
2009 | tp->snd_cwnd_cnt = 0; | 2006 | tp->snd_cwnd_cnt = 0; |
2010 | tp->snd_cwnd_stamp = tcp_time_stamp; | 2007 | tp->snd_cwnd_stamp = tcp_time_stamp; |
2011 | tp->frto_counter = 0; | 2008 | tp->frto_counter = 0; |
2012 | tp->bytes_acked = 0; | ||
2013 | 2009 | ||
2014 | tp->reordering = min_t(unsigned int, tp->reordering, | 2010 | tp->reordering = min_t(unsigned int, tp->reordering, |
2015 | sysctl_tcp_reordering); | 2011 | sysctl_tcp_reordering); |
@@ -2058,7 +2054,6 @@ void tcp_enter_loss(struct sock *sk, int how) | |||
2058 | tp->snd_cwnd_cnt = 0; | 2054 | tp->snd_cwnd_cnt = 0; |
2059 | tp->snd_cwnd_stamp = tcp_time_stamp; | 2055 | tp->snd_cwnd_stamp = tcp_time_stamp; |
2060 | 2056 | ||
2061 | tp->bytes_acked = 0; | ||
2062 | tcp_clear_retrans_partial(tp); | 2057 | tcp_clear_retrans_partial(tp); |
2063 | 2058 | ||
2064 | if (tcp_is_reno(tp)) | 2059 | if (tcp_is_reno(tp)) |
@@ -2686,7 +2681,6 @@ static void tcp_init_cwnd_reduction(struct sock *sk, const bool set_ssthresh) | |||
2686 | struct tcp_sock *tp = tcp_sk(sk); | 2681 | struct tcp_sock *tp = tcp_sk(sk); |
2687 | 2682 | ||
2688 | tp->high_seq = tp->snd_nxt; | 2683 | tp->high_seq = tp->snd_nxt; |
2689 | tp->bytes_acked = 0; | ||
2690 | tp->snd_cwnd_cnt = 0; | 2684 | tp->snd_cwnd_cnt = 0; |
2691 | tp->prior_cwnd = tp->snd_cwnd; | 2685 | tp->prior_cwnd = tp->snd_cwnd; |
2692 | tp->prr_delivered = 0; | 2686 | tp->prr_delivered = 0; |
@@ -2737,7 +2731,6 @@ void tcp_enter_cwr(struct sock *sk, const int set_ssthresh) | |||
2737 | struct tcp_sock *tp = tcp_sk(sk); | 2731 | struct tcp_sock *tp = tcp_sk(sk); |
2738 | 2732 | ||
2739 | tp->prior_ssthresh = 0; | 2733 | tp->prior_ssthresh = 0; |
2740 | tp->bytes_acked = 0; | ||
2741 | if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) { | 2734 | if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) { |
2742 | tp->undo_marker = 0; | 2735 | tp->undo_marker = 0; |
2743 | tcp_init_cwnd_reduction(sk, set_ssthresh); | 2736 | tcp_init_cwnd_reduction(sk, set_ssthresh); |
@@ -3419,7 +3412,6 @@ static void tcp_conservative_spur_to_response(struct tcp_sock *tp) | |||
3419 | { | 3412 | { |
3420 | tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh); | 3413 | tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh); |
3421 | tp->snd_cwnd_cnt = 0; | 3414 | tp->snd_cwnd_cnt = 0; |
3422 | tp->bytes_acked = 0; | ||
3423 | TCP_ECN_queue_cwr(tp); | 3415 | TCP_ECN_queue_cwr(tp); |
3424 | tcp_moderate_cwnd(tp); | 3416 | tcp_moderate_cwnd(tp); |
3425 | } | 3417 | } |
@@ -3615,15 +3607,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) | |||
3615 | if (after(ack, prior_snd_una)) | 3607 | if (after(ack, prior_snd_una)) |
3616 | flag |= FLAG_SND_UNA_ADVANCED; | 3608 | flag |= FLAG_SND_UNA_ADVANCED; |
3617 | 3609 | ||
3618 | if (sysctl_tcp_abc) { | ||
3619 | if (icsk->icsk_ca_state < TCP_CA_CWR) | ||
3620 | tp->bytes_acked += ack - prior_snd_una; | ||
3621 | else if (icsk->icsk_ca_state == TCP_CA_Loss) | ||
3622 | /* we assume just one segment left network */ | ||
3623 | tp->bytes_acked += min(ack - prior_snd_una, | ||
3624 | tp->mss_cache); | ||
3625 | } | ||
3626 | |||
3627 | prior_fackets = tp->fackets_out; | 3610 | prior_fackets = tp->fackets_out; |
3628 | prior_in_flight = tcp_packets_in_flight(tp); | 3611 | prior_in_flight = tcp_packets_in_flight(tp); |
3629 | 3612 | ||
@@ -3877,7 +3860,7 @@ static bool tcp_parse_aligned_timestamp(struct tcp_sock *tp, const struct tcphdr | |||
3877 | ++ptr; | 3860 | ++ptr; |
3878 | tp->rx_opt.rcv_tsval = ntohl(*ptr); | 3861 | tp->rx_opt.rcv_tsval = ntohl(*ptr); |
3879 | ++ptr; | 3862 | ++ptr; |
3880 | tp->rx_opt.rcv_tsecr = ntohl(*ptr); | 3863 | tp->rx_opt.rcv_tsecr = ntohl(*ptr) - tp->tsoffset; |
3881 | return true; | 3864 | return true; |
3882 | } | 3865 | } |
3883 | return false; | 3866 | return false; |
@@ -3901,7 +3884,11 @@ static bool tcp_fast_parse_options(const struct sk_buff *skb, | |||
3901 | if (tcp_parse_aligned_timestamp(tp, th)) | 3884 | if (tcp_parse_aligned_timestamp(tp, th)) |
3902 | return true; | 3885 | return true; |
3903 | } | 3886 | } |
3887 | |||
3904 | tcp_parse_options(skb, &tp->rx_opt, hvpp, 1, NULL); | 3888 | tcp_parse_options(skb, &tp->rx_opt, hvpp, 1, NULL); |
3889 | if (tp->rx_opt.saw_tstamp) | ||
3890 | tp->rx_opt.rcv_tsecr -= tp->tsoffset; | ||
3891 | |||
3905 | return true; | 3892 | return true; |
3906 | } | 3893 | } |
3907 | 3894 | ||
@@ -5682,6 +5669,8 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, | |||
5682 | int saved_clamp = tp->rx_opt.mss_clamp; | 5669 | int saved_clamp = tp->rx_opt.mss_clamp; |
5683 | 5670 | ||
5684 | tcp_parse_options(skb, &tp->rx_opt, &hash_location, 0, &foc); | 5671 | tcp_parse_options(skb, &tp->rx_opt, &hash_location, 0, &foc); |
5672 | if (tp->rx_opt.saw_tstamp) | ||
5673 | tp->rx_opt.rcv_tsecr -= tp->tsoffset; | ||
5685 | 5674 | ||
5686 | if (th->ack) { | 5675 | if (th->ack) { |
5687 | /* rfc793: | 5676 | /* rfc793: |