Spot this while testing https://reviews.freebsd.org/D41525 . As per the man page TCP(4): > fastopen.ccache_bucket_limit > The maximum number of entries in a client cookie > cache bucket. The default value can be tuned with > the TCP_FASTOPEN_CCACHE_BUCKET_LIMIT_DEFAULT > kernel option or by setting > net.inet.tcp.fastopen_ccache_bucket_limit in the > loader(8). the `net.inet.tcp.fastopen.ccache_bucket_limit` should be able to tuned the value. Steps to repeat: ``` # echo "net.inet.tcp.fastopen.ccache_bucket_limit=32" >> /boot/loader.conf # reboot .... # sysctl net.inet.tcp.fastopen.ccache_bucket_limit 16 ``` Expected value: ``` # sysctl net.inet.tcp.fastopen.ccache_bucket_limit 32 ```
Setting it in /etc/sysctl.conf works, right? The following should work too: # sysctl net.inet.tcp.fastopen.ccache_bucket_limit=32
(In reply to Herbert J. Skuhra from comment #1) > Setting it in /etc/sysctl.conf works, right? Yes. > The following should work too: > # sysctl net.inet.tcp.fastopen.ccache_bucket_limit=32 Yes.
Proposed fix, quite simple. https://reviews.freebsd.org/D41691
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=224aec05e732bb97a0d3c91142973b98a91238d1 commit 224aec05e732bb97a0d3c91142973b98a91238d1 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2023-09-02 20:34:07 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2023-09-02 20:34:07 +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 sys/netinet/tcp_fastopen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
A commit in branch stable/14 references this bug: 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(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3fc299d68897a0748d96510de5f191f5a8249216 commit 3fc299d68897a0748d96510de5f191f5a8249216 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: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(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=aadedc5b3e4b360513f2a950135059ca01035202 commit aadedc5b3e4b360513f2a950135059ca01035202 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:32:56 +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) (cherry picked from commit 3fc299d68897a0748d96510de5f191f5a8249216) sys/netinet/tcp_fastopen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Fixed.