DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Björn Svensson A" <bjorn.a.svensson@est.tech>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: librte_bpf: roadmap or any specific plans for this library
Date: Mon, 25 Apr 2022 23:38:18 +0000	[thread overview]
Message-ID: <DB9P189MB1833A7A2AF6CBF68D14F4070B9F89@DB9P189MB1833.EURP189.PROD.OUTLOOK.COM> (raw)

[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]

Hi all,
I hope this is the correct maillist for this topic.

DPDK provides the nice library `librte_bpf` to load and execute eBPF bytecode
and we would like to broaden our usage of this library.

Today there are hints that this library might have been purpose built to enable inspection or modification of packets;
for example the eBPF program is expected to only use a single input argument, pointing to data of some sort.
We believe it would be beneficial to be able to use this library to run generic eBPF programs as well,
as an alternative to run them as RX- TX-port/queue callbacks (i.e. generic programs which only uses supported features)

I have seen some discussions regarding moving towards using a common library with the kernel implementation of bpf,
but I couldn't figure out the outcome.
My question is if there any plans to evolve this library or would improvements possibly be accepted?

Here are some improvements we are interested to look into:

* Add additional API for loading eBPF code.
  Today it's possible to load eBPF code from an ELF file, but having an API to load code from an ELF image from memory
  would open up for other ways to manage eBPF code.

  Example of the new API:
    struct rte_bpf *
    rte_bpf_elf_image_load(const struct rte_bpf_prm *prm, char *image,
                           size_t size, const char *sname);

* Add support of more than a single input argument.
  There are cases when additional information is needed. Being able to use more than a single input argument
  would help when running generic eBPF programs.

  Example of change:
       struct rte_bpf_prm {
       ...
    -    struct rte_bpf_arg prog_arg; /**< eBPF program input arg description */
    +    uint32_t nb_args;
    +    struct rte_bpf_arg prog_args[EBPF_FUNC_MAX_ARGS]; /**< eBPF program input args */
       };

Any feedback regarding this is welcomed.
Best regard
Bjorn


[-- Attachment #2: Type: text/html, Size: 3182 bytes --]

             reply	other threads:[~2022-04-26  8:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 23:38 Björn Svensson A [this message]
2022-04-28 10:34 ` David Marchand
2022-04-28 17:03 ` Konstantin Ananyev
2022-05-02 14:28   ` Björn Svensson A
2022-05-03 23:17     ` Konstantin Ananyev

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=DB9P189MB1833A7A2AF6CBF68D14F4070B9F89@DB9P189MB1833.EURP189.PROD.OUTLOOK.COM \
    --to=bjorn.a.svensson@est.tech \
    --cc=dev@dpdk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).