diff mbox

codel: reduce default maxpacket and reinitialize upon re-entering drop state

Message ID 1346525457-31481-1-git-send-email-dave.taht@bufferbloat.net
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Dave Täht Sept. 1, 2012, 6:50 p.m. UTC
From: Dave Taht <dave.taht@bufferbloat.net>

The minimum size packet in a queue is 64, not 256.

Also, as ethtool can be used to remove tso/gso/ufo, the last seen
maxpacket can vary considerably in size (e.g. 64k). So reset it
on re-entering the drop scheduler to the most recent packet size,
and let it grow again naturally.

Signed-off-by: Dave Taht <dave.taht@bufferbloat.net>
---
 include/net/codel.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Eric Dumazet Sept. 2, 2012, 11:05 p.m. UTC | #1
On Sat, 2012-09-01 at 11:50 -0700, Dave Täht wrote:
> From: Dave Taht <dave.taht@bufferbloat.net>
> 
> The minimum size packet in a queue is 64, not 256.
> 
> Also, as ethtool can be used to remove tso/gso/ufo, the last seen
> maxpacket can vary considerably in size (e.g. 64k). So reset it
> on re-entering the drop scheduler to the most recent packet size,
> and let it grow again naturally.
> 
> Signed-off-by: Dave Taht <dave.taht@bufferbloat.net>
> ---
>  include/net/codel.h |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/net/codel.h b/include/net/codel.h
> index 389cf62..0b0ac5e 100644
> --- a/include/net/codel.h
> +++ b/include/net/codel.h
> @@ -170,7 +170,7 @@ static void codel_vars_init(struct codel_vars *vars)
>  
>  static void codel_stats_init(struct codel_stats *stats)
>  {
> -	stats->maxpacket = 256;
> +	stats->maxpacket = 64;
>  }
>  
>  /*
> @@ -333,6 +333,7 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch,
>  			 */
>  			codel_Newton_step(vars);
>  		} else {
> +			stats->maxpacket = skb ? qdisc_pkt_len(skb) : 64;
>  			vars->count = 1;
>  			vars->rec_inv_sqrt = ~0U >> REC_INV_SQRT_SHIFT;
>  		}

This has very litle value.

maxpacket is mainly an information given to "tc -s qdisc".

It serves as a debugging stuff, to know the max packet size seen on
codel qdisc.

So you can set it to 0 as far as I am concerned, but not reset it in
codel_enqueue(), as it adds runtime overhead and a branch misprediction.



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

Patch

diff --git a/include/net/codel.h b/include/net/codel.h
index 389cf62..0b0ac5e 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -170,7 +170,7 @@  static void codel_vars_init(struct codel_vars *vars)
 
 static void codel_stats_init(struct codel_stats *stats)
 {
-	stats->maxpacket = 256;
+	stats->maxpacket = 64;
 }
 
 /*
@@ -333,6 +333,7 @@  static struct sk_buff *codel_dequeue(struct Qdisc *sch,
 			 */
 			codel_Newton_step(vars);
 		} else {
+			stats->maxpacket = skb ? qdisc_pkt_len(skb) : 64;
 			vars->count = 1;
 			vars->rec_inv_sqrt = ~0U >> REC_INV_SQRT_SHIFT;
 		}