Date: Fri, 12 Jun 2009 20:46:36 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r194076 - in head/sys: net netinet Message-ID: <200906122046.n5CKkawj092445@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Fri Jun 12 20:46:36 2009 New Revision: 194076 URL: http://svn.freebsd.org/changeset/base/194076 Log: Move the kernel option FLOWTABLE chacking from the header file to the actual implementation. Remove the accessor functions for the compiled out case, just returning "unavail" values. Remove the kernel conditional from the header file as it is no longer needed, only leaving the externs. Hide the improperly virtualized SYSCTL/TUNABLE for the flowtable size under the kernel option as well. Reviewed by: rwatson Modified: head/sys/net/flowtable.h head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c Modified: head/sys/net/flowtable.h ============================================================================== --- head/sys/net/flowtable.h Fri Jun 12 20:41:44 2009 (r194075) +++ head/sys/net/flowtable.h Fri Jun 12 20:46:36 2009 (r194076) @@ -41,7 +41,6 @@ struct flowtable; extern struct flowtable *ip_ft; extern struct flowtable *ip_forward_ft; -#ifdef FLOWTABLE struct flowtable *flowtable_alloc(int nentry, int flags); /* @@ -52,22 +51,6 @@ struct flowtable *flowtable_alloc(int ne int flowtable_lookup(struct flowtable *ft, struct mbuf *m, struct route *ro); -#else -static __inline struct flowtable * -flowtable_alloc(int nentry, int flags) -{ - - return (NULL); -} - -static __inline int -flowtable_lookup(struct flowtable *ft, struct mbuf *m, - struct route *ro) -{ - - return (ENOTSUP); -} -#endif #endif #endif Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Jun 12 20:41:44 2009 (r194075) +++ head/sys/netinet/ip_input.c Fri Jun 12 20:46:36 2009 (r194076) @@ -206,16 +206,19 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, m 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); 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 int fw_one_pass; #endif -struct flowtable *ip_ft; static void ip_freef(struct ipqhead *, struct ipq *); @@ -374,7 +377,9 @@ 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 Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Jun 12 20:41:44 2009 (r194075) +++ head/sys/netinet/ip_output.c Fri Jun 12 20:46:36 2009 (r194076) @@ -155,6 +155,7 @@ ip_output(struct mbuf *m, struct mbuf *o ro = &iproute; bzero(ro, sizeof (*ro)); +#ifdef FLOWTABLE /* * The flow table returns route entries valid for up to 30 * seconds; we rely on the remainder of ip_output() taking no @@ -163,6 +164,7 @@ ip_output(struct mbuf *m, struct mbuf *o */ if (flowtable_lookup(ip_ft, m, ro) == 0) nortfree = 1; +#endif } if (opt) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906122046.n5CKkawj092445>