From owner-svn-src-all@freebsd.org Sun Aug 5 13:54:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E6F01053809; Sun, 5 Aug 2018 13:54:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 311579069A; Sun, 5 Aug 2018 13:54:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 111111F264; Sun, 5 Aug 2018 13:54:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75DsbRv044202; Sun, 5 Aug 2018 13:54:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75DsbeH044200; Sun, 5 Aug 2018 13:54:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808051354.w75DsbeH044200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 5 Aug 2018 13:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337350 - in head: share/man/man4 sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: share/man/man4 sys/net X-SVN-Commit-Revision: 337350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 13:54:38 -0000 Author: kp Date: Sun Aug 5 13:54:37 2018 New Revision: 337350 URL: https://svnweb.freebsd.org/changeset/base/337350 Log: pf: Increase default hash table size Now that we (by default) limit the number of states to 100.000 it makse sense to also adjust the default size of the hash table. Based on the benchmarking results in https://github.com/ocochard/netbenches/blob/master/Atom_C2758_8Cores-Chelsio_T540-CR/pf-states_hashsize/results/fbsd12-head.r332390/README.md 128K entries offers a good compromise between performance and memory use. Users may still overrule this setting with the net.pf.states_hashsize and net.pf.source_nodes_hashsize loader(8) tunables. Modified: head/share/man/man4/pf.4 head/sys/net/pfvar.h Modified: head/share/man/man4/pf.4 ============================================================================== --- head/share/man/man4/pf.4 Sun Aug 5 11:15:28 2018 (r337349) +++ head/share/man/man4/pf.4 Sun Aug 5 13:54:37 2018 (r337350) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 14, 2013 +.Dd August 5, 2018 .Dt PF 4 .Os .Sh NAME @@ -84,11 +84,11 @@ tunables are available. .It Va net.pf.states_hashsize Size of hash tables that store states. Should be power of 2. -Default value is 32768. +Default value is 131072. .It Va net.pf.source_nodes_hashsize Size of hash table that store source nodes. Should be power of 2. -Default value is 8192. +Default value is 32768. .El .Pp Read only Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sun Aug 5 11:15:28 2018 (r337349) +++ head/sys/net/pfvar.h Sun Aug 5 13:54:37 2018 (r337350) @@ -1470,7 +1470,7 @@ struct pf_idhash { extern u_long pf_hashmask; extern u_long pf_srchashmask; -#define PF_HASHSIZ (32768) +#define PF_HASHSIZ (131072) #define PF_SRCHASHSIZ (PF_HASHSIZ/4) VNET_DECLARE(struct pf_keyhash *, pf_keyhash); VNET_DECLARE(struct pf_idhash *, pf_idhash);