From nobody Fri Nov 14 04:12:13 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 4d73ct4Wyhz6GrhK; Fri, 14 Nov 2025 04:12:14 +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 4d73ct0SdXz3H6g; Fri, 14 Nov 2025 04:12:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763093534; 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=es1saJ8znXbVo5Z0Yi4+Bwua/Ld3DaMA3kkV2F8GCuY=; b=cdRKbKKpuGO/5NYgCXinq5IHhCZUaQiDSmqhnQCQspDrxTjlTA0070o2VP4eLnNNDvQ5P+ uJyBHI/V51gS3grCrwgJ/D7HaoJUigPYq9YkjalxjC+9o9JILPg/U91VZOwnSHI6NCR7OK ERVh3uTWIl2WHLbWjBMh8XFmWHgvjWguCUmA662PHFN6hEjlPrk+E+c5f5dKAvt2KsI9wm l+4QxQItgBmVFgzI3wWjn6EhyC6LkvdNm5PBxWgSDBrI4M+LnSJuxw+vB3zfhpjvxU+lm2 h8cjcDfL2StM4+9iWek3VuSA4YR//onMYj1fZj8pdafIVPm1WKS9rtmZgHozeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763093534; 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=es1saJ8znXbVo5Z0Yi4+Bwua/Ld3DaMA3kkV2F8GCuY=; b=qb8oWtAOoP/mL0hmzPj7av+hiNxJQh9v782P21pVQG6nRUdCflHU/unL1E75AUiyjIyLnp 7m1tQCfxuC1bhlybMt3wqRg+5l0RRLWRwkkXedw62ExY6wdvrs1E1fC+yQHC+I7iizHPmX d7nyG/CT8abaFfCgxg5oTQeYH7uM1BW5QhqdhDTk9+Tj7KLbaqKLgAG17q88zzskDt0upF 6FI88Go/owh9bLnTnH+LfTWoKh/OlO8pnvSbjpEDsWf3uXAaCKEN42EuHG0OiplTlmAUX/ q53fnVeh5uFWlER6f+9OuaGuLBXt5w5OnmmV116tDWNem6AOR4NyX6zAfIRDAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763093534; a=rsa-sha256; cv=none; b=kzGyISDnLG93lMBq3Yboc3idsWH03HM5QAAWSNzcFqgw2xP/5G3DDD7b1DwNIjXMim/Hps 09AAL7/tsO5dZay7c4n7BUp+OFHxpdy+1wQTh1xyQDb5vjCaF7SF9gpD7Y8Q0FpdN/0KNq LFW6oElK2Fmj/XQOjUU6Tlq+AQJuP300NJKq0+Q88XA6rnXic8lmYa8iUB6vS2hSAs05Fq xg5iA7K3Sw1Zk+Epeqv3Y+aRXNcp9cZ0oDQKe2Y9wJAEmC63m3DmHdhwyYlDLhl6HMCuZ2 34DoRF4e0/vnZtmcK0sQ1z7oopCyEevP/YHkuvXq9iuAIvDJmsgCi5my61HSFQ== 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 4d73ct00q9zrm3; Fri, 14 Nov 2025 04:12:14 +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 5AE4CD4v086941; Fri, 14 Nov 2025 04:12:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5AE4CDWn086923; Fri, 14 Nov 2025 04:12:13 GMT (envelope-from git) Date: Fri, 14 Nov 2025 04:12:13 GMT Message-Id: <202511140412.5AE4CDWn086923@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: 2e1364183020 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 2e13641830206eeddcf3547094d5da7ce47e0a87 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2e13641830206eeddcf3547094d5da7ce47e0a87 commit 2e13641830206eeddcf3547094d5da7ce47e0a87 Author: Cy Schubert AuthorDate: 2025-10-22 22:51:43 +0000 Commit: Cy Schubert 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); }