tcp: Rename rfc6675_pipe to sack.revised, and enable by default

As full support of RFC6675 is in place, deprecating
net.inet.tcp.rfc6675_pipe and enabling by default
net.inet.tcp.sack.revised.

Reviewed By: #transport, kbowling, rrs
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D28702
This commit is contained in:
Richard Scheffenegger 2021-04-17 14:59:30 +02:00
parent 21afed4b1d
commit d1de2b05a0
7 changed files with 31 additions and 27 deletions

View File

@ -34,7 +34,7 @@
.\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
.Dd April 8, 2021
.Dd April 17, 2021
.Dt TCP 4
.Os
.Sh NAME
@ -558,16 +558,8 @@ Helpful when a misconfigured token bucket traffic policer causes persistent
high losses leading to RTO, but reduces PRR effectiveness in more common settings
(default is false).
.It Va rfc6675_pipe
Calculate the bytes in flight using the algorithm described in RFC 6675, and
is also an improvement when Proportional Rate Reduction is enabled.
Also enables two other mechanisms from RFC6675.
Rescue Retransmission helps timely loss recovery, when the trailing segments
of a transmission are lost, while no additional data is ready to be sent.
In case a partial ACK without a SACK block is received during SACK loss
recovery, the trailing segment is immediately resent, rather than waiting
for a Retransmission timeout.
SACK loss recovery is also engaged, once two segments plus one byte are
SACKed - even if no traditional duplicate ACKs were seen.
Deprecated and superseded by
.Va sack.revised
.It Va rfc3042
Enable the Limited Transmit algorithm as described in RFC 3042.
It helps avoid timeouts on lossy links and also when the congestion window
@ -584,6 +576,17 @@ Enable support for RFC 2018, TCP Selective Acknowledgment option,
which allows the receiver to inform the sender about all successfully
arrived segments, allowing the sender to retransmit the missing segments
only.
.It Va sack.revised
Enables three updated mechanisms from RFC6675 (default is true).
Calculate the bytes in flight using the algorithm described in RFC 6675, and
is also an improvement when Proportional Rate Reduction is enabled.
Next, Rescue Retransmission helps timely loss recovery, when the trailing segments
of a transmission are lost, while no additional data is ready to be sent.
In case a partial ACK without a SACK block is received during SACK loss
recovery, the trailing segment is immediately resent, rather than waiting
for a Retransmission timeout.
Finally, SACK loss recovery is also engaged, once two segments plus one byte are
SACKed - even if no traditional duplicate ACKs were observed.
.It Va sack.maxholes
Maximum number of SACK holes per connection.
Defaults to 128.

View File

@ -373,7 +373,7 @@ cubic_post_recovery(struct cc_var *ccv)
*
* XXXLAS: Find a way to do this without needing curack
*/
if (V_tcp_do_rfc6675_pipe)
if (V_tcp_do_newsack)
pipe = tcp_compute_pipe(ccv->ccvc.tcp);
else
pipe = CCV(ccv, snd_max) - ccv->curack;

View File

@ -366,7 +366,7 @@ htcp_post_recovery(struct cc_var *ccv)
*
* XXXLAS: Find a way to do this without needing curack
*/
if (V_tcp_do_rfc6675_pipe)
if (V_tcp_do_newsack)
pipe = tcp_compute_pipe(ccv->ccvc.tcp);
else
pipe = CCV(ccv, snd_max) - ccv->curack;

View File

@ -302,7 +302,7 @@ newreno_post_recovery(struct cc_var *ccv)
*
* XXXLAS: Find a way to do this without needing curack
*/
if (V_tcp_do_rfc6675_pipe)
if (V_tcp_do_newsack)
pipe = tcp_compute_pipe(ccv->ccvc.tcp);
else
pipe = CCV(ccv, snd_max) - ccv->curack;

View File

@ -168,11 +168,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, newcwv, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(tcp_do_newcwv), 0,
"Enable New Congestion Window Validation per RFC7661");
VNET_DEFINE(int, tcp_do_rfc6675_pipe) = 0;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc6675_pipe, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(tcp_do_rfc6675_pipe), 0,
"Use calculated pipe/in-flight bytes per RFC 6675");
VNET_DEFINE(int, tcp_do_rfc3042) = 1;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(tcp_do_rfc3042), 0,
@ -2595,7 +2590,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
* we have less than 1/2 the original window's
* worth of data in flight.
*/
if (V_tcp_do_rfc6675_pipe)
if (V_tcp_do_newsack)
awnd = tcp_compute_pipe(tp);
else
awnd = (tp->snd_nxt - tp->snd_fack) +
@ -2612,7 +2607,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
goto drop;
} else if (tp->t_dupacks == tcprexmtthresh ||
(tp->t_flags & TF_SACK_PERMIT &&
V_tcp_do_rfc6675_pipe &&
V_tcp_do_newsack &&
tp->sackhint.sacked_bytes >
(tcprexmtthresh - 1) * maxseg)) {
enter_recovery:
@ -3940,7 +3935,7 @@ tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to)
* network.
*/
del_data = tp->sackhint.delivered_data;
if (V_tcp_do_rfc6675_pipe)
if (V_tcp_do_newsack)
pipe = tcp_compute_pipe(tp);
else
pipe = (tp->snd_nxt - tp->snd_fack) + tp->sackhint.sack_bytes_rexmit;

View File

@ -130,10 +130,16 @@ VNET_DECLARE(struct uma_zone *, sack_hole_zone);
SYSCTL_NODE(_net_inet_tcp, OID_AUTO, sack, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"TCP SACK");
VNET_DEFINE(int, tcp_do_sack) = 1;
#define V_tcp_do_sack VNET(tcp_do_sack)
SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, enable, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(tcp_do_sack), 0, "Enable/Disable TCP SACK support");
&VNET_NAME(tcp_do_sack), 0,
"Enable/Disable TCP SACK support");
VNET_DEFINE(int, tcp_do_newsack) = 1;
SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, revised, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(tcp_do_newsack), 0,
"Use revised SACK loss recovery per RFC 6675");
VNET_DEFINE(int, tcp_sack_maxholes) = 128;
SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, maxholes, CTLFLAG_VNET | CTLFLAG_RW,
@ -826,7 +832,7 @@ tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th)
* the trailing packets of a window are lost and no further data
* is available for sending.
*/
if ((V_tcp_do_rfc6675_pipe) &&
if ((V_tcp_do_newsack) &&
SEQ_LT(th->th_ack, tp->snd_recover) &&
(tp->snd_recover == tp->snd_max) &&
TAILQ_EMPTY(&tp->snd_holes) &&

View File

@ -846,7 +846,7 @@ VNET_DECLARE(int, tcp_tolerate_missing_ts);
VNET_DECLARE(int, tcp_do_rfc3042);
VNET_DECLARE(int, tcp_do_rfc3390);
VNET_DECLARE(int, tcp_do_rfc3465);
VNET_DECLARE(int, tcp_do_rfc6675_pipe);
VNET_DECLARE(int, tcp_do_newsack);
VNET_DECLARE(int, tcp_do_sack);
VNET_DECLARE(int, tcp_do_tso);
VNET_DECLARE(int, tcp_ecn_maxretries);
@ -891,7 +891,7 @@ VNET_DECLARE(struct inpcbinfo, tcbinfo);
#define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042)
#define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390)
#define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465)
#define V_tcp_do_rfc6675_pipe VNET(tcp_do_rfc6675_pipe)
#define V_tcp_do_newsack VNET(tcp_do_newsack)
#define V_tcp_do_sack VNET(tcp_do_sack)
#define V_tcp_do_tso VNET(tcp_do_tso)
#define V_tcp_ecn_maxretries VNET(tcp_ecn_maxretries)