pkt_sched: Update drops stats in act_police

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, June 18, 2009 - 3:03 pm

Gitweb:     http://git.kernel.org/linus/b964758050f856e44f5fe645d03bea8a1b0b66bd
Commit:     b964758050f856e44f5fe645d03bea8a1b0b66bd
Parent:     e4f1482e686212e6d1dd6df93888bb26344981c6
Author:     Jarek Poplawski <jarkao2@gmail.com>
AuthorDate: Tue Jun 16 08:33:55 2009 +0000
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Wed Jun 17 18:56:45 2009 -0700

    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>
---
 net/sched/act_police.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index f8f047b..723964c 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,
 	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;
 	}
@@ -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;
 }
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
pkt_sched: Update drops stats in act_police, Linux Kernel Mailing ..., (Thu Jun 18, 3:03 pm)