svn commit: r213267 - head/sys/netinet/ipfw
Luigi Rizzo
luigi at FreeBSD.org
Wed Sep 29 09:40:21 UTC 2010
Author: luigi
Date: Wed Sep 29 09:40:20 2010
New Revision: 213267
URL: http://svn.freebsd.org/changeset/base/213267
Log:
whitespace changes in preparation for future commits
Modified:
head/sys/netinet/ipfw/dn_sched.h
head/sys/netinet/ipfw/dn_sched_wf2q.c
head/sys/netinet/ipfw/ip_dn_glue.c
head/sys/netinet/ipfw/ip_dn_io.c
head/sys/netinet/ipfw/ip_dummynet.c
Modified: head/sys/netinet/ipfw/dn_sched.h
==============================================================================
--- head/sys/netinet/ipfw/dn_sched.h Wed Sep 29 09:25:22 2010 (r213266)
+++ head/sys/netinet/ipfw/dn_sched.h Wed Sep 29 09:40:20 2010 (r213267)
@@ -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) {
Modified: head/sys/netinet/ipfw/dn_sched_wf2q.c
==============================================================================
--- head/sys/netinet/ipfw/dn_sched_wf2q.c Wed Sep 29 09:25:22 2010 (r213266)
+++ head/sys/netinet/ipfw/dn_sched_wf2q.c Wed Sep 29 09:40:20 2010 (r213267)
@@ -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];
Modified: head/sys/netinet/ipfw/ip_dn_glue.c
==============================================================================
--- head/sys/netinet/ipfw/ip_dn_glue.c Wed Sep 29 09:25:22 2010 (r213266)
+++ head/sys/netinet/ipfw/ip_dn_glue.c Wed Sep 29 09:40:20 2010 (r213267)
@@ -1,4 +1,4 @@
-/*-
+/*-
* Copyright (c) 2010 Riccardo Panicucci, Universita` di Pisa
* All rights reserved
*
Modified: head/sys/netinet/ipfw/ip_dn_io.c
==============================================================================
--- head/sys/netinet/ipfw/ip_dn_io.c Wed Sep 29 09:25:22 2010 (r213266)
+++ head/sys/netinet/ipfw/ip_dn_io.c Wed Sep 29 09:40:20 2010 (r213267)
@@ -120,10 +120,6 @@ SYSCTL_INT(_net_inet_ip_dummynet, OID_AU
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_A
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_
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
Modified: head/sys/netinet/ipfw/ip_dummynet.c
==============================================================================
--- head/sys/netinet/ipfw/ip_dummynet.c Wed Sep 29 09:25:22 2010 (r213266)
+++ head/sys/netinet/ipfw/ip_dummynet.c Wed Sep 29 09:40:20 2010 (r213267)
@@ -445,6 +445,7 @@ si_new(uintptr_t key, int flags, void *a
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, st
*/
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;
More information about the svn-src-all
mailing list