git://git.onelab.eu
/
ipfw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
integrated
[ipfw.git]
/
dummynet2
/
dn_sched_wf2q.c
diff --git
a/dummynet2/dn_sched_wf2q.c
b/dummynet2/dn_sched_wf2q.c
index
e221989
..
c42969e
100644
(file)
--- a/
dummynet2/dn_sched_wf2q.c
+++ b/
dummynet2/dn_sched_wf2q.c
@@
-26,7
+26,7
@@
*/
/*
*/
/*
- * $Id: dn_sched_wf2q.c
5621 2010-03-04 16:51:27Z luig
i $
+ * $Id: dn_sched_wf2q.c
6338 2010-05-26 15:06:34Z svn_panicucc
i $
*/
#ifdef _KERNEL
*/
#ifdef _KERNEL
@@
-125,7
+125,7
@@
idle_check(struct wf2qp_si *si, int n, int force)
}
}
}
}
-static int
+static int
wf2qp_enqueue(struct dn_sch_inst *_si, struct dn_queue *q, struct mbuf *m)
{
struct dn_fsk *fs = q->fs;
wf2qp_enqueue(struct dn_sch_inst *_si, struct dn_queue *q, struct mbuf *m)
{
struct dn_fsk *fs = q->fs;
@@
-140,7
+140,7
@@
wf2qp_enqueue(struct dn_sch_inst *_si, struct dn_queue *q, struct mbuf *m)
return 0;
}
return 0;
}
- /* If reach this point, queue q was idle */
+ /* If reach this point, queue q was idle */
alg_fq = (struct wf2qp_queue *)q;
if (DN_KEY_LT(alg_fq->F, alg_fq->S)) {
alg_fq = (struct wf2qp_queue *)q;
if (DN_KEY_LT(alg_fq->F, alg_fq->S)) {
@@
-314,13
+314,18
@@
wf2qp_new_queue(struct dn_queue *_q)
* of weights.
*/
static int
* of weights.
*/
static int
-wf2qp_free_queue(struct dn_queue *q)
+wf2qp_free_queue(struct dn_queue *q
, int safe
)
{
struct wf2qp_queue *alg_fq = (struct wf2qp_queue *)q;
struct wf2qp_si *si = (struct wf2qp_si *)(q->_si + 1);
{
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 */
if (alg_fq->S >= alg_fq->F + 1)
return 0; /* nothing to do, not in any heap */
+
+ /* queue is in a scheduler heap */
+ if (safe) /* do not delete in safe mode */
+ return 1;
+
si->wsum -= q->fs->fs.par[0];
if (si->wsum > 0)
si->inv_wsum = ONE_FP/si->wsum;
si->wsum -= q->fs->fs.par[0];
if (si->wsum > 0)
si->inv_wsum = ONE_FP/si->wsum;