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: <CAKH8qBtw-xpEm_5srzCP9FoJYeE5M-yEVMBOrXufxB4iVEV3Vw@mail.gmail.com>
Date:   Wed, 30 Nov 2022 16:32:47 -0800
From:   Stanislav Fomichev <sdf@...gle.com>
To:     Martin KaFai Lau <martin.lau@...ux.dev>
Cc:     bpf@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
        andrii@...nel.org, song@...nel.org, yhs@...com,
        john.fastabend@...il.com, kpsingh@...nel.org, haoluo@...gle.com,
        jolsa@...nel.org, David Ahern <dsahern@...il.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Willem de Bruijn <willemb@...gle.com>,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        Anatoly Burakov <anatoly.burakov@...el.com>,
        Alexander Lobakin <alexandr.lobakin@...el.com>,
        Magnus Karlsson <magnus.karlsson@...il.com>,
        Maryam Tahhan <mtahhan@...hat.com>, xdp-hints@...-project.net,
        netdev@...r.kernel.org,
        Toke Høiland-Jørgensen <toke@...hat.com>
Subject: Re: [xdp-hints] Re: [PATCH bpf-next v3 00/11] xdp: hints via kfuncs

On Wed, Nov 30, 2022 at 4:16 PM Martin KaFai Lau <martin.lau@...ux.dev> wrote:
>
> On 11/30/22 3:01 PM, Toke Høiland-Jørgensen wrote:
> >> It feels like beyond that extra dev_put, we'd need to reset our
> >> aux->xdp_netdev and/or add some flag or something else to indicate
> >> that this bpf program is "orphaned" and can't be attached anywhere
> >> anymore (since the device is gone; netdev_run_todo should free the
> >> netdev it seems).
>
> imo, orphan the prog and not able to attach again is ok.  Finding the next
> compatible netdev would be nice but not a must to begin with.  Regardless, it
> needs a bpf_prog<->netdev decoupling approach which allows to unregister netdev
> gracefully instead of getting the "unregister_netdevice: waiting for xyz to
> become free...".
>
> fwiw, offload.c has solved a similar problem and it keeps its own list of prog
> depending on a particular netdev.  Whatever approach makes more sense here.
> Ideally, other non-NIC HW kfunc can reuse a similar approach in the future.

Makes sense. Let me take a closer look. I glanced at it last week and
decided that maybe it's easier to not hold the device at all..

Maybe we should have something like this:

- bpf_prog_is_dev_bound() - prog is dev bound but not offloaded
(currently bpf_prog_is_dev_bound == fully offloaded)
- bpf_prog_is_offloaded() - prog is dev bound and offloaded

So hopefully I can leverage some/most existing bpf_prog_is_dev_bound
call sites (+ add some more to reject prog_run/etc).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ