On Wed, May 16, 2018 at 1:29 PM, Toke Høiland-Jørgensen <t...@toke.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?
_______________________________________________
Cake mailing list
Cake@lists.bufferbloat.net
https://lists.bufferbloat.net/listinfo/cake

Reply via email to