From owner-dev-commits-src-all@freebsd.org Sat Apr 17 13:50:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CD085D73B0; Sat, 17 Apr 2021 13:50:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FMvbk19Ctz4jJF; Sat, 17 Apr 2021 13:50:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1699C192D9; Sat, 17 Apr 2021 13:50:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13HDoPT1025777; Sat, 17 Apr 2021 13:50:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13HDoPQL025776; Sat, 17 Apr 2021 13:50:25 GMT (envelope-from git) Date: Sat, 17 Apr 2021 13:50:25 GMT Message-Id: <202104171350.13HDoPQL025776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: d1de2b05a001 - main - tcp: Rename rfc6675_pipe to sack.revised, and enable by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1de2b05a001d3d80f633f576f4909c2686dda3d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2021 13:50:26 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=d1de2b05a001d3d80f633f576f4909c2686dda3d commit d1de2b05a001d3d80f633f576f4909c2686dda3d Author: Richard Scheffenegger AuthorDate: 2021-04-17 12:59:30 +0000 Commit: Richard Scheffenegger CommitDate: 2021-04-17 12:59:45 +0000 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 --- share/man/man4/tcp.4 | 25 ++++++++++++++----------- sys/netinet/cc/cc_cubic.c | 2 +- sys/netinet/cc/cc_htcp.c | 2 +- sys/netinet/cc/cc_newreno.c | 2 +- sys/netinet/tcp_input.c | 11 +++-------- sys/netinet/tcp_sack.c | 12 +++++++++--- sys/netinet/tcp_var.h | 4 ++-- 7 files changed, 31 insertions(+), 27 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index d01505e58427..cbb8021226fe 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -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. diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index 210806c2f4f7..56b87ba4089b 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -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; diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c index b5739142c9e5..d109f2c4af4a 100644 --- a/sys/netinet/cc/cc_htcp.c +++ b/sys/netinet/cc/cc_htcp.c @@ -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; diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index 84f8b6a5eb1a..daf4e3351ffa 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -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; diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index cfb0989a7203..ed184de4a4bf 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -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; diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index f8d983da723b..a28bb40a8332 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -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) && diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 48e4c5c8e89a..4d28cab80d89 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -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)