From owner-svn-src-user@FreeBSD.ORG  Mon Nov 17 07:03:05 2008
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D7114106564A;
	Mon, 17 Nov 2008 07:03:05 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8E7428FC16;
	Mon, 17 Nov 2008 07:03:05 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAH735qE075819;
	Mon, 17 Nov 2008 07:03:05 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAH735xT075818;
	Mon, 17 Nov 2008 07:03:05 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200811170703.mAH735xT075818@svn.freebsd.org>
From: Kip Macy <kmacy@FreeBSD.org>
Date: Mon, 17 Nov 2008 07:03:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r185020 - user/kmacy/HEAD_fast_multi_xmit/sys/netinet
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
	src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
	<mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
	<mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 17 Nov 2008 07:03:05 -0000

Author: kmacy
Date: Mon Nov 17 07:03:05 2008
New Revision: 185020
URL: http://svn.freebsd.org/changeset/base/185020

Log:
  Make ipv4 pcpu and global flowtable size tunables

Modified:
  user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_input.c

Modified: user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_input.c
==============================================================================
--- user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_input.c	Mon Nov 17 05:19:18 2008	(r185019)
+++ user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_input.c	Mon Nov 17 07:03:05 2008	(r185020)
@@ -206,6 +206,23 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet
     ipstealth, 0, "IP stealth mode, no TTL decrementation on forwarding");
 #endif
 
+static int ipv4_pcpu_flowtable_size = 2048;
+TUNABLE_INT("net.inet.ip.pcpu_flowtable_size", &ipv4_pcpu_flowtable_size);
+SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, pcpu_flowtable_size,
+    CTLFLAG_RDTUN, ipv4_pcpu_flowtable_size, 0,
+    "number of entries in the per cpu flow caches");
+
+#ifdef RADIX_MPATH
+static int ipv4_global_flowtable_size = 128*1024;
+#else
+static int ipv4_global_flowtable_size = 16*1024;
+#endif
+TUNABLE_INT("net.inet.ip.global_flowtable_size", &ipv4_global_flowtable_size);
+SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, global_flowtable_size,
+    CTLFLAG_RDTUN, ipv4_global_flowtable_size, 0,
+    "number of entries in the global flow cache");
+
+
 /*
  * ipfw_ether and ipfw_bridge hooks.
  * XXX: Temporary until those are converted to pfil_hooks as well.
@@ -216,7 +233,6 @@ int fw_one_pass = 1;
 struct flowtable *ipv4_ft;
 struct flowtable *ipv4_forward_ft;
 
-
 static void	ip_freef(struct ipqhead *, struct ipq *);
 
 /*
@@ -283,13 +299,8 @@ ip_init(void)
 	mtx_init(&ipintrq.ifq_mtx, "ip_inq", NULL, MTX_DEF);
 	netisr_register(NETISR_IP, ip_input, &ipintrq, 0);
 	
-	ipv4_ft = flowtable_alloc(2048, FL_PCPU);
-#ifdef RADIX_MPATH
-	ipv4_forward_ft = flowtable_alloc(128*1024, FL_HASH_PORTS);
-#else
-	ipv4_forward_ft = flowtable_alloc(16*1024, 0);
-#endif	
-	
+	ipv4_ft = flowtable_alloc(ipv4_pcpu_flowtable_size, FL_PCPU);
+	ipv4_forward_ft = flowtable_alloc(ipv4_global_flowtable_size, FL_HASH_PORTS);
 }
 
 void