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: <87lgcjuwr3.fsf@toke.dk>
Date:   Wed, 16 May 2018 23:16:32 +0200
From:   Toke Høiland-Jørgensen <toke@...e.dk>
To:     Cong Wang <xiyou.wangcong@...il.com>
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

Cong Wang <xiyou.wangcong@...il.com> writes:

> 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?

Well, these were added one at a time, each as a new option. Isn't that
more or less congruent with how netlink attributes are supposed to be
used?

-Toke

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ