diff options
author | kmacy <kmacy@FreeBSD.org> | 2009-04-19 04:44:05 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2009-04-19 04:44:05 +0000 |
commit | 96ce69a748787b032fef633aec21d684b2eefe8a (patch) | |
tree | df39cf96cca8e7716158c26f1fa8e64dc725144e /sys/netinet/ip_input.c | |
parent | 2160bcc98c432a34104be13d4b41316bb8da6338 (diff) | |
download | FreeBSD-src-96ce69a748787b032fef633aec21d684b2eefe8a.zip FreeBSD-src-96ce69a748787b032fef633aec21d684b2eefe8a.tar.gz |
- Allocate a small flowtable in ip_input.c (changeable by tuneable)
- Use for accelerating ip_output
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 920d741..2db3afb 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -64,6 +64,7 @@ __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_systm.h> @@ -211,6 +212,11 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW, 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 +static int ip_output_flowtable_size = 2048; +TUNABLE_INT("net.inet.ip.output_flowtable_size", &ip_output_flowtable_size); +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"); /* * ipfw_ether and ipfw_bridge hooks. @@ -221,6 +227,7 @@ ip_dn_io_t *ip_dn_io_ptr = NULL; #ifdef VIMAGE_GLOBALS int fw_one_pass; #endif +struct flowtable *ip_ft; static void ip_freef(struct ipqhead *, struct ipq *); @@ -342,6 +349,8 @@ ip_init(void) ipintrq.ifq_maxlen = ipqmaxlen; mtx_init(&ipintrq.ifq_mtx, "ip_inq", NULL, MTX_DEF); netisr_register(NETISR_IP, ip_input, &ipintrq, 0); + + ip_ft = flowtable_alloc(ip_output_flowtable_size, FL_PCPU); } void |