From owner-svn-src-all@FreeBSD.ORG Fri Jun 12 20:46:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39A75106566C; Fri, 12 Jun 2009 20:46:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E62F8FC1F; Fri, 12 Jun 2009 20:46:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CKkbkw092448; Fri, 12 Jun 2009 20:46:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CKkawj092445; Fri, 12 Jun 2009 20:46:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906122046.n5CKkawj092445@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 12 Jun 2009 20:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194076 - in head/sys: net netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 20:46:37 -0000 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) {