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: <CAJ3xEMhJbk9HH8epN6e=5MAxNjPrp1ik+mNEH9RHA1qF3+YRrA@mail.gmail.com>
Date:   Sun, 12 Feb 2017 12:01:52 +0200
From:   Or Gerlitz <gerlitz.or@...il.com>
To:     Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc:     Or Gerlitz <ogerlitz@...lanox.com>,
        "David S. Miller" <davem@...emloft.net>,
        Daniel Borkmann <daniel@...earbox.net>,
        John Fastabend <john.r.fastabend@...el.com>,
        Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 4/4] net/sched: cls_bpf: Use skip flags to
 reflect HW offload status

On Sat, Feb 11, 2017 at 12:19 AM, Jakub Kicinski
<jakub.kicinski@...ronome.com> wrote:

> FWIW I tested this one and it works.  I also tested this version which
> would take advantage of @offloaded:

I assume that if we go on the existing suggestion, the below is what
you prefer,
so I will pick it up, let know if you think otherwise.


> diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c
> index d9c97018317d..51d464f991ff 100644
> --- a/net/sched/cls_bpf.c
> +++ b/net/sched/cls_bpf.c
> @@ -568,8 +568,8 @@ static int cls_bpf_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
>                         struct sk_buff *skb, struct tcmsg *tm)
>  {
>         struct cls_bpf_prog *prog = (struct cls_bpf_prog *) fh;
> +       u32 gen_flags, bpf_flags = 0;
>         struct nlattr *nest;
> -       u32 bpf_flags = 0;
>         int ret;
>
>         if (prog == NULL)
> @@ -601,8 +601,11 @@ static int cls_bpf_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
>                 bpf_flags |= TCA_BPF_FLAG_ACT_DIRECT;
>         if (bpf_flags && nla_put_u32(skb, TCA_BPF_FLAGS, bpf_flags))
>                 goto nla_put_failure;
> -       if (prog->gen_flags &&
> -           nla_put_u32(skb, TCA_BPF_FLAGS_GEN, prog->gen_flags))
> +
> +       gen_flags = prog->gen_flags;
> +       if (!prog->offloaded)
> +               gen_flags |= TCA_CLS_FLAGS_SKIP_HW;
> +       if (gen_flags && nla_put_u32(skb, TCA_BPF_FLAGS_GEN, gen_flags))
>                 goto nla_put_failure;
>
>         nla_nest_end(skb, nest);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ