Commit 9539ad41 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[PKT_SCHED]: Requeues statistics

Introduces requeue statistics for qdiscs. Patch is based on a
patch of Jamal Hadi Salim and adapted to new statistic API.
Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40100a2b
......@@ -545,8 +545,10 @@ static int atm_tc_requeue(struct sk_buff *skb,struct Qdisc *sch)
D2PRINTK("atm_tc_requeue(skb %p,sch %p,[qdisc %p])\n",skb,sch,p);
ret = p->link.q->ops->requeue(skb,p->link.q);
if (!ret) sch->q.qlen++;
else {
if (!ret) {
sch->q.qlen++;
sch->qstats.requeues++;
} else {
sch->qstats.drops++;
p->link.stats.drops++;
}
......
......@@ -485,6 +485,7 @@ cbq_requeue(struct sk_buff *skb, struct Qdisc *sch)
#endif
if ((ret = cl->q->ops->requeue(skb, cl->q)) == 0) {
sch->q.qlen++;
sch->qstats.requeues++;
if (!cl->next_alive)
cbq_activate_class(cl);
return 0;
......
......@@ -297,6 +297,7 @@ static int dsmark_requeue(struct sk_buff *skb,struct Qdisc *sch)
D2PRINTK("dsmark_requeue(skb %p,sch %p,[qdisc %p])\n",skb,sch,p);
if ((ret = p->q->ops->requeue(skb, p->q)) == 0) {
sch->q.qlen++;
sch->qstats.requeues++;
return 0;
}
sch->qstats.drops++;
......
......@@ -67,6 +67,7 @@ bfifo_requeue(struct sk_buff *skb, struct Qdisc* sch)
{
__skb_queue_head(&sch->q, skb);
sch->qstats.backlog += skb->len;
sch->qstats.requeues++;
return 0;
}
......@@ -126,6 +127,7 @@ static int
pfifo_requeue(struct sk_buff *skb, struct Qdisc* sch)
{
__skb_queue_head(&sch->q, skb);
sch->qstats.requeues++;
return 0;
}
......
......@@ -353,6 +353,7 @@ pfifo_fast_requeue(struct sk_buff *skb, struct Qdisc* qdisc)
__skb_queue_head(list, skb);
qdisc->q.qlen++;
qdisc->qstats.requeues++;
return 0;
}
......
......@@ -222,6 +222,7 @@ gred_requeue(struct sk_buff *skb, struct Qdisc* sch)
__skb_queue_head(&sch->q, skb);
sch->qstats.backlog += skb->len;
sch->qstats.requeues++;
q->backlog += skb->len;
return 0;
}
......
......@@ -1779,6 +1779,7 @@ hfsc_requeue(struct sk_buff *skb, struct Qdisc *sch)
__skb_queue_head(&q->requeue, skb);
sch->q.qlen++;
sch->qstats.requeues++;
return NET_XMIT_SUCCESS;
}
......
......@@ -794,6 +794,7 @@ static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)
htb_activate (q,cl);
sch->q.qlen++;
sch->qstats.requeues++;
HTB_DBG(1,1,"htb_req_ok cl=%X skb=%p\n",(cl && cl != HTB_DIRECT)?cl->classid:0,skb);
return NET_XMIT_SUCCESS;
}
......
......@@ -215,8 +215,10 @@ static int netem_requeue(struct sk_buff *skb, struct Qdisc *sch)
struct netem_sched_data *q = qdisc_priv(sch);
int ret;
if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0)
if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0) {
sch->q.qlen++;
sch->qstats.requeues++;
}
return ret;
}
......
......@@ -139,6 +139,7 @@ prio_requeue(struct sk_buff *skb, struct Qdisc* sch)
if ((ret = qdisc->ops->requeue(skb, qdisc)) == 0) {
sch->q.qlen++;
sch->qstats.requeues++;
return 0;
}
dropped:
......
......@@ -309,6 +309,7 @@ red_requeue(struct sk_buff *skb, struct Qdisc* sch)
__skb_queue_head(&sch->q, skb);
sch->qstats.backlog += skb->len;
sch->qstats.requeues++;
return 0;
}
......
......@@ -310,8 +310,10 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch)
q->tail = x;
}
}
if (++sch->q.qlen < q->limit - 1)
if (++sch->q.qlen < q->limit - 1) {
sch->qstats.requeues++;
return 0;
}
sch->qstats.drops++;
sfq_drop(sch);
......
......@@ -166,8 +166,10 @@ static int tbf_requeue(struct sk_buff *skb, struct Qdisc* sch)
struct tbf_sched_data *q = qdisc_priv(sch);
int ret;
if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0)
if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0) {
sch->q.qlen++;
sch->qstats.requeues++;
}
return ret;
}
......
......@@ -113,6 +113,7 @@ teql_requeue(struct sk_buff *skb, struct Qdisc* sch)
struct teql_sched_data *q = qdisc_priv(sch);
__skb_queue_head(&q->q, skb);
sch->qstats.requeues++;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment