From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 04:59:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4CB0C62; Fri, 22 Nov 2013 04:59:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4E9527BD; Fri, 22 Nov 2013 04:59:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM4xHNa019594; Fri, 22 Nov 2013 04:59:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM4xHSJ019593; Fri, 22 Nov 2013 04:59:17 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311220459.rAM4xHSJ019593@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 22 Nov 2013 04:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258464 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 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, 22 Nov 2013 04:59:17 -0000 Author: luigi Date: Fri Nov 22 04:59:17 2013 New Revision: 258464 URL: http://svnweb.freebsd.org/changeset/base/258464 Log: more support for userspace compiling of this code: emulate the uma_zone for dynamic rules. Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 22 04:57:50 2013 (r258463) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 22 04:59:17 2013 (r258464) @@ -181,6 +181,13 @@ static VNET_DEFINE(u_int32_t, dyn_max); #define DYN_COUNT uma_zone_get_cur(V_ipfw_dyn_rule_zone) #define V_dyn_max VNET(dyn_max) +/* for userspace, we emulate the uma_zone_counter with ipfw_dyn_count */ +static int ipfw_dyn_count; /* number of objects */ + +#ifdef USERSPACE /* emulation of UMA object counters for userspace */ +#define uma_zone_get_cur(x) ipfw_dyn_count +#endif /* USERSPACE */ + static int last_log; /* Log ratelimiting */ static void ipfw_dyn_tick(void *vnetx); @@ -579,6 +586,7 @@ add_dyn_rule(struct ipfw_flow_id *id, in } return NULL; } + ipfw_dyn_count++; /* * refcount on parent is already incremented, so @@ -1253,11 +1261,13 @@ check_dyn_rules(struct ip_fw_chain *chai for (q = exp_head; q != NULL; q = q_next) { q_next = q->next; uma_zfree(V_ipfw_dyn_rule_zone, q); + ipfw_dyn_count--; } for (q = exp_lhead; q != NULL; q = q_next) { q_next = q->next; uma_zfree(V_ipfw_dyn_rule_zone, q); + ipfw_dyn_count--; } /*