diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2018-08-24 14:18:37 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2018-08-24 14:18:37 -0400 |
commit | 87a37f460e69f6a3d9d701b84005c2d24b558bcd (patch) | |
tree | b930e612932a48f4d41000cacd155878ed4fea91 | |
parent | 86be8883a73a3ecd98a76f05d6374af8836bac63 (diff) | |
download | longterm-queue-4.12-87a37f460e69f6a3d9d701b84005c2d24b558bcd.tar.gz |
tcp: more complex refresh
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/tcp-invalidate-rate-samples-during-SACK-reneging.patch | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/queue/tcp-invalidate-rate-samples-during-SACK-reneging.patch b/queue/tcp-invalidate-rate-samples-during-SACK-reneging.patch index f35e655..f9cf08a 100644 --- a/queue/tcp-invalidate-rate-samples-during-SACK-reneging.patch +++ b/queue/tcp-invalidate-rate-samples-during-SACK-reneging.patch @@ -1,4 +1,4 @@ -From d4761754b4fb2ef8d9a1e9d121c4bec84e1fe292 Mon Sep 17 00:00:00 2001 +From 7702b6f8b7b8f3d6b8fda4c55dd75bf28e1d2595 Mon Sep 17 00:00:00 2001 From: Yousuk Seung <ysseung@google.com> Date: Thu, 7 Dec 2017 13:41:34 -0800 Subject: [PATCH] tcp: invalidate rate samples during SACK reneging @@ -32,26 +32,27 @@ Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Acked-by: Priyaranjan Jha <priyarjha@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> diff --git a/include/linux/tcp.h b/include/linux/tcp.h -index df5d97a85e1a..ca4a6361389b 100644 +index b6d5adcee8fc..ab28727c70ad 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h -@@ -224,7 +224,8 @@ struct tcp_sock { +@@ -223,7 +223,8 @@ struct tcp_sock { + u8 chrono_type:2, /* current chronograph type */ rate_app_limited:1, /* rate_{delivered,interval_us} limited? */ fastopen_connect:1, /* FASTOPEN_CONNECT sockopt */ - fastopen_no_cookie:1, /* Allow send/recv SYN+data without a cookie */ -- unused:3; +- unused:4; + is_sack_reneg:1, /* in recovery from loss with SACK reneg? */ -+ unused:2; ++ unused:3; u8 nonagle : 4,/* Disable Nagle algorithm? */ thin_lto : 1,/* Use linear timeouts for thin streams */ unused1 : 1, diff --git a/include/net/tcp.h b/include/net/tcp.h -index 6998707e81f3..6da880d2f022 100644 +index 0c67f67e5c10..eacf9991e84f 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -1055,7 +1055,7 @@ void tcp_rate_skb_sent(struct sock *sk, struct sk_buff *skb); +@@ -1004,7 +1004,7 @@ void tcp_rate_skb_sent(struct sock *sk, struct sk_buff *skb); void tcp_rate_skb_delivered(struct sock *sk, struct sk_buff *skb, struct rate_sample *rs); void tcp_rate_gen(struct sock *sk, u32 delivered, u32 lost, @@ -61,10 +62,10 @@ index 6998707e81f3..6da880d2f022 100644 /* These functions determine how the current flow behaves in respect of SACK diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c -index bf97317e6c97..f08eebe60446 100644 +index 40aca7803cf2..c6b0a5315421 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c -@@ -2412,6 +2412,7 @@ int tcp_disconnect(struct sock *sk, int flags) +@@ -2321,6 +2321,7 @@ int tcp_disconnect(struct sock *sk, int flags) tp->snd_cwnd_cnt = 0; tp->window_clamp = 0; tcp_set_ca_state(sk, TCP_CA_Open); @@ -73,19 +74,19 @@ index bf97317e6c97..f08eebe60446 100644 inet_csk_delack_init(sk); /* Initialize rcv_mss to TCP_MIN_MSS to avoid division by 0 diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c -index 514c00732988..075c559570e6 100644 +index e1bb061c32a6..19d392e3336f 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -1942,6 +1942,8 @@ void tcp_enter_loss(struct sock *sk) - if (is_reneg) { +@@ -1968,6 +1968,8 @@ void tcp_enter_loss(struct sock *sk) NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSACKRENEGING); tp->sacked_out = 0; + tp->fackets_out = 0; + /* Mark SACK reneging until we recover from this loss event. */ + tp->is_sack_reneg = 1; } tcp_clear_all_retrans_hints(tp); -@@ -2365,6 +2367,7 @@ static bool tcp_try_undo_recovery(struct sock *sk) +@@ -2421,6 +2423,7 @@ static bool tcp_try_undo_recovery(struct sock *sk) return true; } tcp_set_ca_state(sk, TCP_CA_Open); @@ -93,7 +94,7 @@ index 514c00732988..075c559570e6 100644 return false; } -@@ -2398,8 +2401,10 @@ static bool tcp_try_undo_loss(struct sock *sk, bool frto_undo) +@@ -2452,8 +2455,10 @@ static bool tcp_try_undo_loss(struct sock *sk, bool frto_undo) NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSPURIOUSRTOS); inet_csk(sk)->icsk_retransmits = 0; @@ -105,7 +106,7 @@ index 514c00732988..075c559570e6 100644 return true; } return false; -@@ -3496,6 +3501,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) +@@ -3541,6 +3546,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) struct tcp_sacktag_state sack_state; struct rate_sample rs = { .prior_delivered = 0 }; u32 prior_snd_una = tp->snd_una; @@ -113,8 +114,8 @@ index 514c00732988..075c559570e6 100644 u32 ack_seq = TCP_SKB_CB(skb)->seq; u32 ack = TCP_SKB_CB(skb)->ack_seq; bool is_dupack = false; -@@ -3612,7 +3618,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) - +@@ -3656,7 +3662,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) + tcp_schedule_loss_probe(sk); delivered = tp->delivered - delivered; /* freshly ACKed or SACKed */ lost = tp->lost - lost; /* freshly marked lost */ - tcp_rate_gen(sk, delivered, lost, sack_state.rate); @@ -123,7 +124,7 @@ index 514c00732988..075c559570e6 100644 tcp_xmit_recovery(sk, rexmit); return 1; diff --git a/net/ipv4/tcp_rate.c b/net/ipv4/tcp_rate.c -index 3330a370d306..c61240e43923 100644 +index c6a9fa894646..01f7afb37ab9 100644 --- a/net/ipv4/tcp_rate.c +++ b/net/ipv4/tcp_rate.c @@ -106,7 +106,7 @@ void tcp_rate_skb_delivered(struct sock *sk, struct sk_buff *skb, @@ -140,13 +141,13 @@ index 3330a370d306..c61240e43923 100644 rs->acked_sacked = delivered; /* freshly ACKed or SACKed */ rs->losses = lost; /* freshly marked lost */ - /* Return an invalid sample if no timing information is available. */ -- if (!rs->prior_mstamp) { +- if (!rs->prior_mstamp.v64) { + /* Return an invalid sample if no timing information is available or + * in recovery from loss with SACK reneging. Rate samples taken during + * a SACK reneging event may overestimate bw by including packets that + * were SACKed before the reneg. + */ -+ if (!rs->prior_mstamp || is_sack_reneg) { ++ if (!rs->prior_mstamp.v64 || is_sack_reneg) { rs->delivered = -1; rs->interval_us = -1; return; |