[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1360460027.20362.4.camel@edumazet-glaptop>
Date: Sat, 09 Feb 2013 17:33:47 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jiri Pirko <jiri@...nulli.us>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
jhs@...atatu.com, kuznet@....inr.ac.ru, j.vimal@...il.com
Subject: Re: [patch net-next v3 10/11] act_police: improved accuracy at high
rates
On Sat, 2013-02-09 at 17:45 +0100, Jiri Pirko wrote:
> Current act_police uses rate table computed by the "tc" userspace program,
> which has the following issue:
>
> The rate table has 256 entries to map packet lengths to
> token (time units). With TSO sized packets, the 256 entry granularity
> leads to loss/gain of rate, making the token bucket inaccurate.
>
> Thus, instead of relying on rate table, this patch explicitly computes
> the time and accounts for packet transmission times with nanosecond
> granularity.
>
...
> - ptoks -= L2T_P(police, qdisc_pkt_len(skb));
> + if (ptoks > (s64) psched_l2t_ns(&police->peak,
> + police->tcfp_mtu))
> + ptoks = (s64) psched_l2t_ns(&police->peak,
> + police->tcfp_mtu);
Same remark here, this should be in a cached variable.
> + ptoks -= (s64) psched_l2t_ns(&police->peak,
> + qdisc_pkt_len(skb));
> }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists