Skip to content

Commit

Permalink
pkt_sched: Update drops stats in act_police
Browse files Browse the repository at this point in the history
Action police statistics could be misleading because drops are not
shown when expected.

With feedback from: Jamal Hadi Salim <[email protected]>

Reported-by: Pawel Staszewski <[email protected]>
Signed-off-by: Jarek Poplawski <[email protected]>
Acked-by: Jamal Hadi Salim <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Jarek Poplawski authored and davem330 committed Jun 18, 2009
1 parent e4f1482 commit b964758
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/sched/act_police.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ static int tcf_act_police(struct sk_buff *skb, struct tc_action *a,
if (police->tcfp_ewma_rate &&
police->tcf_rate_est.bps >= police->tcfp_ewma_rate) {
police->tcf_qstats.overlimits++;
if (police->tcf_action == TC_ACT_SHOT)
police->tcf_qstats.drops++;
spin_unlock(&police->tcf_lock);
return police->tcf_action;
}
Expand Down Expand Up @@ -327,6 +329,8 @@ static int tcf_act_police(struct sk_buff *skb, struct tc_action *a,
}

police->tcf_qstats.overlimits++;
if (police->tcf_action == TC_ACT_SHOT)
police->tcf_qstats.drops++;
spin_unlock(&police->tcf_lock);
return police->tcf_action;
}
Expand Down

0 comments on commit b964758

Please sign in to comment.