From nobody Fri Nov 14 04:10:33 2025 X-Original-To: dev-commits-src-branches@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 4d73Zx3Xj1z6Gr8C; Fri, 14 Nov 2025 04:10:33 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d73Zx1k7Bz3DKr; Fri, 14 Nov 2025 04:10:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763093433; 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=bae9ECVWQP+muPDbEIEAbJOomSi4+bB9CeUoCRNunlI=; b=BPaoMwwCYo9nVb6NLnN2fkDbI8FcMjQhz95pGnLb+qWPb9LfITX4UaH+hxo54PjGpk5hsG A7R3HwmqHuQoaFxdyBTVzFzL68B+SNsMn23yh7193lHVifCeB9JHJRWqUcDpwLb/+/yyIX Lxea6LLym7IYfROqhnWzx7vs+dAp7lbdfHhCXS2PHbMsbveLBgk1XfciEcD6lnF4a/0Y+P X3OnuqB7ARQRIusgq+h9tFj1TVWDmCeurWuAylperJS7qY8kgaXvglRM6AQE44+474FX/f OXIlqNH6NFJRSNv3Hvsn+c4Rn3zgjfceo+6XEgErpFM/w1H/bqmnU7+/7OAttA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763093433; 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=bae9ECVWQP+muPDbEIEAbJOomSi4+bB9CeUoCRNunlI=; b=EgM7FoG3EGmZJD1ZmxTrUOgRWUt0gUSGs//tXQf4gO6mvX04/FtwH+ujHQCF2LmucuPlNi jovDws/Hcujr06VUAHQSZ4qI1VO5QIafemE9B558mOIwFDGT0tvso2Ax6M+JzWHXgLC/ZY ruWfkyQZYBRXWtovd+bBbAJnpV0j0O3HO7H2Nv4BpzvLlqbBdmoVvYEDA6nn4mi7pbfEit 6KwEQ078Y08BmQ1DQw4xQ8vEqCX1FUimFJW3aN5MR9U/Pp0rNvTa+fAvUt7yKzzEPXZPYE cxyULelcEdBjq4VIYyFLRehbM92TB8OWt4UfvxngIvJy4uyJ22l+siAt8+YiIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763093433; a=rsa-sha256; cv=none; b=dfv6nhjxPcUGqYXv/uZW9+6jSOH1cC41BlfH2banbrLeJSkzZ7xG+/RskKHKjf3ImuZnqi pEByjRg29FXJowFx0jdPwxFgV1GcGXysEMTEuIxjnFW1A4osdb1+a2tLPW+J5HrrY3KAS5 LsiWzacXCZ9HtdP6dd7kwYPudfbBLvExjEbjJ5Iv7pdp27rN3mMcmjyM4FtwzoJRyiMp/w Sjh2xFwsbb6XPMiq+luQUu6aV5fusqOtdLW83wk0LByZn2I5wtmshim4gPUxGTfRG+hlvV BCNhFBFoKX/VMuJTWZeuPFOBzBTMm2GZgosTXd6q6Z4exy8LP5SGHD/A6mfeSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4d73Zx19DNzr0l; Fri, 14 Nov 2025 04:10:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5AE4AXa5082060; Fri, 14 Nov 2025 04:10:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5AE4AXjT082057; Fri, 14 Nov 2025 04:10:33 GMT (envelope-from git) Date: Fri, 14 Nov 2025 04:10:33 GMT Message-Id: <202511140410.5AE4AXjT082057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 3e9e5177af1f - stable/15 - ipfilter: Add htable (hash table) tunable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3e9e5177af1f2ffba234e2fdeef444198271d103 Auto-Submitted: auto-generated The branch stable/15 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=3e9e5177af1f2ffba234e2fdeef444198271d103 commit 3e9e5177af1f2ffba234e2fdeef444198271d103 Author: Cy Schubert AuthorDate: 2025-10-22 22:51:43 +0000 Commit: Cy Schubert CommitDate: 2025-11-14 04:10:21 +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 3f765cfab947..9680017eb399 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -96,6 +96,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 = { @@ -122,6 +123,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 */ @@ -142,6 +151,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); } @@ -160,6 +181,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); }