aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_police.c
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2009-06-16 04:33:55 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-17 21:56:45 -0400
commitb964758050f856e44f5fe645d03bea8a1b0b66bd (patch)
tree086f12ef757a245a410e00fb46e410495c456b3d /net/sched/act_police.c
parente4f1482e686212e6d1dd6df93888bb26344981c6 (diff)
pkt_sched: Update drops stats in act_police
Action police statistics could be misleading because drops are not shown when expected. With feedback from: Jamal Hadi Salim <hadi@cyberus.ca> Reported-by: Pawel Staszewski <pstaszewski@itcare.pl> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Acked-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_police.c')
-rw-r--r--net/sched/act_police.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index f8f047b61245..723964c3ee4f 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -294,6 +294,8 @@ static int tcf_act_police(struct sk_buff *skb, struct tc_action *a,
294 if (police->tcfp_ewma_rate && 294 if (police->tcfp_ewma_rate &&
295 police->tcf_rate_est.bps >= police->tcfp_ewma_rate) { 295 police->tcf_rate_est.bps >= police->tcfp_ewma_rate) {
296 police->tcf_qstats.overlimits++; 296 police->tcf_qstats.overlimits++;
297 if (police->tcf_action == TC_ACT_SHOT)
298 police->tcf_qstats.drops++;
297 spin_unlock(&police->tcf_lock); 299 spin_unlock(&police->tcf_lock);
298 return police->tcf_action; 300 return police->tcf_action;
299 } 301 }
@@ -327,6 +329,8 @@ static int tcf_act_police(struct sk_buff *skb, struct tc_action *a,
327 } 329 }
328 330
329 police->tcf_qstats.overlimits++; 331 police->tcf_qstats.overlimits++;
332 if (police->tcf_action == TC_ACT_SHOT)
333 police->tcf_qstats.drops++;
330 spin_unlock(&police->tcf_lock); 334 spin_unlock(&police->tcf_lock);
331 return police->tcf_action; 335 return police->tcf_action;
332} 336}