Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Nov 2008 07:03:05 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r185020 - user/kmacy/HEAD_fast_multi_xmit/sys/netinet
Message-ID:  <200811170703.mAH735xT075818@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811170703.mAH735xT075818>