net sched actions police: peg drop stats for conforming traffic
authorRoman Mashak <mrv@mojatatu.com>
Sun, 18 Sep 2016 11:53:08 +0000 (07:53 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Sep 2016 02:04:14 +0000 (22:04 -0400)
setting conforming action to drop is a valid policy.
When it is set we need to at least see the stats indicating it
for debugging.

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_police.c

index 8a3be1d..ba7074b 100644 (file)
@@ -249,6 +249,8 @@ static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a,
                        police->tcfp_t_c = now;
                        police->tcfp_toks = toks;
                        police->tcfp_ptoks = ptoks;
+                       if (police->tcfp_result == TC_ACT_SHOT)
+                               police->tcf_qstats.drops++;
                        spin_unlock(&police->tcf_lock);
                        return police->tcfp_result;
                }