lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpVz9bRDkW_cqj-vo6fapXaG6zV-bWM0Sc2wmHuj-vzWqg@mail.gmail.com>
Date:   Wed, 16 May 2018 14:09:00 -0700
From:   Cong Wang <xiyou.wangcong@...il.com>
To:     Toke Høiland-Jørgensen <toke@...e.dk>
Cc:     Linux Kernel Network Developers <netdev@...r.kernel.org>,
        Cake List <cake@...ts.bufferbloat.net>
Subject: Re: [PATCH net-next v12 2/7] sch_cake: Add ingress mode

On Wed, May 16, 2018 at 1:29 PM, Toke Høiland-Jørgensen <toke@...e.dk> wrote:
> +       if (tb[TCA_CAKE_AUTORATE]) {
> +               if (!!nla_get_u32(tb[TCA_CAKE_AUTORATE]))
> +                       q->rate_flags |= CAKE_FLAG_AUTORATE_INGRESS;
> +               else
> +                       q->rate_flags &= ~CAKE_FLAG_AUTORATE_INGRESS;
> +       }
> +
> +       if (tb[TCA_CAKE_INGRESS]) {
> +               if (!!nla_get_u32(tb[TCA_CAKE_INGRESS]))
> +                       q->rate_flags |= CAKE_FLAG_INGRESS;
> +               else
> +                       q->rate_flags &= ~CAKE_FLAG_INGRESS;
> +       }
> +
>         if (tb[TCA_CAKE_MEMORY])
>                 q->buffer_config_limit = nla_get_u32(tb[TCA_CAKE_MEMORY]);
>
> @@ -1559,6 +1628,14 @@ static int cake_dump(struct Qdisc *sch, struct sk_buff *skb)
>         if (nla_put_u32(skb, TCA_CAKE_MEMORY, q->buffer_config_limit))
>                 goto nla_put_failure;
>
> +       if (nla_put_u32(skb, TCA_CAKE_AUTORATE,
> +                       !!(q->rate_flags & CAKE_FLAG_AUTORATE_INGRESS)))
> +               goto nla_put_failure;
> +
> +       if (nla_put_u32(skb, TCA_CAKE_INGRESS,
> +                       !!(q->rate_flags & CAKE_FLAG_INGRESS)))
> +               goto nla_put_failure;
> +

Why do you want to dump each bit of the rate_flags separately rather than
dumping the whole rate_flags as an integer?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ