aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_bic.c2
-rw-r--r--net/ipv4/tcp_cubic.c2
-rw-r--r--net/ipv4/tcp_illinois.c3
-rw-r--r--net/ipv4/tcp_input.c18
-rw-r--r--net/ipv4/tcp_ipv4.c3
-rw-r--r--net/ipv4/tcp_lp.c3
-rw-r--r--net/ipv4/tcp_vegas.c3
-rw-r--r--net/ipv4/tcp_veno.c3
8 files changed, 27 insertions, 10 deletions
diff --git a/net/ipv4/tcp_bic.c b/net/ipv4/tcp_bic.c
index 281c9f913257..dd9ef65ad3ff 100644
--- a/net/ipv4/tcp_bic.c
+++ b/net/ipv4/tcp_bic.c
@@ -29,7 +29,7 @@ static int fast_convergence = 1;
29static int max_increment = 16; 29static int max_increment = 16;
30static int low_window = 14; 30static int low_window = 14;
31static int beta = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ 31static int beta = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */
32static int initial_ssthresh = 100; 32static int initial_ssthresh;
33static int smooth_part = 20; 33static int smooth_part = 20;
34 34
35module_param(fast_convergence, int, 0644); 35module_param(fast_convergence, int, 0644);
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index 14224487b16b..ebfaac2f9f46 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -29,7 +29,7 @@
29static int fast_convergence __read_mostly = 1; 29static int fast_convergence __read_mostly = 1;
30static int max_increment __read_mostly = 16; 30static int max_increment __read_mostly = 16;
31static int beta __read_mostly = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ 31static int beta __read_mostly = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */
32static int initial_ssthresh __read_mostly = 100; 32static int initial_ssthresh __read_mostly;
33static int bic_scale __read_mostly = 41; 33static int bic_scale __read_mostly = 41;
34static int tcp_friendliness __read_mostly = 1; 34static int tcp_friendliness __read_mostly = 1;
35 35
diff --git a/net/ipv4/tcp_illinois.c b/net/ipv4/tcp_illinois.c
index 4adc47c55351..b2b2256d3b84 100644
--- a/net/ipv4/tcp_illinois.c
+++ b/net/ipv4/tcp_illinois.c
@@ -90,6 +90,9 @@ static void tcp_illinois_acked(struct sock *sk, u32 pkts_acked, ktime_t last)
90 90
91 ca->acked = pkts_acked; 91 ca->acked = pkts_acked;
92 92
93 if (ktime_equal(last, net_invalid_timestamp()))
94 return;
95
93 rtt = ktime_to_us(net_timedelta(last)); 96 rtt = ktime_to_us(net_timedelta(last));
94 97
95 /* ignore bogus values, this prevents wraparound in alpha math */ 98 /* ignore bogus values, this prevents wraparound in alpha math */
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 74683d81c3f1..69f9f1ef3ef6 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -953,7 +953,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
953 int prior_fackets; 953 int prior_fackets;
954 u32 lost_retrans = 0; 954 u32 lost_retrans = 0;
955 int flag = 0; 955 int flag = 0;
956 int dup_sack = 0; 956 int found_dup_sack = 0;
957 int cached_fack_count; 957 int cached_fack_count;
958 int i; 958 int i;
959 int first_sack_index; 959 int first_sack_index;
@@ -964,20 +964,20 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
964 964
965 /* Check for D-SACK. */ 965 /* Check for D-SACK. */
966 if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) { 966 if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) {
967 dup_sack = 1; 967 found_dup_sack = 1;
968 tp->rx_opt.sack_ok |= 4; 968 tp->rx_opt.sack_ok |= 4;
969 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); 969 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV);
970 } else if (num_sacks > 1 && 970 } else if (num_sacks > 1 &&
971 !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) && 971 !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) &&
972 !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) { 972 !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) {
973 dup_sack = 1; 973 found_dup_sack = 1;
974 tp->rx_opt.sack_ok |= 4; 974 tp->rx_opt.sack_ok |= 4;
975 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV); 975 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV);
976 } 976 }
977 977
978 /* D-SACK for already forgotten data... 978 /* D-SACK for already forgotten data...
979 * Do dumb counting. */ 979 * Do dumb counting. */
980 if (dup_sack && 980 if (found_dup_sack &&
981 !after(ntohl(sp[0].end_seq), prior_snd_una) && 981 !after(ntohl(sp[0].end_seq), prior_snd_una) &&
982 after(ntohl(sp[0].end_seq), tp->undo_marker)) 982 after(ntohl(sp[0].end_seq), tp->undo_marker))
983 tp->undo_retrans--; 983 tp->undo_retrans--;
@@ -1058,6 +1058,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
1058 __u32 start_seq = ntohl(sp->start_seq); 1058 __u32 start_seq = ntohl(sp->start_seq);
1059 __u32 end_seq = ntohl(sp->end_seq); 1059 __u32 end_seq = ntohl(sp->end_seq);
1060 int fack_count; 1060 int fack_count;
1061 int dup_sack = (found_dup_sack && (i == first_sack_index));
1061 1062
1062 skb = cached_skb; 1063 skb = cached_skb;
1063 fack_count = cached_fack_count; 1064 fack_count = cached_fack_count;
@@ -2037,7 +2038,7 @@ static void tcp_try_to_open(struct sock *sk, int flag)
2037{ 2038{
2038 struct tcp_sock *tp = tcp_sk(sk); 2039 struct tcp_sock *tp = tcp_sk(sk);
2039 2040
2040 tp->left_out = tp->sacked_out; 2041 tcp_sync_left_out(tp);
2041 2042
2042 if (tp->retrans_out == 0) 2043 if (tp->retrans_out == 0)
2043 tp->retrans_stamp = 0; 2044 tp->retrans_stamp = 0;
@@ -2409,7 +2410,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
2409 int acked = 0; 2410 int acked = 0;
2410 int prior_packets = tp->packets_out; 2411 int prior_packets = tp->packets_out;
2411 __s32 seq_rtt = -1; 2412 __s32 seq_rtt = -1;
2412 ktime_t last_ackt = ktime_set(0,0); 2413 ktime_t last_ackt = net_invalid_timestamp();
2413 2414
2414 while ((skb = tcp_write_queue_head(sk)) && 2415 while ((skb = tcp_write_queue_head(sk)) &&
2415 skb != tcp_send_head(sk)) { 2416 skb != tcp_send_head(sk)) {
@@ -2487,6 +2488,10 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
2487 tcp_ack_update_rtt(sk, acked, seq_rtt); 2488 tcp_ack_update_rtt(sk, acked, seq_rtt);
2488 tcp_ack_packets_out(sk); 2489 tcp_ack_packets_out(sk);
2489 2490
2491 /* Is the ACK triggering packet unambiguous? */
2492 if (acked & FLAG_RETRANS_DATA_ACKED)
2493 last_ackt = net_invalid_timestamp();
2494
2490 if (ca_ops->pkts_acked) 2495 if (ca_ops->pkts_acked)
2491 ca_ops->pkts_acked(sk, pkts_acked, last_ackt); 2496 ca_ops->pkts_acked(sk, pkts_acked, last_ackt);
2492 } 2497 }
@@ -2932,6 +2937,7 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx,
2932 opt_rx->sack_ok) { 2937 opt_rx->sack_ok) {
2933 TCP_SKB_CB(skb)->sacked = (ptr - 2) - (unsigned char *)th; 2938 TCP_SKB_CB(skb)->sacked = (ptr - 2) - (unsigned char *)th;
2934 } 2939 }
2940 break;
2935#ifdef CONFIG_TCP_MD5SIG 2941#ifdef CONFIG_TCP_MD5SIG
2936 case TCPOPT_MD5SIG: 2942 case TCPOPT_MD5SIG:
2937 /* 2943 /*
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 97e294e82679..354721d67f69 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -878,6 +878,7 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr,
878 kfree(newkey); 878 kfree(newkey);
879 return -ENOMEM; 879 return -ENOMEM;
880 } 880 }
881 sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
881 } 882 }
882 if (tcp_alloc_md5sig_pool() == NULL) { 883 if (tcp_alloc_md5sig_pool() == NULL) {
883 kfree(newkey); 884 kfree(newkey);
@@ -1007,7 +1008,7 @@ static int tcp_v4_parse_md5_keys(struct sock *sk, char __user *optval,
1007 return -EINVAL; 1008 return -EINVAL;
1008 1009
1009 tp->md5sig_info = p; 1010 tp->md5sig_info = p;
1010 1011 sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
1011 } 1012 }
1012 1013
1013 newkey = kmemdup(cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL); 1014 newkey = kmemdup(cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL);
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c
index 43294ad9f63e..e49836ce012e 100644
--- a/net/ipv4/tcp_lp.c
+++ b/net/ipv4/tcp_lp.c
@@ -266,7 +266,8 @@ static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked, ktime_t last)
266 struct tcp_sock *tp = tcp_sk(sk); 266 struct tcp_sock *tp = tcp_sk(sk);
267 struct lp *lp = inet_csk_ca(sk); 267 struct lp *lp = inet_csk_ca(sk);
268 268
269 tcp_lp_rtt_sample(sk, ktime_to_us(net_timedelta(last))); 269 if (!ktime_equal(last, net_invalid_timestamp()))
270 tcp_lp_rtt_sample(sk, ktime_to_us(net_timedelta(last)));
270 271
271 /* calc inference */ 272 /* calc inference */
272 if (tcp_time_stamp > tp->rx_opt.rcv_tsecr) 273 if (tcp_time_stamp > tp->rx_opt.rcv_tsecr)
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index 73e19cf7df21..e218a51ceced 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -117,6 +117,9 @@ void tcp_vegas_pkts_acked(struct sock *sk, u32 cnt, ktime_t last)
117 struct vegas *vegas = inet_csk_ca(sk); 117 struct vegas *vegas = inet_csk_ca(sk);
118 u32 vrtt; 118 u32 vrtt;
119 119
120 if (ktime_equal(last, net_invalid_timestamp()))
121 return;
122
120 /* Never allow zero rtt or baseRTT */ 123 /* Never allow zero rtt or baseRTT */
121 vrtt = ktime_to_us(net_timedelta(last)) + 1; 124 vrtt = ktime_to_us(net_timedelta(last)) + 1;
122 125
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c
index 9edb340f2f95..ec854cc5fad5 100644
--- a/net/ipv4/tcp_veno.c
+++ b/net/ipv4/tcp_veno.c
@@ -74,6 +74,9 @@ static void tcp_veno_pkts_acked(struct sock *sk, u32 cnt, ktime_t last)
74 struct veno *veno = inet_csk_ca(sk); 74 struct veno *veno = inet_csk_ca(sk);
75 u32 vrtt; 75 u32 vrtt;
76 76
77 if (ktime_equal(last, net_invalid_timestamp()))
78 return;
79
77 /* Never allow zero rtt or baseRTT */ 80 /* Never allow zero rtt or baseRTT */
78 vrtt = ktime_to_us(net_timedelta(last)) + 1; 81 vrtt = ktime_to_us(net_timedelta(last)) + 1;
79 82