[Codel] [RFC PATCH] Codel: Enable packet drop with ECN-marked packets on a threshold

Eric Dumazet eric.dumazet at gmail.com
Sun Jun 17 22:58:26 EDT 2012


On Sun, 2012-06-17 at 22:40 -0400, Dave Taht wrote:
> On Sun, Jun 17, 2012 at 10:17 PM, Eric Dumazet <eric.dumazet at gmail.com> wrote:

> > if (A && B && C)
> >
> > Even if (C) is false, but A is true, B is evaluated.
> 
> A is always true (or always false)
> B in this case is usually false except on the kinds of ECN-heavy
> workloads that exposed this issue
> and C is probably higher overhead than A or B
> 
> So a better conditional is possible...

Not only better, but _correct_ ;)

To have a chance to be correct, your patch should have been :


if (params->ecn &&
    vars->ldelay <= 2 * params->target &&
    INET_ECN_set_ce(skb))

Because INET_ECN_set_ce(skb) is _doing_ ecn marking, and returns true is
ECN was successfully applied to the packet.






More information about the Codel mailing list