Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bec41a11 authored by Yuchung Cheng's avatar Yuchung Cheng Committed by David S. Miller
Browse files

tcp: remove early retransmit



This patch removes the support of RFC5827 early retransmit (i.e.,
fast recovery on small inflight with <3 dupacks) because it is
subsumed by the new RACK loss detection. More specifically when
RACK receives DUPACKs, it'll arm a reordering timer to start fast
recovery after a quarter of (min)RTT, hence it covers the early
retransmit except RACK does not limit itself to specific inflight
or dupack numbers.

Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 840a3cbe
Loading
Loading
Loading
Loading
+5 −14
Original line number Diff line number Diff line
@@ -246,21 +246,12 @@ tcp_dsack - BOOLEAN
	Allows TCP to send "duplicate" SACKs.

tcp_early_retrans - INTEGER
	Enable Early Retransmit (ER), per RFC 5827. ER lowers the threshold
	for triggering fast retransmit when the amount of outstanding data is
	small and when no previously unsent data can be transmitted (such
	that limited transmit could be used). Also controls the use of
	Tail loss probe (TLP) that converts RTOs occurring due to tail
	losses into fast recovery (draft-dukkipati-tcpm-tcp-loss-probe-01).
	Tail loss probe (TLP) converts RTOs occurring due to tail
	losses into fast recovery (draft-ietf-tcpm-rack). Note that
	TLP requires RACK to function properly (see tcp_recovery below)
	Possible values:
		0 disables ER
		1 enables ER
		2 enables ER but delays fast recovery and fast retransmit
		  by a fourth of RTT. This mitigates connection falsely
		  recovers when network has a small degree of reordering
		  (less than 3 packets).
		3 enables delayed ER and TLP.
		4 enables TLP only.
		0 disables TLP
		3 or 4 enables TLP
	Default: 3

tcp_ecn - INTEGER
+1 −2
Original line number Diff line number Diff line
@@ -224,8 +224,7 @@ struct tcp_sock {
		repair      : 1,
		frto        : 1;/* F-RTO (RFC5682) activated in CA_Loss */
	u8	repair_queue;
	u8	do_early_retrans:1,/* Enable RFC5827 early-retransmit  */
		syn_data:1,	/* SYN includes data */
	u8	syn_data:1,	/* SYN includes data */
		syn_fastopen:1,	/* SYN includes Fast Open option */
		syn_fastopen_exp:1,/* SYN includes Fast Open exp. option */
		syn_data_acked:1,/* data in SYN is acked by SYN-ACK */
+0 −19
Original line number Diff line number Diff line
@@ -565,7 +565,6 @@ void tcp_skb_collapse_tstamp(struct sk_buff *skb,
			     const struct sk_buff *next_skb);

/* tcp_input.c */
void tcp_resume_early_retransmit(struct sock *sk);
void tcp_rearm_rto(struct sock *sk);
void tcp_synack_rtt_meas(struct sock *sk, struct request_sock *req);
void tcp_reset(struct sock *sk);
@@ -1037,24 +1036,6 @@ static inline void tcp_enable_fack(struct tcp_sock *tp)
	tp->rx_opt.sack_ok |= TCP_FACK_ENABLED;
}

/* TCP early-retransmit (ER) is similar to but more conservative than
 * the thin-dupack feature.  Enable ER only if thin-dupack is disabled.
 */
static inline void tcp_enable_early_retrans(struct tcp_sock *tp)
{
	struct net *net = sock_net((struct sock *)tp);

	tp->do_early_retrans = sysctl_tcp_early_retrans &&
		sysctl_tcp_early_retrans < 4 && !sysctl_tcp_thin_dupack &&
		!(sysctl_tcp_recovery & TCP_RACK_LOSS_DETECTION) &&
		net->ipv4.sysctl_tcp_reordering == 3;
}

static inline void tcp_disable_early_retrans(struct tcp_sock *tp)
{
	tp->do_early_retrans = 0;
}

static inline unsigned int tcp_left_out(const struct tcp_sock *tp)
{
	return tp->sacked_out + tp->lost_out;
+0 −1
Original line number Diff line number Diff line
@@ -215,7 +215,6 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
	}

	if (icsk->icsk_pending == ICSK_TIME_RETRANS ||
	    icsk->icsk_pending == ICSK_TIME_EARLY_RETRANS ||
	    icsk->icsk_pending == ICSK_TIME_REO_TIMEOUT ||
	    icsk->icsk_pending == ICSK_TIME_LOSS_PROBE) {
		r->idiag_timer = 1;
+0 −3
Original line number Diff line number Diff line
@@ -406,7 +406,6 @@ void tcp_init_sock(struct sock *sk)
	tp->mss_cache = TCP_MSS_DEFAULT;

	tp->reordering = sock_net(sk)->ipv4.sysctl_tcp_reordering;
	tcp_enable_early_retrans(tp);
	tcp_assign_congestion_control(sk);

	tp->tsoffset = 0;
@@ -2477,8 +2476,6 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
			err = -EINVAL;
		else {
			tp->thin_dupack = val;
			if (tp->thin_dupack)
				tcp_disable_early_retrans(tp);
		}
		break;

Loading