X-Git-Url: http://git.onelab.eu/?p=ipfw.git;a=blobdiff_plain;f=dummynet2%2Fdn_sched_rr.c;fp=dummynet2%2Fdn_sched_rr.c;h=2b58cf0bb65ea9caf150295368ee2f9512f891a1;hp=59c36acd9e2c0585fe09097ad1e2f810e3e718c7;hb=28a7fe9d930667786b902af6697c01eb87694173;hpb=2a8b6c544cf5ea3c84f763144c7ecfa79daea969 diff --git a/dummynet2/dn_sched_rr.c b/dummynet2/dn_sched_rr.c index 59c36ac..2b58cf0 100644 --- a/dummynet2/dn_sched_rr.c +++ b/dummynet2/dn_sched_rr.c @@ -25,7 +25,7 @@ */ /* - * $Id: dn_sched_rr.c 5621 2010-03-04 16:51:27Z luigi $ + * $Id: dn_sched_rr.c 6338 2010-05-26 15:06:34Z svn_panicucci $ */ #ifdef _KERNEL @@ -94,7 +94,7 @@ rr_remove_head(struct rr_si *si) if (si->head == NULL) return; /* empty queue */ si->head->status = 0; - + if (si->head == si->tail) { si->head = si->tail = NULL; return; @@ -111,7 +111,7 @@ static inline void remove_queue_q(struct rr_queue *q, struct rr_si *si) { struct rr_queue *prev; - + if (q->status != 1) return; if (q == si->head) { @@ -141,7 +141,7 @@ next_pointer(struct rr_si *si) si->tail = si->tail->qnext; } -static int +static int rr_enqueue(struct dn_sch_inst *_si, struct dn_queue *q, struct mbuf *m) { struct rr_si *si; @@ -154,7 +154,7 @@ rr_enqueue(struct dn_sch_inst *_si, struct dn_queue *q, struct mbuf *m) return 0; } - /* If reach this point, queue q was idle */ + /* If reach this point, queue q was idle */ si = (struct rr_si *)(_si + 1); rrq = (struct rr_queue *)q; @@ -264,11 +264,14 @@ rr_new_queue(struct dn_queue *_q) } static int -rr_free_queue(struct dn_queue *_q) +rr_free_queue(struct dn_queue *_q, int safe) { struct rr_queue *q = (struct rr_queue *)_q; ND("called"); + if (safe) /* Delete only if status == 0 */ + return q->status; + if (q->status == 1) { struct rr_si *si = (struct rr_si *)(_q->_si + 1); remove_queue_q(q, si);