From nobody Wed Sep 06 04:19:44 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 4RgTfm68VWz4s37r; Wed, 6 Sep 2023 04:19:44 +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 4RgTfm5kLGz3LMf; Wed, 6 Sep 2023 04:19:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693973984; 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=w4QuNfcDR2roKnXdBBWWBgYfMUJiupgocOWe97dQJvU=; b=iWidS/36M94H66FqNw6lYx1XYDYIAI6mqzRbOck7HTM4AZ2o5UPROpTtlRwnb5SrtycRG/ KJ2YiBlTdlyop4DGOaZ+NRZhoEgv1DHXyadHaHW+GWX4FG8fJQsBgPABqzOxs2vaxnDrOU Trr1CUb52lckBNHcEqB/HIzsicBXrpATZoU3jKyMCV2UiRSFOjHj2o/1FBPBxOGTS22TVN zDrHY5UzEgA4RezCi7INP7pedLoW3tz0izyQfcqcHrS6jsFbrR1R2OBLVfHiwG7OXRv38e HKFmTpuZOlydg1RBpELQD1lR/rLBVHrfZY2ATKUebEBqPHnqbrI0UVq8USQXFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693973984; a=rsa-sha256; cv=none; b=Wh8VUCE/o1QLcyaFKTc/c0d7oBeKby5f4/IdlFNHDaboMvK+i12UqyYgMBHQeGv9T7/uL/ 7svY7rN1MPLREN6hed6ck+voJuVwR4bTFqADPsGJi1J9TAidocLm8sEtou45g6NKt5Es3t 1SY3z1FztA5CmccawsjINVcpN/3RzQl3IcX92aFn4HC2HGrfIX+M7GrhU8Du/511V4EObg thjJwWpaof9IQ7vrwhawsaRnpougYMFyqtsi5UA48BLCIeSqVS2dwWIxYbls2YHV+lQwW2 aMttQ+gvepkEFJoScKw1okssvAblZuOGwOpga0XZ9JfKlXC24U3pSSKpzNvH1w== 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=1693973984; 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=w4QuNfcDR2roKnXdBBWWBgYfMUJiupgocOWe97dQJvU=; b=BY1MyF1ab/qFb9jL4CuYvsmUQKkBHB8kQkjO2WH0R8/8s4HOVi9/yGiU0N5BbxACeuPNp5 fdftdXrN1eS48bQv89r3rwTbDNAvbhISIlsn4MyKJuVtsvOoiNU2nkwdjkPgpknejXQdFj DJePhrjr96xGa42q6rlO9pKh9viqDnqqN/bXOKm0JPqpnxw6p4rpu18dFgpe6bAtIgVQ2g yzkqWHrmH1MRMEUofj/256nQcvLsNij+ppiSSPKms0OYqHmkLEi/uyiRpTWgN8yVygr80Q yfn7t1LRvoBa2VlYr2M3GrXQnuJ0SqzTK8y0BPmvJ9ZdMcUrAsQsOsb+2Vsd2w== 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 4RgTfm4dCkz123D; Wed, 6 Sep 2023 04:19:44 +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 3864JiCT057572; Wed, 6 Sep 2023 04:19:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3864JicP057569; Wed, 6 Sep 2023 04:19:44 GMT (envelope-from git) Date: Wed, 6 Sep 2023 04:19:44 GMT Message-Id: <202309060419.3864JicP057569@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: 3fc299d68897 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 3fc299d68897a0748d96510de5f191f5a8249216 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3fc299d68897a0748d96510de5f191f5a8249216 commit 3fc299d68897a0748d96510de5f191f5a8249216 Author: Zhenlei Huang AuthorDate: 2023-09-02 20:34:07 +0000 Commit: Zhenlei Huang CommitDate: 2023-09-06 04:18:29 +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 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) (cherry picked from commit 144851777edad9522390036d3073ea656d7b648d) --- 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 4142dbda65ec..b72a8c852436 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;