From nobody Mon Oct 03 17:25:37 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mh75Y2Zlrz4dlqd; Mon, 3 Oct 2022 17:25:37 +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 4Mh75Y21zRz3sdL; Mon, 3 Oct 2022 17:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664817937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A1mjE4VicUz689vQU89tO8leFPQfjCdX+OJP4UmMYW4=; b=PvDe/K6wcHqfysoZujHF5F1GJD3vgsWYHcfQ7KFTCRzv8Ke4PbVq8L2eitJ2ZD4bRExm7Q Phy0A+vQmgxOFYaoga8E6iQpDkhbGX+HDwb541JRhtiMHSNp+vwyQqpyT4FBQSib346m2m ciAOvZDb4U31yMzcTPSiaefv0FHmeY8X20B0eTCl6d7IGOmnEDwPZJ20twQvonOZEWdhfL uQUUR0lWWV6x4Cym4BlWGglbykhwVXqenlSXIl7Nlu74S/CggYLzhvwJxT50FTjARcFGuL 4vavcBESjJmeNLctz9W0wwralVe0oXQAl6jwDRGGncWn7CFRw4BVr6Ek9FFENw== 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 4Mh75Y0mcfzHGZ; Mon, 3 Oct 2022 17:25:37 +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 293HPbkO032148; Mon, 3 Oct 2022 17:25:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 293HPbVd032147; Mon, 3 Oct 2022 17:25:37 GMT (envelope-from git) Date: Mon, 3 Oct 2022 17:25:37 GMT Message-Id: <202210031725.293HPbVd032147@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: 0924ae8f47ae - main - tcp: allow window scale and timestamps to be toggled individually List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 0924ae8f47ae7095a048843e588a81a12787a819 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664817937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A1mjE4VicUz689vQU89tO8leFPQfjCdX+OJP4UmMYW4=; b=tW+zRHT8/8rnrYHANTFXH5+xjScw2QH8av6xKyGJ11DE6AnOBAywHB0h0vcDUnkw/zwN2w ItMTBCwj7LfvPYQVQVKpB9gik0j0hu0jg9XKIRHPj8EXTVxRVNdYBuEgl0JUsbdwkYoOjj rf10m4Qfzi/UFyYuhmYhaByXkM4ZF85aqkW3ycqoopvE0WX5xPXyXN0tf1mqnf5zR/JJja Aj+phV7L2678LrPIPevD0QW2KBtsdXdsE16T5eIM7BaGz702G0t23PPpLymMRs/+nGC0HE 2woxQgdeVQFg0+0JZytaOGUhk2yzbkqfWoQRJjqsCsrTq8JTqCEGPC8xNGkp6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664817937; a=rsa-sha256; cv=none; b=UJMsig9oKNJ2z9RNVCSVwkDS3jyQctIScnU53rfLVEh9LVhuWw273skFLSDLoxTtSnFqlQ xfCs3dkRT/yYYuv99HEr4Ugw9jmVWhKgVbw8AGcA2Tyq/hx5udNoaXyn73JyK0BkNo7gxC 1d8AbCMzY23gwj1XZHMJ5NDjfs3dCqWwTN1bXmG/VnWTcCuhY3tnHjlQI/il+LK0+ISRRc 4d2ymUr1Nea5vpgC9TUTBQpl37jfzMTJ+Nuf/Kt9WUazDJoyXwl38g72fQmMfSf4A9nlGO sf2OKsPWCJP7XeeBJHkq0ogVck6dGONqds+MsGIn4hkPbjLH0nu1tXVAbMbrKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=0924ae8f47ae7095a048843e588a81a12787a819 commit 0924ae8f47ae7095a048843e588a81a12787a819 Author: Richard Scheffenegger AuthorDate: 2022-10-03 17:18:58 +0000 Commit: Richard Scheffenegger CommitDate: 2022-10-03 17:21:46 +0000 tcp: allow window scale and timestamps to be toggled individually Simple change to allow for the individual toggling of RFC7323 window scaling and timestamp option. Reviewed By: rrs, tuexen, glebius, guest-ccui, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D36863 --- share/man/man4/tcp.4 | 13 ++++++++++++- sys/netinet/tcp_subr.c | 16 ++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 0b38fd63e165..e6f4ced0c1cf 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -892,7 +892,18 @@ minimum, which gives us an effective minimum of 200ms (similar to The initial value is used before an RTT measurement has been performed. .It Va rfc1323 Implement the window scaling and timestamp options of RFC 1323/RFC 7323 -(default is true). +(default is 1). +Settings: +.Bl -tag -compact +.It 0 +Disable window scaling and timestamp option. +.It 1 +Enable window scaling and timestamp option. +.It 2 +Enable only window scaling. +.It 3 +Enable only timestamp option. +.El .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 diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index f9dc57e1df66..9b3525815f73 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2280,8 +2280,20 @@ tcp_newtcpcb(struct inpcb *inp) callout_init(&tp->t_timers->tt_2msl, 1); callout_init(&tp->t_timers->tt_delack, 1); - if (V_tcp_do_rfc1323) - tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP); + switch (V_tcp_do_rfc1323) { + case 0: + break; + default: + case 1: + tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP); + break; + case 2: + tp->t_flags = TF_REQ_SCALE; + break; + case 3: + tp->t_flags = TF_REQ_TSTMP; + break; + } if (V_tcp_do_sack) tp->t_flags |= TF_SACK_PERMIT; TAILQ_INIT(&tp->snd_holes);