All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@kernel.org>
To: "Björn Töpel" <bjorn.topel@gmail.com>, bpf <bpf@vger.kernel.org>
Subject: Re: The future of bpf_dispatcher
Date: Tue, 27 Sep 2022 14:43:32 +0200	[thread overview]
Message-ID: <87tu4trnrf.fsf@toke.dk> (raw)
In-Reply-To: <CAJ+HfNgnvWaQcZKC37ayZgrWdLa1Ni9Zvena8NxyEYPTeAoMsw@mail.gmail.com>

Björn Töpel <bjorn.topel@gmail.com> writes:

> In the recent weeks there have been various issues [1] [2] (warnings, ftrace
> breakage) related to the bpf_dispatcher. The dispatcher was introduced
> to reduce the cost of indirect calls for the XDP realm, and during the
> whole retpoline timeline it was doing its job pretty good.
>
> However, it's a somewhat odd animal in the kernel, and very x86
> specific.
>
> Is the bpf_dispatcher still relevant? If yes, can it be replaced by a
> more generic functionality (e.g. static_calls)?

During Daniel's talk at LPC (about TC attachment) he mentioned that he
was planning to support multiple programs by iterating through an array
and doing an indirect call into each. I asked if we could avoid the
indirect calls by generating a bpf_dispatcher-style trampoline instead
(and further down the line extend this to XDP as well, like what libxdp
is doing).

No one seemed to complain loudly about this idea in the session; so I'm
hoping that the future of bpf_dispatcher is that we can generalise it so
it can be used for both TC and XDP, and also support chaining of
multiple programs on a single hook.

I don't have any opinion on how the low-level plumbing for this should
work, though; if changing it to re-use other kernel functionality like
static_calls makes sense, that's fine with me...

WDYT, sounds feasible? :)

-Toke

      reply	other threads:[~2022-09-27 12:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26  7:18 The future of bpf_dispatcher Björn Töpel
2022-09-27 12:43 ` Toke Høiland-Jørgensen [this message]

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=87tu4trnrf.fsf@toke.dk \
    --to=toke@kernel.org \
    --cc=bjorn.topel@gmail.com \
    --cc=bpf@vger.kernel.org \
    /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.