summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-02-07 15:18:23 +0000
committerglebius <glebius@FreeBSD.org>2014-02-07 15:18:23 +0000
commit9d7706f9f4506fb689de9cbadb4452174b30d194 (patch)
tree4df8f4b91b7dcda62a93b6621f4da6c21c55ae5a /sys/netinet
parentc82f5e592c269547df815f28d9667eed62ad7dc1 (diff)
downloadFreeBSD-src-9d7706f9f4506fb689de9cbadb4452174b30d194.zip
FreeBSD-src-9d7706f9f4506fb689de9cbadb4452174b30d194.tar.gz
o Revamp API between flowtable and netinet, netinet6.
- ip_output() and ip_output6() simply call flowtable_lookup(), passing mbuf and address family. That's the only code under #ifdef FLOWTABLE in the protocols code now. o Revamp statistics gathering and export. - Remove hand made pcpu stats, and utilize counter(9). - Snapshot of statistics is available via 'netstat -rs'. - All sysctls are moved into net.flowtable namespace, since spreading them over net.inet isn't correct. o Properly separate at compile time INET and INET6 parts. o General cleanup. - Remove chain of multiple flowtables. We simply have one for IPv4 and one for IPv6. - Flowtables are allocated in flowtable.c, symbols are static. - With proper argument to SYSINIT() we no longer need flowtable_ready. - Hash salt doesn't need to be per-VNET. - Removed rudimentary debugging, which use quite useless in dtrace era. The runtime behavior of flowtable shouldn't be changed by this commit. Sponsored by: Netflix Sponsored by: Nginx, Inc.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_input.c29
-rw-r--r--sys/netinet/ip_output.c3
2 files changed, 2 insertions, 30 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 01ec617..900f5d8 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$");
#include <net/route.h>
#include <net/netisr.h>
#include <net/vnet.h>
-#include <net/flowtable.h>
#include <netinet/in.h>
#include <netinet/in_kdtrace.h>
@@ -197,16 +196,6 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, stealth, CTLFLAG_RW,
"IP stealth mode, no TTL decrementation on forwarding");
#endif
-#ifdef FLOWTABLE
-static VNET_DEFINE(int, ip_output_flowtable_size) = 2048;
-VNET_DEFINE(struct flowtable *, ip_ft);
-#define V_ip_output_flowtable_size VNET(ip_output_flowtable_size)
-
-SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, output_flowtable_size, CTLFLAG_RDTUN,
- &VNET_NAME(ip_output_flowtable_size), 2048,
- "number of entries in the per-cpu output flow caches");
-#endif
-
static void ip_freef(struct ipqhead *, struct ipq *);
/*
@@ -308,24 +297,6 @@ ip_init(void)
printf("%s: WARNING: unable to register pfil hook, "
"error %d\n", __func__, i);
-#ifdef FLOWTABLE
- if (TUNABLE_INT_FETCH("net.inet.ip.output_flowtable_size",
- &V_ip_output_flowtable_size)) {
- if (V_ip_output_flowtable_size < 256)
- V_ip_output_flowtable_size = 256;
- if (!powerof2(V_ip_output_flowtable_size)) {
- printf("flowtable must be power of 2 size\n");
- V_ip_output_flowtable_size = 2048;
- }
- } else {
- /*
- * round up to the next power of 2
- */
- V_ip_output_flowtable_size = 1 << fls((1024 + maxusers * 64)-1);
- }
- V_ip_ft = flowtable_alloc("ipv4", V_ip_output_flowtable_size, FL_PCPU);
-#endif
-
/* Skip initialization of globals for non-default instances. */
if (!IS_DEFAULT_VNET(curvnet))
return;
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index ee10fdc..c72ff7d 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -32,6 +32,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_inet.h"
#include "opt_ipfw.h"
#include "opt_ipsec.h"
#include "opt_mbuf_stress_test.h"
@@ -162,7 +163,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
* longer than that long for the stability of ro_rt. The
* flow ID assignment must have happened before this point.
*/
- fle = flowtable_lookup_mbuf(V_ip_ft, m, AF_INET);
+ fle = flowtable_lookup(AF_INET, m);
if (fle != NULL)
flow_to_route(fle, ro);
}
OpenPOWER on IntegriCloud