From nobody Wed Sep 06 04:09:30 2023 X-Original-To: dev-commits-src-all@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 4RgTQz23Fxz4rxGQ; Wed, 6 Sep 2023 04:09:31 +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 4RgTQz1PcJz3Hjy; Wed, 6 Sep 2023 04:09:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693973371; 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=ybhvik6qeXOZvQer8PCh2TNOnUh2NPSNBv/A+tWDIRc=; b=WwJjvGES/n/MFGpHSgGXs7gh/NSvt19JZ9ZwiU56DJsLmRih2ozlw8o6/4ygOK4BY9PESh N7THVYmp3gek/2oVop4Ct1cxIFIUl55nHnX20nWyFLbBc03edfps7BVU1bUaZuyi2k3Wav Em5oiGvgSMS0/q5SQZPAk/t5S6bmmW5Ibyk5tk+wL9czOMCLozIixhK6AR7J4NUAJmDqMC /1wS7h7WYp6zVFybWBz7mrBOKTfcj+J9s8dkdjgH/XxJkcub/oQfvbxsBH6KsDz/u8sQdN MylJweFsHEHnCJGS+jczIt2oVKCsRhhOg57xKRHS6gL7LnNfvlMVLjLC2GI/jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693973371; a=rsa-sha256; cv=none; b=P26sbGtiY73bTdvXidO3LQoz/dZ9W1SO/qgjoKVtnViKA/P5rs8mZiW1e5QqnF9wiQ111L hXU9SOubzbnrPziP+f/9nKqFg/V/Nc17vV+SoSEUKtgVwGeoOfkYj0SJLMz/Ow3mTH16g6 q+JdzK949I+JK0eb9IPgejsb6QF0ZGRpyw2nmXep0sRah60b8mcbOKtMGtobhBltRl8kr9 pXLR9ysZwYZftbjoxElc+90eHE+QXyzkxLjx8xAa6fZVxhsZWiKMTXfPfdlWqU8LpC8V0d HU+aRfXvChyoa9nVjr0IYy29JQGV79FCsfHEyRg71/jR/gcsTiWnJuJEF04GvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693973371; 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=ybhvik6qeXOZvQer8PCh2TNOnUh2NPSNBv/A+tWDIRc=; b=Tns0rZ2yioUF/c5UPA/9BbtDgYIo/qkYvjgsX/annQYb4nYXSgLng6ZOveWwxYLqrwIcxW yUxBz8QYG+rFT52lxxqk0muTspN5mhIs0u6PJXWDBwhzOalm1i61/R0u/m19zvkNIzJM3k EOKFqfLUe2vGwOs2gvdbaEd7qUiefdVwBsjw+BfyYLhVTFcsm9AZ++h0pnRbUVR82W+yST +XRoLGHXwqAYWxhqx95bnXAwVGiorOgQBxKqBZqdFESfne4uHVW8ayI2iJOv0co7jy3nIS cz3on0fEf3kH71DDeXplhluAC2hzC98oRKEIiQlD1RW6tH1rRADKW57bPS+/7g== 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 4RgTQz0F0Lz1186; Wed, 6 Sep 2023 04:09:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38649Ufu040450; Wed, 6 Sep 2023 04:09:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38649Ul5040447; Wed, 6 Sep 2023 04:09:30 GMT (envelope-from git) Date: Wed, 6 Sep 2023 04:09:30 GMT Message-Id: <202309060409.38649Ul5040447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 144851777eda - stable/14 - tcp: Initialize the maximum number of entries in a client cookie cache bucket List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 144851777edad9522390036d3073ea656d7b648d Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=144851777edad9522390036d3073ea656d7b648d commit 144851777edad9522390036d3073ea656d7b648d Author: Zhenlei Huang AuthorDate: 2023-09-02 20:34:07 +0000 Commit: Zhenlei Huang CommitDate: 2023-09-06 04:07:49 +0000 tcp: Initialize the maximum number of entries in a client cookie cache bucket This vnet loader tunable is defined with SYSCTL_PROC, thus will not be initialized by kernel on vnet creating and will always have the default value TCP_FASTOPEN_CCACHE_BUCKET_LIMIT_DEFAULT. Fix by fetching the value from the corresponding kernel environment during vnet constructing. PR: 273509 Reviewed by: #transport, tuexen Approved by: re (gjb) Fixes: c560df6f12f1 This is an implementation of the client side of TCP Fast Open (TFO) [RFC7413] MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41691 (cherry picked from commit 224aec05e732bb97a0d3c91142973b98a91238d1) --- sys/netinet/tcp_fastopen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_fastopen.c b/sys/netinet/tcp_fastopen.c index 9b6f9c17b05c..c31225214d1d 100644 --- a/sys/netinet/tcp_fastopen.c +++ b/sys/netinet/tcp_fastopen.c @@ -271,7 +271,7 @@ SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, autokey, static int sysctl_net_inet_tcp_fastopen_ccache_bucket_limit(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, ccache_bucket_limit, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_NEEDGIANT, NULL, 0, &sysctl_net_inet_tcp_fastopen_ccache_bucket_limit, "IU", "Max entries per bucket in client cookie cache"); @@ -393,7 +393,8 @@ tcp_fastopen_init(void) V_tcp_fastopen_keys.newest = TCP_FASTOPEN_MAX_KEYS - 1; V_tcp_fastopen_keys.newest_psk = TCP_FASTOPEN_MAX_PSKS - 1; - /* May already be non-zero if kernel tunable was set */ + TUNABLE_INT_FETCH("net.inet.tcp.fastopen.ccache_bucket_limit", + &V_tcp_fastopen_ccache.bucket_limit); if (V_tcp_fastopen_ccache.bucket_limit == 0) V_tcp_fastopen_ccache.bucket_limit = TCP_FASTOPEN_CCACHE_BUCKET_LIMIT_DEFAULT;