All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@google.com>
To: Martin KaFai Lau <martin.lau@linux.dev>
Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, song@kernel.org, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@kernel.org, haoluo@google.com,
	jolsa@kernel.org, "David Ahern" <dsahern@gmail.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Willem de Bruijn" <willemb@google.com>,
	"Jesper Dangaard Brouer" <brouer@redhat.com>,
	"Anatoly Burakov" <anatoly.burakov@intel.com>,
	"Alexander Lobakin" <alexandr.lobakin@intel.com>,
	"Magnus Karlsson" <magnus.karlsson@gmail.com>,
	"Maryam Tahhan" <mtahhan@redhat.com>,
	xdp-hints@xdp-project.net, netdev@vger.kernel.org,
	"Toke Høiland-Jørgensen" <toke@redhat.com>
Subject: Re: [xdp-hints] Re: [PATCH bpf-next v3 00/11] xdp: hints via kfuncs
Date: Wed, 30 Nov 2022 16:32:47 -0800	[thread overview]
Message-ID: <CAKH8qBtw-xpEm_5srzCP9FoJYeE5M-yEVMBOrXufxB4iVEV3Vw@mail.gmail.com> (raw)
In-Reply-To: <07db58dd-0752-e148-8d89-e22b8d7769f0@linux.dev>

On Wed, Nov 30, 2022 at 4:16 PM Martin KaFai Lau <martin.lau@linux.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).

  reply	other threads:[~2022-12-01  0:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 19:34 [PATCH bpf-next v3 00/11] xdp: hints via kfuncs Stanislav Fomichev
2022-11-29 19:34 ` [PATCH bpf-next v3 01/11] bpf: Document XDP RX metadata Stanislav Fomichev
2022-12-02 20:58   ` kernel test robot
2022-11-29 19:34 ` [PATCH bpf-next v3 02/11] bpf: XDP metadata RX kfuncs Stanislav Fomichev
2022-11-30 17:56   ` kernel test robot
2022-11-30 22:49   ` kernel test robot
2022-11-29 19:34 ` [PATCH bpf-next v3 03/11] veth: Introduce veth_xdp_buff wrapper for xdp_buff Stanislav Fomichev
2022-11-29 19:34 ` [PATCH bpf-next v3 04/11] veth: Support RX XDP metadata Stanislav Fomichev
2022-11-29 19:34 ` [PATCH bpf-next v3 05/11] selftests/bpf: Verify xdp_metadata xdp->af_xdp path Stanislav Fomichev
2022-11-29 19:34 ` [PATCH bpf-next v3 06/11] mlx4: Introduce mlx4_xdp_buff wrapper for xdp_buff Stanislav Fomichev
2022-11-29 19:34 ` [PATCH bpf-next v3 07/11] mxl4: Support RX XDP metadata Stanislav Fomichev
2022-11-29 19:34 ` [PATCH bpf-next v3 08/11] xsk: Add cb area to struct xdp_buff_xsk Stanislav Fomichev
2022-11-29 19:34 ` [PATCH bpf-next v3 09/11] mlx5: Introduce mlx5_xdp_buff wrapper for xdp_buff Stanislav Fomichev
2022-11-29 19:34 ` [PATCH bpf-next v3 10/11] mlx5: Support RX XDP metadata Stanislav Fomichev
2022-11-30  5:48   ` kernel test robot
2022-11-30 22:29   ` kernel test robot
2022-12-01  2:42   ` kernel test robot
2022-12-01 13:08   ` kernel test robot
2022-11-29 19:34 ` [PATCH bpf-next v3 11/11] selftests/bpf: Simple program to dump XDP RX metadata Stanislav Fomichev
2022-11-29 20:50 ` [xdp-hints] [PATCH bpf-next v3 00/11] xdp: hints via kfuncs Toke Høiland-Jørgensen
2022-11-29 23:41   ` Stanislav Fomichev
2022-11-30 23:01     ` [xdp-hints] " Toke Høiland-Jørgensen
2022-12-01  0:16       ` Martin KaFai Lau
2022-12-01  0:32         ` Stanislav Fomichev [this message]
2022-12-01  3:56           ` Jakub Kicinski
2022-12-01  0:32       ` Stanislav Fomichev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKH8qBtw-xpEm_5srzCP9FoJYeE5M-yEVMBOrXufxB4iVEV3Vw@mail.gmail.com \
    --to=sdf@google.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=dsahern@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=magnus.karlsson@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=mtahhan@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=toke@redhat.com \
    --cc=willemb@google.com \
    --cc=xdp-hints@xdp-project.net \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.