summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2010-01-07 13:53:47 +0000
committerluigi <luigi@FreeBSD.org>2010-01-07 13:53:47 +0000
commit51e5ccee248ecda1afa0003b24f5e0da1d00a496 (patch)
treec6975c4e8ec9d38bd194ebba049cbae9649a1217 /sys/netinet
parentfe8ccb0bf3097cfe7df2a8e79774b7d216993368 (diff)
downloadFreeBSD-src-51e5ccee248ecda1afa0003b24f5e0da1d00a496.zip
FreeBSD-src-51e5ccee248ecda1afa0003b24f5e0da1d00a496.tar.gz
we don't use dummynet_drain!
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ipfw/ip_dummynet.c37
1 files changed, 5 insertions, 32 deletions
diff --git a/sys/netinet/ipfw/ip_dummynet.c b/sys/netinet/ipfw/ip_dummynet.c
index a6c14a8..267776f 100644
--- a/sys/netinet/ipfw/ip_dummynet.c
+++ b/sys/netinet/ipfw/ip_dummynet.c
@@ -103,7 +103,7 @@ static int red_lookup_depth = 256; /* RED - default lookup table depth */
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 *sopt);
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, struct dn_pipe *p)
}
/*
- * 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
OpenPOWER on IntegriCloud