Date: Fri, 14 Nov 2025 04:12:13 GMT From: Cy Schubert <cy@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 2e1364183020 - stable/13 - ipfilter: Add htable (hash table) tunable Message-ID: <202511140412.5AE4CDWn086923@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2e13641830206eeddcf3547094d5da7ce47e0a87 commit 2e13641830206eeddcf3547094d5da7ce47e0a87 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2025-10-22 22:51:43 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2025-11-12 04:02:31 +0000 ipfilter: Add htable (hash table) tunable This is in preparation for addition of a hash table max size. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D53283 (cherry picked from commit c57262716b08717b6a9c5533941d4e0a2d180d46) --- sys/netpfil/ipfilter/netinet/ip_htable.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c index b56909a02bc3..80f916b6e509 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -99,6 +99,7 @@ typedef struct ipf_htable_softc_s { u_long ipf_nhtnodes[LOOKUP_POOL_SZ]; iphtable_t *ipf_htables[LOOKUP_POOL_SZ]; iphtent_t *ipf_node_explist; + ipftuneable_t *ipf_htable_tune; } ipf_htable_softc_t; ipf_lookup_t ipf_htable_backend = { @@ -125,6 +126,14 @@ ipf_lookup_t ipf_htable_backend = { }; +static ipftuneable_t ipf_htable_tuneables[] = { + { { NULL }, + NULL, 0, 0, + 0, + 0, NULL, NULL } +}; + + /* ------------------------------------------------------------------------ */ /* Function: ipf_htable_soft_create */ /* Returns: void * - NULL = failure, else pointer to local context */ @@ -145,6 +154,18 @@ ipf_htable_soft_create(ipf_main_softc_t *softc) bzero((char *)softh, sizeof(*softh)); + softh->ipf_htable_tune = ipf_tune_array_copy(softh, + sizeof(ipf_htable_tuneables), + ipf_htable_tuneables); + if (softh->ipf_htable_tune == NULL) { + ipf_htable_soft_destroy(softc, softh); + return (NULL); + } + if (ipf_tune_array_link(softc, softh->ipf_htable_tune) == -1) { + ipf_htable_soft_destroy(softc, softh); + return (NULL); + } + return (softh); } @@ -163,6 +184,12 @@ ipf_htable_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_htable_softc_t *softh = arg; + if (softh->ipf_htable_tune != NULL) { + ipf_tune_array_unlink(softc, softh->ipf_htable_tune); + KFREES(softh->ipf_htable_tune, sizeof(ipf_htable_tuneables)); + softh->ipf_htable_tune = NULL; + } + KFREE(softh); }home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202511140412.5AE4CDWn086923>
