From nobody Fri Nov 14 04:11:32 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 4d73c46LdDz6GrRk; Fri, 14 Nov 2025 04:11:32 +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 4d73c45W7Rz3G6f; Fri, 14 Nov 2025 04:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763093492; 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=UBeGZEp0UYVhFxMptUe5vfr+++i4R+1Cqmh8yAohSNo=; b=kIAoy4S+36l+SSItuIEoCms89a41xm/grsXL+JSgNyYFiYY5U+0+q5D8kjANTWO1iuAL0e Y2ac/+Yrh4PXmFPumcOIAy35w+cdw2iTYfFkBIa7ZvUJuTyN6zB+0MqTuMkKxc7QZW0hgx Yuns577Z+JyjpIkEaLQM0mqr9rbdrdJ994LH4IYZ5Z54/fE86dqYlft1gANqk1wBj9i1lJ mtQ4d8Kl3VoO3aDKdoZvz3j1n6tCHPXQUgYSuTrEauIwbrlFOBc0+esbEa77ADbqOcEk8I eVhFu0NHfKXsrTwJyBUbhANw3sVWHM4zOx4HKP9L2GrHp9nszyc2hcnFn1d6Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763093492; 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=UBeGZEp0UYVhFxMptUe5vfr+++i4R+1Cqmh8yAohSNo=; b=rqeXIOZQqcuk3gfCWv3+SouOROpOJcc5rvKyqIckZEhjybflwJNgylpMLnfbhBGx7yNk5p 1iy9MdMzhTJlmxZ7qZphKnJD996hp41FLpRB3ngTNVvjyUMEZKBq4dTfQJZE9OU+lqlSFV F5Qu5DzaxKUHI7tcUOWrhCrxhebEKLHBYUA8pWgq+okybliITH0GvOlhbOu8La/W1GLVF7 gYa4DeXqcgrNluk+nOdvVkhIRq6OHW5Im/axh7Ak1W+NVAnuPiAaHl2oKINbApNpKU8A9/ 7kDlmBY6hjNm/yjJAoO9q7/w//CWBy5/h1oGMSWcM6r34oa8ztMfTnleVyZzLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763093492; a=rsa-sha256; cv=none; b=spDXW+jtzZqBLvFeRLrQyXsLsZfsScLlh3zGczzvPHq+ROTseWXnMa2GKsd6MoV066q+eI AA6i5ztRpC0+uu7rKXYKt4/vVMHZrxxapVsYVkfdq8kfpGwnBrJJPN4eeclI74UDHqPgtV x1/lD/SHCpcWTcEb7mot8cfP19h0NUHf73h0MKRWE4+yyxSaeEj3wMsOiuW9iEp+LVOU64 o6hh8OSSUYz5OqJTUvgH0tUKXqYhOzImt9Vuc+Z/cNiMjPExRnPiXa3QpHaYU3bmWkzVWS g6MHrGDLna0W8w9tT6s8UBcsJfPjcajREN5EGv349ZYAsQe2/KSNJ6oJzuM5Jw== 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 4d73c44zK7zrXR; Fri, 14 Nov 2025 04:11:32 +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 5AE4BWsw083643; Fri, 14 Nov 2025 04:11:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5AE4BWuW083640; Fri, 14 Nov 2025 04:11:32 GMT (envelope-from git) Date: Fri, 14 Nov 2025 04:11:32 GMT Message-Id: <202511140411.5AE4BWuW083640@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: 3b38b65cd03a - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 3b38b65cd03afafb9e34a1e92af62eb6727efeac Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=3b38b65cd03afafb9e34a1e92af62eb6727efeac commit 3b38b65cd03afafb9e34a1e92af62eb6727efeac Author: Cy Schubert AuthorDate: 2025-10-22 22:51:43 +0000 Commit: Cy Schubert CommitDate: 2025-11-14 04:11:15 +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 be5b71d9f6d4..4c191cf71b18 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); }