From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 13:53:47 2010 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 A5DAB1065692; Thu, 7 Jan 2010 13:53:47 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CD008FC15; Thu, 7 Jan 2010 13:53:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07DrltZ069395; Thu, 7 Jan 2010 13:53:47 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07Drl2F069393; Thu, 7 Jan 2010 13:53:47 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001071353.o07Drl2F069393@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 7 Jan 2010 13:53:47 +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: r201745 - head/sys/netinet/ipfw 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: Thu, 07 Jan 2010 13:53:47 -0000 Author: luigi Date: Thu Jan 7 13:53:47 2010 New Revision: 201745 URL: http://svn.freebsd.org/changeset/base/201745 Log: we don't use dummynet_drain! Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Thu Jan 7 13:42:28 2010 (r201744) +++ head/sys/netinet/ipfw/ip_dummynet.c Thu Jan 7 13:53:47 2010 (r201745) @@ -103,7 +103,7 @@ static int red_lookup_depth = 256; /* RE static int red_avg_pkt_size = 512; /* RED - default medium packet size */ static int red_max_pkt_size = 1500; /* RED - default max packet size */ -static struct timeval prev_t, t; +static struct timeval prev_t; static long tick_last; /* Last tick duration (usec). */ static long tick_delta; /* Last vs standard tick diff (usec). */ static long tick_delta_sum; /* Accumulated tick difference (usec).*/ @@ -239,7 +239,6 @@ static int ip_dn_ctl(struct sockopt *sop static void dummynet(void *); static void dummynet_flush(void); static void dummynet_send(struct mbuf *); -void dummynet_drain(void); static int dummynet_io(struct mbuf **, int , struct ip_fw_args *); /* @@ -851,7 +850,9 @@ dummynet(void * __unused unused) } /* - * The main dummynet processing function. + * The timer handler for dummynet. Time is computed in ticks, but + * but the code is tolerant to the actual rate at which this is called. + * Once complete, the function reschedules itself for the next tick. */ static void dummynet_task(void *context, int pending) @@ -862,6 +863,7 @@ dummynet_task(void *context, int pending struct dn_heap *h; void *p; /* generic parameter to handler */ int i; + struct timeval t; DUMMYNET_LOCK(); @@ -1955,35 +1957,6 @@ pipe_remove_from_heap(struct dn_heap *h, } /* - * drain all queues. Called in case of severe mbuf shortage. - */ -void -dummynet_drain(void) -{ - struct dn_flow_set *fs; - struct dn_pipe *pipe; - int i; - - DUMMYNET_LOCK_ASSERT(); - - heap_free(&ready_heap); - heap_free(&wfq_ready_heap); - heap_free(&extract_heap); - /* remove all references to this pipe from flow_sets */ - for (i = 0; i < HASHSIZE; i++) - SLIST_FOREACH(fs, &flowsethash[i], next) - purge_flow_set(fs, 0); - - for (i = 0; i < HASHSIZE; i++) { - SLIST_FOREACH(pipe, &pipehash[i], next) { - purge_flow_set(&(pipe->fs), 0); - dn_free_pkts(pipe->head); - pipe->head = pipe->tail = NULL; - } - } -} - -/* * Fully delete a pipe or a queue, cleaning up associated info. */ static int