From owner-p4-projects@FreeBSD.ORG Mon Jun 22 13:04:24 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 390561065672; Mon, 22 Jun 2009 13:04:24 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED822106566C for ; Mon, 22 Jun 2009 13:04:23 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D2E1E8FC15 for ; Mon, 22 Jun 2009 13:04:23 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5MD4NHX007659 for ; Mon, 22 Jun 2009 13:04:23 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5MD4N7H007657 for perforce@freebsd.org; Mon, 22 Jun 2009 13:04:23 GMT (envelope-from zec@fer.hr) Date: Mon, 22 Jun 2009 13:04:23 GMT Message-Id: <200906221304.n5MD4N7H007657@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 164850 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2009 13:04:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=164850 Change 164850 by zec@zec_amdx4 on 2009/06/22 13:03:35 Catch up with flowtable globals in sys/netinet. Pointed out by: bz Affected files ... .. //depot/projects/vimage-commit2/src/sys/net/flowtable.h#6 edit .. //depot/projects/vimage-commit2/src/sys/netinet/ip_input.c#44 edit .. //depot/projects/vimage-commit2/src/sys/netinet/ip_output.c#32 edit .. //depot/projects/vimage-commit2/src/sys/netinet/vinet.h#34 edit Differences ... ==== //depot/projects/vimage-commit2/src/sys/net/flowtable.h#6 (text+ko) ==== @@ -38,7 +38,9 @@ #define FL_PCPU (1<<1) /* pcpu cache */ struct flowtable; +#ifdef VIMAGE_GLOBALS extern struct flowtable *ip_ft; +#endif struct flowtable *flowtable_alloc(int nentry, int flags); ==== //depot/projects/vimage-commit2/src/sys/netinet/ip_input.c#44 (text+ko) ==== @@ -207,13 +207,13 @@ 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 @@ NULL, UMA_ALIGN_PTR, 0); maxnipq_update(); +#ifdef FLOWTABLE + TUNABLE_INT_FETCH("net.inet.ip.output_flowtable_size", + &V_ip_output_flowtable_size); + V_ip_output_flowtable_size = 2048; + 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 @@ /* 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 ==== //depot/projects/vimage-commit2/src/sys/netinet/ip_output.c#32 (text+ko) ==== @@ -162,7 +162,7 @@ * longer than that long for the stability of ro_rt. The * flow ID assignment must have happened before this point. */ - if (flowtable_lookup(ip_ft, m, ro) == 0) + if (flowtable_lookup(V_ip_ft, m, ro) == 0) nortfree = 1; #endif } ==== //depot/projects/vimage-commit2/src/sys/netinet/vinet.h#34 (text+ko) ==== @@ -212,6 +212,8 @@ int _icmpbmcastecho; int _fw_one_pass; + + struct flowtable * _ip_ft; }; /* Size guard. See sys/vimage.h. */ @@ -272,9 +274,11 @@ #define V_ip_checkinterface VNET_INET(ip_checkinterface) #define V_ip_defttl VNET_INET(ip_defttl) #define V_ip_do_randomid VNET_INET(ip_do_randomid) +#define V_ip_ft VNET_INET(ip_ft) #define V_ip_id VNET_INET(ip_id) #define V_ip_keepfaith VNET_INET(ip_keepfaith) #define V_ip_mrouter VNET_INET(ip_mrouter) +#define V_ip_output_flowtable_size VNET_INET(ip_output_flowtable_size) #define V_ip_rsvp_on VNET_INET(ip_rsvp_on) #define V_ip_rsvpd VNET_INET(ip_rsvpd) #define V_ip_sendsourcequench VNET_INET(ip_sendsourcequench)