aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2017-11-08 16:01:27 -0500
committerDavid S. Miller <davem@davemloft.net>2017-11-11 04:53:16 -0500
commit737ff314563ca27f044f9a3a041e9d42491ef7ce (patch)
treea95677bca04ad68e0c1a60fa343d59d24934e669 /net/ipv4/tcp_output.c
parent713bafea92920103cd3d361657406cf04d0e22dd (diff)
tcp: use sequence distance to detect reordering
Replace the reordering distance measurement in packet unit with sequence based approach. Previously it trackes the number of "packets" toward the forward ACK (i.e. highest sacked sequence)in a state variable "fackets_out". Precisely measuring reordering degree on packet distance has not much benefit, as the degree constantly changes by factors like path, load, and congestion window. It is also complicated and prone to arcane bugs. This patch replaces with sequence-based approach that's much simpler. Signed-off-by: Yuchung Cheng <ycheng@google.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Neal Cardwell <ncardwell@google.com> Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com> Reviewed-by: Priyaranjan Jha <priyarjha@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 094c429b4401..0256f7a41041 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1218,21 +1218,6 @@ static void tcp_set_skb_tso_segs(struct sk_buff *skb, unsigned int mss_now)
1218 } 1218 }
1219} 1219}
1220 1220
1221/* When a modification to fackets out becomes necessary, we need to check
1222 * skb is counted to fackets_out or not.
1223 */
1224static void tcp_adjust_fackets_out(struct sock *sk, const struct sk_buff *skb,
1225 int decr)
1226{
1227 struct tcp_sock *tp = tcp_sk(sk);
1228
1229 if (!tp->sacked_out || tcp_is_reno(tp))
1230 return;
1231
1232 if (after(tcp_highest_sack_seq(tp), TCP_SKB_CB(skb)->seq))
1233 tp->fackets_out -= decr;
1234}
1235
1236/* Pcount in the middle of the write queue got changed, we need to do various 1221/* Pcount in the middle of the write queue got changed, we need to do various
1237 * tweaks to fix counters 1222 * tweaks to fix counters
1238 */ 1223 */
@@ -1253,8 +1238,6 @@ static void tcp_adjust_pcount(struct sock *sk, const struct sk_buff *skb, int de
1253 if (tcp_is_reno(tp) && decr > 0) 1238 if (tcp_is_reno(tp) && decr > 0)
1254 tp->sacked_out -= min_t(u32, tp->sacked_out, decr); 1239 tp->sacked_out -= min_t(u32, tp->sacked_out, decr);
1255 1240
1256 tcp_adjust_fackets_out(sk, skb, decr);
1257
1258 if (tp->lost_skb_hint && 1241 if (tp->lost_skb_hint &&
1259 before(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(tp->lost_skb_hint)->seq) && 1242 before(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(tp->lost_skb_hint)->seq) &&
1260 (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) 1243 (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))