Patchwork [v2] Re: iproute2 action/policer question

login
register
mail settings
Submitter Jarek Poplawski
Date June 16, 2009, 6:33 p.m.
Message ID <20090616183355.GA3800@ami.dom.local>
Download mbox | patch
Permalink /patch/28738/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jarek Poplawski - June 16, 2009, 6:33 p.m.
Here is take 2 with Jamal's ack, and Pawel's name "simplified".
Pawel, if you're not OK with this feel free to send your "Reported-by"
line, and I hope David will replace it.

Thanks,
Jarek P.
-------------------> take 2
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>
---

 net/sched/act_police.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
PaweĊ‚ Staszewski - June 17, 2009, 9:33 a.m.
Jarek Poplawski pisze:
> Here is take 2 with Jamal's ack, and Pawel's name "simplified".
> Pawel, if you're not OK with this feel free to send your "Reported-by"
> line, and I hope David will replace it.
>
>   
:) it's OK
> Thanks,
> Jarek P.
> -------------------> take 2
> 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>
> ---
>
>  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 netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>   

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - June 18, 2009, 1:57 a.m.
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Tue, 16 Jun 2009 20:33:55 +0200

> 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>

Applied, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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;
 }