Patchwork [net-next,v5,11/11] act_police: remove <=mtu check for gso skbs

login
register
mail settings
Submitter Jiri Pirko
Date Feb. 12, 2013, 10:12 a.m.
Message ID <1360663929-1023-12-git-send-email-jiri@resnulli.us>
Download mbox | patch
Permalink /patch/219769/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Jiri Pirko - Feb. 12, 2013, 10:12 a.m.
This check made bigger packets incorrectly dropped. Remove this
limitation for gso skbs.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 net/sched/act_police.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Eric Dumazet - Feb. 12, 2013, 4:40 p.m.
On Tue, 2013-02-12 at 11:12 +0100, Jiri Pirko wrote:
> This check made bigger packets incorrectly dropped. Remove this
> limitation for gso skbs.
> 
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> ---
>  net/sched/act_police.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sched/act_police.c b/net/sched/act_police.c
> index 823463a..2dba297 100644
> --- a/net/sched/act_police.c
> +++ b/net/sched/act_police.c
> @@ -325,7 +325,7 @@ static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a,
>  		return police->tcf_action;
>  	}
>  
> -	if (qdisc_pkt_len(skb) <= police->tcfp_mtu) {
> +	if (qdisc_pkt_len(skb) <= police->tcfp_mtu || skb_is_gso(skb)) {
>  		if (!police->rate_present) {
>  			spin_unlock(&police->tcf_lock);
>  			return police->tcfp_result;
> @@ -336,7 +336,7 @@ static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a,
>  			     police->tcfp_burst);
>  		if (police->peak_present) {
>  			ptoks = toks + police->tcfp_ptoks;
> -			if (ptoks > police->tcfp_mtu_ptoks)
> +			if (ptoks > police->tcfp_mtu_ptoks && !skb_is_gso(skb))
>  				ptoks = police->tcfp_mtu_ptoks;
>  			ptoks -= (s64) psched_l2t_ns(&police->peak,
>  						     qdisc_pkt_len(skb));


Same remark here : This chunks looks wrong to me.



--
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 823463a..2dba297 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -325,7 +325,7 @@  static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a,
 		return police->tcf_action;
 	}
 
-	if (qdisc_pkt_len(skb) <= police->tcfp_mtu) {
+	if (qdisc_pkt_len(skb) <= police->tcfp_mtu || skb_is_gso(skb)) {
 		if (!police->rate_present) {
 			spin_unlock(&police->tcf_lock);
 			return police->tcfp_result;
@@ -336,7 +336,7 @@  static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a,
 			     police->tcfp_burst);
 		if (police->peak_present) {
 			ptoks = toks + police->tcfp_ptoks;
-			if (ptoks > police->tcfp_mtu_ptoks)
+			if (ptoks > police->tcfp_mtu_ptoks && !skb_is_gso(skb))
 				ptoks = police->tcfp_mtu_ptoks;
 			ptoks -= (s64) psched_l2t_ns(&police->peak,
 						     qdisc_pkt_len(skb));