Date: Wed, 6 Sep 2023 04:09:30 GMT From: Zhenlei Huang <zlei@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 144851777eda - stable/14 - tcp: Initialize the maximum number of entries in a client cookie cache bucket Message-ID: <202309060409.38649Ul5040447@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=144851777edad9522390036d3073ea656d7b648d commit 144851777edad9522390036d3073ea656d7b648d Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2023-09-02 20:34:07 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309060409.38649Ul5040447>