diff options
author | luigi <luigi@FreeBSD.org> | 2010-09-29 09:40:20 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2010-09-29 09:40:20 +0000 |
commit | db4f2cdbdf7cdfd76c1872b095b0ef44d8f2b76d (patch) | |
tree | 77f95bb836e2290fc047defe9e0edf35925e0eae /sys/netinet | |
parent | 27b07fc73139e6943e19da7f4f40142d140074ee (diff) | |
download | FreeBSD-src-db4f2cdbdf7cdfd76c1872b095b0ef44d8f2b76d.zip FreeBSD-src-db4f2cdbdf7cdfd76c1872b095b0ef44d8f2b76d.tar.gz |
whitespace changes in preparation for future commits
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ipfw/dn_sched.h | 2 | ||||
-rw-r--r-- | sys/netinet/ipfw/dn_sched_wf2q.c | 2 | ||||
-rw-r--r-- | sys/netinet/ipfw/ip_dn_glue.c | 2 | ||||
-rw-r--r-- | sys/netinet/ipfw/ip_dn_io.c | 14 | ||||
-rw-r--r-- | sys/netinet/ipfw/ip_dummynet.c | 3 |
5 files changed, 15 insertions, 8 deletions
diff --git a/sys/netinet/ipfw/dn_sched.h b/sys/netinet/ipfw/dn_sched.h index b6bf24e..ab823fe 100644 --- a/sys/netinet/ipfw/dn_sched.h +++ b/sys/netinet/ipfw/dn_sched.h @@ -166,6 +166,8 @@ dn_dequeue(struct dn_queue *q) if (m == NULL) return NULL; q->mq.head = m->m_nextpkt; + + /* Update stats for the queue */ q->ni.length--; q->ni.len_bytes -= m->m_pkthdr.len; if (q->_si) { diff --git a/sys/netinet/ipfw/dn_sched_wf2q.c b/sys/netinet/ipfw/dn_sched_wf2q.c index 55a4955..7f16719 100644 --- a/sys/netinet/ipfw/dn_sched_wf2q.c +++ b/sys/netinet/ipfw/dn_sched_wf2q.c @@ -318,7 +318,7 @@ wf2qp_free_queue(struct dn_queue *q) { struct wf2qp_queue *alg_fq = (struct wf2qp_queue *)q; struct wf2qp_si *si = (struct wf2qp_si *)(q->_si + 1); - + if (alg_fq->S >= alg_fq->F + 1) return 0; /* nothing to do, not in any heap */ si->wsum -= q->fs->fs.par[0]; diff --git a/sys/netinet/ipfw/ip_dn_glue.c b/sys/netinet/ipfw/ip_dn_glue.c index a31ec1f..9a81912 100644 --- a/sys/netinet/ipfw/ip_dn_glue.c +++ b/sys/netinet/ipfw/ip_dn_glue.c @@ -1,4 +1,4 @@ -/*- +/*- * Copyright (c) 2010 Riccardo Panicucci, Universita` di Pisa * All rights reserved * diff --git a/sys/netinet/ipfw/ip_dn_io.c b/sys/netinet/ipfw/ip_dn_io.c index 162240d..52a0f9e 100644 --- a/sys/netinet/ipfw/ip_dn_io.c +++ b/sys/netinet/ipfw/ip_dn_io.c @@ -120,10 +120,6 @@ SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, io_fast, CTLFLAG_RW, DC(io_fast), 0, "Enable fast dummynet io."); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, debug, CTLFLAG_RW, DC(debug), 0, "Dummynet debug level"); -SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, expire, - CTLFLAG_RW, DC(expire), 0, "Expire empty queues/pipes"); -SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, expire_cycle, - CTLFLAG_RD, DC(expire_cycle), 0, "Expire cycle for queues/pipes"); /* RED parameters */ SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, red_lookup_depth, @@ -147,6 +143,12 @@ SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_lost, CTLFLAG_RD, &tick_lost, 0, "Number of ticks coalesced by dummynet taskqueue."); +/* Drain parameters */ +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, expire, + CTLFLAG_RW, DC(expire), 0, "Expire empty queues/pipes"); +SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, expire_cycle, + CTLFLAG_RD, DC(expire_cycle), 0, "Expire cycle for queues/pipes"); + /* statistics */ SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, schk_count, CTLFLAG_RD, DC(schk_count), 0, "Number of schedulers"); @@ -463,14 +465,16 @@ serve_sched(struct mq *q, struct dn_sch_inst *si, uint64_t now) done = 0; while (si->credit >= 0 && (m = s->fp->dequeue(si)) != NULL) { uint64_t len_scaled; + done++; len_scaled = (bw == 0) ? 0 : hz * - (m->m_pkthdr.len * 8 + extra_bits(m, s)); + (m->m_pkthdr.len * 8 + extra_bits(m, s)); si->credit -= len_scaled; /* Move packet in the delay line */ dn_tag_get(m)->output_time += s->link.delay ; mq_append(&si->dline.mq, m); } + /* * If credit >= 0 the instance is idle, mark time. * Otherwise put back in the heap, and adjust the output diff --git a/sys/netinet/ipfw/ip_dummynet.c b/sys/netinet/ipfw/ip_dummynet.c index 6c35876..67327e3 100644 --- a/sys/netinet/ipfw/ip_dummynet.c +++ b/sys/netinet/ipfw/ip_dummynet.c @@ -445,6 +445,7 @@ si_new(uintptr_t key, int flags, void *arg) si = malloc(l, M_DUMMYNET, M_NOWAIT | M_ZERO); if (si == NULL) goto error; + /* Set length only for the part passed up to userland. */ set_oid(&si->ni.oid, DN_SCH_I, sizeof(struct dn_flow)); set_oid(&(si->dline.oid), DN_DELAY_LINE, @@ -1571,7 +1572,7 @@ config_profile(struct dn_profile *pf, struct dn_id *arg) */ if (s->profile == NULL) s->profile = malloc(pf->oid.len, - M_DUMMYNET, M_NOWAIT | M_ZERO); + M_DUMMYNET, M_NOWAIT | M_ZERO); if (s->profile == NULL) { D("no memory for profile %d", i); err = ENOMEM; |