net: sched: implement qstat helper routines
This adds helpers to manipulate qstats logic and replaces locations that touch the counters directly. This simplifies future patches to push qstats onto per cpu counters. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
22e0f8b932
commit
25331d6ce4
@@ -377,7 +377,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
|
||||
#endif
|
||||
if (cl == NULL) {
|
||||
if (ret & __NET_XMIT_BYPASS)
|
||||
sch->qstats.drops++;
|
||||
qdisc_qstats_drop(sch);
|
||||
kfree_skb(skb);
|
||||
return ret;
|
||||
}
|
||||
@@ -395,7 +395,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
|
||||
}
|
||||
|
||||
if (net_xmit_drop_count(ret)) {
|
||||
sch->qstats.drops++;
|
||||
qdisc_qstats_drop(sch);
|
||||
cbq_mark_toplevel(q, cl);
|
||||
cl->qstats.drops++;
|
||||
}
|
||||
@@ -650,11 +650,11 @@ static int cbq_reshape_fail(struct sk_buff *skb, struct Qdisc *child)
|
||||
return 0;
|
||||
}
|
||||
if (net_xmit_drop_count(ret))
|
||||
sch->qstats.drops++;
|
||||
qdisc_qstats_drop(sch);
|
||||
return 0;
|
||||
}
|
||||
|
||||
sch->qstats.drops++;
|
||||
qdisc_qstats_drop(sch);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
@@ -995,7 +995,7 @@ cbq_dequeue(struct Qdisc *sch)
|
||||
*/
|
||||
|
||||
if (sch->q.qlen) {
|
||||
sch->qstats.overlimits++;
|
||||
qdisc_qstats_overlimit(sch);
|
||||
if (q->wd_expires)
|
||||
qdisc_watchdog_schedule(&q->watchdog,
|
||||
now + q->wd_expires);
|
||||
|
Reference in New Issue
Block a user