netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/1] net sched actions police: peg drop stats for conforming traffic
@ 2016-09-18 11:53 Jamal Hadi Salim
  2016-09-20  2:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jamal Hadi Salim @ 2016-09-18 11:53 UTC (permalink / raw)
  To: davem; +Cc: netdev, Roman Mashak, Jamal Hadi Salim

From: Roman Mashak <mrv@mojatatu.com>

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>
---
 net/sched/act_police.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 8a3be1d..ba7074b 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -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;
 		}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next 1/1] net sched actions police: peg drop stats for conforming traffic
  2016-09-18 11:53 [PATCH net-next 1/1] net sched actions police: peg drop stats for conforming traffic Jamal Hadi Salim
@ 2016-09-20  2:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-09-20  2:04 UTC (permalink / raw)
  To: jhs; +Cc: netdev, mrv

From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: Sun, 18 Sep 2016 07:53:08 -0400

> From: Roman Mashak <mrv@mojatatu.com>
> 
> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-20  2:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-18 11:53 [PATCH net-next 1/1] net sched actions police: peg drop stats for conforming traffic Jamal Hadi Salim
2016-09-20  2:04 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).