*/
/*
- * $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
if (si->head == NULL)
return; /* empty queue */
si->head->status = 0;
-
+
if (si->head == si->tail) {
si->head = si->tail = NULL;
return;
remove_queue_q(struct rr_queue *q, struct rr_si *si)
{
struct rr_queue *prev;
-
+
if (q->status != 1)
return;
if (q == si->head) {
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;
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;
}
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);