summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2009-06-22 21:19:24 +0000
committerzec <zec@FreeBSD.org>2009-06-22 21:19:24 +0000
commitf9dfbad808b360c76d6758d52b8cdd230ed209e1 (patch)
tree82b7de4346c9dc5cba59fc6c6598c708372a0dec /sys/netinet/ip_input.c
parent303ceb983fcbf7df5d24a0c5ed5819aa5a01049a (diff)
downloadFreeBSD-src-f9dfbad808b360c76d6758d52b8cdd230ed209e1.zip
FreeBSD-src-f9dfbad808b360c76d6758d52b8cdd230ed209e1.tar.gz
V_irtualize flowtable state.
This change should make options VIMAGE kernel builds usable again, to some extent at least. Note that the size of struct vnet_inet has changed, though in accordance with one-bump-per-day policy we didn't update the __FreeBSD_version number, given that it has already been touched by r194640 a few hours ago. Reviewed by: bz Approved by: julian (mentor)
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 6af99b1..8642e31 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -207,13 +207,13 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, stealth, CTLFLAG_RW,
ipstealth, 0, "IP stealth mode, no TTL decrementation on forwarding");
#endif
#ifdef FLOWTABLE
-static int ip_output_flowtable_size = 2048;
-TUNABLE_INT("net.inet.ip.output_flowtable_size", &ip_output_flowtable_size);
+#ifdef VIMAGE_GLOBALS
+static int ip_output_flowtable_size;
+struct flowtable *ip_ft;
+#endif
SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, output_flowtable_size,
CTLFLAG_RDTUN, ip_output_flowtable_size, 2048,
"number of entries in the per-cpu output flow caches");
-
-struct flowtable *ip_ft;
#endif
#ifdef VIMAGE_GLOBALS
@@ -335,6 +335,13 @@ ip_init(void)
NULL, UMA_ALIGN_PTR, 0);
maxnipq_update();
+#ifdef FLOWTABLE
+ V_ip_output_flowtable_size = 2048;
+ TUNABLE_INT_FETCH("net.inet.ip.output_flowtable_size",
+ &V_ip_output_flowtable_size);
+ V_ip_ft = flowtable_alloc(V_ip_output_flowtable_size, FL_PCPU);
+#endif
+
/* Skip initialization of globals for non-default instances. */
if (!IS_DEFAULT_VNET(curvnet))
return;
@@ -377,9 +384,6 @@ ip_init(void)
/* Initialize various other remaining things. */
IPQ_LOCK_INIT();
netisr_register(&ip_nh);
-#ifdef FLOWTABLE
- ip_ft = flowtable_alloc(ip_output_flowtable_size, FL_PCPU);
-#endif
}
void
OpenPOWER on IntegriCloud