Skip to content

Commit 9b44190

Browse files
yuchungchengdavem330
authored andcommitted
tcp: refactor F-RTO
The patch series refactor the F-RTO feature (RFC4138/5682). This is to simplify the loss recovery processing. Existing F-RTO was developed during the experimental stage (RFC4138) and has many experimental features. It takes a separate code path from the traditional timeout processing by overloading CA_Disorder instead of using CA_Loss state. This complicates CA_Disorder state handling because it's also used for handling dubious ACKs and undos. While the algorithm in the RFC does not change the congestion control, the implementation intercepts congestion control in various places (e.g., frto_cwnd in tcp_ack()). The new code implements newer F-RTO RFC5682 using CA_Loss processing path. F-RTO becomes a small extension in the timeout processing and interfaces with congestion control and Eifel undo modules. It lets congestion control (module) determines how many to send independently. F-RTO only chooses what to send in order to detect spurious retranmission. If timeout is found spurious it invokes existing Eifel undo algorithms like DSACK or TCP timestamp based detection. The first patch removes all F-RTO code except the sysctl_tcp_frto is left for the new implementation. Since CA_EVENT_FRTO is removed, TCP westwood now computes ssthresh on regular timeout CA_EVENT_LOSS event. Signed-off-by: Yuchung Cheng <ycheng@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e306e2c commit 9b44190

File tree

9 files changed

+10
-421
lines changed

9 files changed

+10
-421
lines changed

Documentation/networking/ip-sysctl.txt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -239,23 +239,6 @@ tcp_frto - INTEGER
239239
interacts badly with the packet counting of the SACK enabled TCP
240240
flow.
241241

242-
tcp_frto_response - INTEGER
243-
When F-RTO has detected that a TCP retransmission timeout was
244-
spurious (i.e, the timeout would have been avoided had TCP set a
245-
longer retransmission timeout), TCP has several options what to do
246-
next. Possible values are:
247-
0 Rate halving based; a smooth and conservative response,
248-
results in halved cwnd and ssthresh after one RTT
249-
1 Very conservative response; not recommended because even
250-
though being valid, it interacts poorly with the rest of
251-
Linux TCP, halves cwnd and ssthresh immediately
252-
2 Aggressive response; undoes congestion control measures
253-
that are now known to be unnecessary (ignoring the
254-
possibility of a lost retransmission that would require
255-
TCP to be more cautious), cwnd and ssthresh are restored
256-
to the values prior timeout
257-
Default: 0 (rate halving based)
258-
259242
tcp_keepalive_time - INTEGER
260243
How often TCP sends out keepalive messages when keepalive is enabled.
261244
Default: 2hours.

include/linux/tcp.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,12 @@ struct tcp_sock {
187187
u32 window_clamp; /* Maximal window to advertise */
188188
u32 rcv_ssthresh; /* Current window clamp */
189189

190-
u32 frto_highmark; /* snd_nxt when RTO occurred */
191190
u16 advmss; /* Advertised MSS */
192-
u8 frto_counter; /* Number of new acks after RTO */
191+
u8 unused;
193192
u8 nonagle : 4,/* Disable Nagle algorithm? */
194193
thin_lto : 1,/* Use linear timeouts for thin streams */
195194
thin_dupack : 1,/* Fast retransmit on first dupack */
196-
repair : 1,
197-
unused : 1;
195+
repair : 1;
198196
u8 repair_queue;
199197
u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */
200198
syn_data:1, /* SYN includes data */

include/net/tcp.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ extern int sysctl_tcp_app_win;
272272
extern int sysctl_tcp_adv_win_scale;
273273
extern int sysctl_tcp_tw_reuse;
274274
extern int sysctl_tcp_frto;
275-
extern int sysctl_tcp_frto_response;
276275
extern int sysctl_tcp_low_latency;
277276
extern int sysctl_tcp_dma_copybreak;
278277
extern int sysctl_tcp_nometrics_save;
@@ -424,8 +423,6 @@ extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb,
424423
bool fastopen);
425424
extern int tcp_child_process(struct sock *parent, struct sock *child,
426425
struct sk_buff *skb);
427-
extern bool tcp_use_frto(struct sock *sk);
428-
extern void tcp_enter_frto(struct sock *sk);
429426
extern void tcp_enter_loss(struct sock *sk, int how);
430427
extern void tcp_clear_retrans(struct tcp_sock *tp);
431428
extern void tcp_update_metrics(struct sock *sk);
@@ -756,7 +753,6 @@ enum tcp_ca_event {
756753
CA_EVENT_TX_START, /* first transmit when no packets in flight */
757754
CA_EVENT_CWND_RESTART, /* congestion window restart */
758755
CA_EVENT_COMPLETE_CWR, /* end of congestion recovery */
759-
CA_EVENT_FRTO, /* fast recovery timeout */
760756
CA_EVENT_LOSS, /* loss timeout */
761757
CA_EVENT_FAST_ACK, /* in sequence ack */
762758
CA_EVENT_SLOW_ACK, /* other ack */

net/ipv4/sysctl_net_ipv4.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -591,13 +591,6 @@ static struct ctl_table ipv4_table[] = {
591591
.mode = 0644,
592592
.proc_handler = proc_dointvec
593593
},
594-
{
595-
.procname = "tcp_frto_response",
596-
.data = &sysctl_tcp_frto_response,
597-
.maxlen = sizeof(int),
598-
.mode = 0644,
599-
.proc_handler = proc_dointvec
600-
},
601594
{
602595
.procname = "tcp_low_latency",
603596
.data = &sysctl_tcp_low_latency,

0 commit comments

Comments
 (0)