svn commit: r185020 - user/kmacy/HEAD_fast_multi_xmit/sys/netinet

Kip Macy kmacy at FreeBSD.org
Sun Nov 16 23:03:05 PST 2008


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


More information about the svn-src-user mailing list