diff options
author | John Fastabend <john.fastabend@gmail.com> | 2014-09-28 14:53:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-30 01:02:26 -0400 |
commit | 25331d6ce42bcf4b34b6705fce4da15c3fabe62f (patch) | |
tree | 1c2d92a220f90f155de62a435753f09ff0c9ce91 /net/sched/sch_red.c | |
parent | 22e0f8b9322cb1a48b1357e8f4ae6f5a9eca8cfa (diff) |
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>
Diffstat (limited to 'net/sched/sch_red.c')
-rw-r--r-- | net/sched/sch_red.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index 633e32defdcc..6c0534cc7758 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c | |||
@@ -74,7 +74,7 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
74 | break; | 74 | break; |
75 | 75 | ||
76 | case RED_PROB_MARK: | 76 | case RED_PROB_MARK: |
77 | sch->qstats.overlimits++; | 77 | qdisc_qstats_overlimit(sch); |
78 | if (!red_use_ecn(q) || !INET_ECN_set_ce(skb)) { | 78 | if (!red_use_ecn(q) || !INET_ECN_set_ce(skb)) { |
79 | q->stats.prob_drop++; | 79 | q->stats.prob_drop++; |
80 | goto congestion_drop; | 80 | goto congestion_drop; |
@@ -84,7 +84,7 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
84 | break; | 84 | break; |
85 | 85 | ||
86 | case RED_HARD_MARK: | 86 | case RED_HARD_MARK: |
87 | sch->qstats.overlimits++; | 87 | qdisc_qstats_overlimit(sch); |
88 | if (red_use_harddrop(q) || !red_use_ecn(q) || | 88 | if (red_use_harddrop(q) || !red_use_ecn(q) || |
89 | !INET_ECN_set_ce(skb)) { | 89 | !INET_ECN_set_ce(skb)) { |
90 | q->stats.forced_drop++; | 90 | q->stats.forced_drop++; |
@@ -100,7 +100,7 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
100 | sch->q.qlen++; | 100 | sch->q.qlen++; |
101 | } else if (net_xmit_drop_count(ret)) { | 101 | } else if (net_xmit_drop_count(ret)) { |
102 | q->stats.pdrop++; | 102 | q->stats.pdrop++; |
103 | sch->qstats.drops++; | 103 | qdisc_qstats_drop(sch); |
104 | } | 104 | } |
105 | return ret; | 105 | return ret; |
106 | 106 | ||
@@ -142,7 +142,7 @@ static unsigned int red_drop(struct Qdisc *sch) | |||
142 | 142 | ||
143 | if (child->ops->drop && (len = child->ops->drop(child)) > 0) { | 143 | if (child->ops->drop && (len = child->ops->drop(child)) > 0) { |
144 | q->stats.other++; | 144 | q->stats.other++; |
145 | sch->qstats.drops++; | 145 | qdisc_qstats_drop(sch); |
146 | sch->q.qlen--; | 146 | sch->q.qlen--; |
147 | return len; | 147 | return len; |
148 | } | 148 | } |