From nobody Wed Nov 05 15:34:00 2025 X-Original-To: dev-commits-src-all@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 4d1q9h3vgmz6GTRY; Wed, 05 Nov 2025 15:34:00 +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 4d1q9h1jKKz3FXq; Wed, 05 Nov 2025 15:34:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762356840; 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=n2cnlPqAQCCZfCM4a4cSNSRboKae4zUGSv3dV2jBzTM=; b=VXiol3rkGk08ml7Eg6QfLt/pNq59yyf58WvoxW9GAc5o7Yq8tu7Lwxapwzm5LmlSPtULKo UgGqR+w/VcSPH+zFlKQiXjXkca0tXHYX55Tz/Az5roCWXdGt1KpN97Pof0ZizHVuthqB0H GA/5H/Rs5RwZMirAg8Z5J+IN1oM/sY9fyRCSNOtV1FA1eypIXG1LYEeoaXhwC67octSrWH x1G/820nfei+bpcKWFwwRszIwN/Ieo2SZSzvdQPDtYuMeyi3C8J2TmNWvRbFzqjGoXJfN+ ZNptGcS8YzJmTCnDuajEC52BRZvLTZyFSL+63n/xEqy9cu2+Zoxf7Att2lTu8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762356840; 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=n2cnlPqAQCCZfCM4a4cSNSRboKae4zUGSv3dV2jBzTM=; b=BvuSIUjTZqtR7RlVgv5fKuJeFAatnRzMNNWNZdpGiiaDcv8IxDCeY5O+oZpkQ58WqISyt3 0EQ4zvelwc07rm+7bgGYB2TtIYX/XEVC2U71XsSNyPNq6ffiNrl6B7RboAUeRU1Ezy/MtD nQ77pp0E24cSuxyt/has8aY4hRlfXTohBBhTHDGbYLWi/ABC8bss9f3l1S7NatRMhZ8H8K E37Vv1p3vN/h+3hzdNMdI8Bkk9WVRlLEwpnCk060EE0ND47XhV6dsP514W53HAKqhFszSZ nsZg5PNi6E0MSl971Cvbyod8a+xMUdMGYOnGYWC2n38CmrEpncZZ+zDTZC6WWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1762356840; a=rsa-sha256; cv=none; b=LqqaInJYVfD+AL+AdLZ39w9Lqs6dDZuNyTlOewEDIt5owCkoNvSHK39nbKJRvsS+DY4Ka5 vwB8LyEKfwDQu//jSn3Y6qf8+FlsQQnc6h7vw03wYmEs/PC28qxVpzGpq18VuRFiP8mWYI 3l0l2bNIbqjpEJDvE5/TBfnOplF/eQhzdEnq3pjE0qKLa5q9kuLKgf3F4Wmh9+/yQ0x8kC 4SRwCDM4jk82OuNMKBi3g3jmEwy/6jP8hpWYRHtd3hBmX2qRyqqY97YLnlmj0xxqOVsrlu wOdX04i+FwsoQvvXjpa7RrWrSmCZqHDWvBbq4IrHVtwLkbbyY4x7684pUq7slw== 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 4d1q9h1BkHzpyQ; Wed, 05 Nov 2025 15:34:00 +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 5A5FY0Jl033243; Wed, 5 Nov 2025 15:34:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5A5FY064033240; Wed, 5 Nov 2025 15:34:00 GMT (envelope-from git) Date: Wed, 5 Nov 2025 15:34:00 GMT Message-Id: <202511051534.5A5FY064033240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: c57262716b08 - main - ipfilter: Add htable (hash table) tunable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: c57262716b08717b6a9c5533941d4e0a2d180d46 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c57262716b08717b6a9c5533941d4e0a2d180d46 commit c57262716b08717b6a9c5533941d4e0a2d180d46 Author: Cy Schubert AuthorDate: 2025-10-22 22:51:43 +0000 Commit: Cy Schubert CommitDate: 2025-11-05 15:32:16 +0000 ipfilter: Add htable (hash table) tunable This is in preparation for addition of a hash table max size. Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53283 --- 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); }