DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Marat Khalili <marat.khalili@huawei.com>
Cc: <dev@dpdk.org>
Subject: Re: [PATCH v5 00/11] bpf: introduce extensible load API
Date: Fri, 12 Jun 2026 09:06:36 -0700	[thread overview]
Message-ID: <20260612090636.10d8bf26@phoenix.local> (raw)
In-Reply-To: <20260612084219.38399-1-marat.khalili@huawei.com>

On Fri, 12 Jun 2026 09:42:07 +0100
Marat Khalili <marat.khalili@huawei.com> wrote:

> This patchset introduces an extensible load API for the BPF library in
> DPDK, addressing current limitations regarding ABI stability and feature
> constraints.
> 
> Currently, `rte_bpf_load` relies on a fixed `struct rte_bpf_prm`, which
> makes it difficult to add new loading options or parameters without
> breaking the ABI.
> 
> To resolve these issues, this series introduces `rte_bpf_load_ex` taking
> `struct rte_bpf_prm_ex`. The new parameter structure includes a `sz`
> field for backward compatibility, allowing future extensions.
> 
> Taking advantage of the new extensible API, this patchset also adds
> several new features:
> * Support for loading and executing BPF programs with up to 5 arguments.
> * Support for loading classic BPF (cBPF) directly.
> * Support for loading ELF files directly from memory buffers.
> * New API functions (`rte_bpf_eth_rx_install` and `rte_bpf_eth_tx_install`)
>   to install an already loaded BPF program as a port callback, decoupling
>   the loading phase from the installation phase.
> 
> 
> v5:
> * Fixed compilation between commits broken in v4 while addressing AI
>   comments.
> * Rebased on fresh main, addressing conflicts in release notes.
> 
> v4:
> * Restored missing NULL checks in wrapper functions `rte_bpf_load` and
>   `rte_bpf_elf_load`.
> * Fixed the burst execution functions (`rte_bpf_exec_burst*`) to return
>   `0` and set `rte_errno = EINVAL` on failure, preventing `-EINVAL`
>   being reinterpreted as a large `uint32_t` value. Initialized `rc`
>   properly in scalar execution wrappers for this case.
> * Swapped the Doxygen comments in `rte_bpf_ethdev.h` for RX and TX functions.
> * Added diagnostic dump on failure path in `test_bpf_filter`.
> * Fixed memory leak of the BPF handle in `bpf_rx_test` upon install failure.
> * Added tests for NULL parameter rejection, mismatched execution arguments,
>   unsupported execution flags, and the libpcap-less `rte_bpf_convert` stub.
> 
> v3:
> * Appended Acked-by tags to all individual commits to align with
>   patchwork requirements.
> 
> v2:
> * Fixed a potential segmentation fault in `exec_vm_burst_ex` by deferring
>   the dereference of `ctx[i].arg` until it is confirmed that `nb_prog_arg > 0`.
> * Clarified documentation and code comments for `RTE_BPF_EXEC_FLAG_JIT`
>   requirements and fast-path expectations.
> 
> 
> Marat Khalili (11):
>   bpf: make logging prefixes more consistent
>   bpf: introduce extensible load API
>   bpf: support up to 5 arguments
>   bpf: add cBPF origin to rte_bpf_load_ex
>   bpf: support rte_bpf_prm_ex with port callbacks
>   bpf: support loading ELF files from memory
>   test/bpf: test loading cBPF directly
>   test/bpf: test loading ELF file from memory
>   doc: add release notes for new extensible BPF API
>   doc: add load API to BPF programmer's guide
>   test/bpf: add tests for error handling contracts
> 
>  app/test/test_bpf.c                    | 455 +++++++++++++++++--------
>  doc/guides/prog_guide/bpf_lib.rst      |  75 +++-
>  doc/guides/rel_notes/release_26_07.rst |  20 ++
>  lib/bpf/bpf.c                          |  32 +-
>  lib/bpf/bpf_convert.c                  |  99 +++++-
>  lib/bpf/bpf_exec.c                     | 134 +++++++-
>  lib/bpf/bpf_impl.h                     |  53 ++-
>  lib/bpf/bpf_jit_arm64.c                |  18 +-
>  lib/bpf/bpf_jit_x86.c                  |  10 +-
>  lib/bpf/bpf_load.c                     | 213 ++++++++++--
>  lib/bpf/bpf_load_elf.c                 | 189 ++++++----
>  lib/bpf/bpf_pkt.c                      |  65 +++-
>  lib/bpf/bpf_stub.c                     |  46 ---
>  lib/bpf/bpf_validate.c                 |  94 +++--
>  lib/bpf/meson.build                    |  15 +-
>  lib/bpf/rte_bpf.h                      | 199 ++++++++++-
>  lib/bpf/rte_bpf_ethdev.h               |  54 +++
>  17 files changed, 1400 insertions(+), 371 deletions(-)
>  delete mode 100644 lib/bpf/bpf_stub.c
> 

Detailed AI review found some minor things:

02/11: comment grammar nits — "Any features that not known to
the application" -> "that are not known" (twice); "the size of
same struct" -> "the size of the same struct".

05/11: Doxygen for rte_bpf_eth_rx_install and
rte_bpf_eth_tx_install references rte_bpf_eth_unload, which does
not exist. Use rte_bpf_eth_rx_unload and rte_bpf_eth_tx_unload
respectively.

07/11: stray space before comma in the test_bpf_filter log
string ("for \"%s\" ,").

      parent reply	other threads:[~2026-06-12 16:06 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 17:21 [PATCH 00/10] bpf: introduce extensible load API Marat Khalili
2026-05-06 17:21 ` [PATCH 01/10] bpf: make logging prefixes more consistent Marat Khalili
2026-05-06 17:21 ` [PATCH 02/10] bpf: introduce extensible load API Marat Khalili
2026-05-06 17:22 ` [PATCH 03/10] bpf: support up to 5 arguments Marat Khalili
2026-05-06 17:22 ` [PATCH 04/10] bpf: add cBPF origin to rte_bpf_load_ex Marat Khalili
2026-05-06 17:22 ` [PATCH 05/10] bpf: support rte_bpf_prm_ex with port callbacks Marat Khalili
2026-05-06 17:22 ` [PATCH 06/10] bpf: support loading ELF files from memory Marat Khalili
2026-05-06 17:22 ` [PATCH 07/10] test/bpf: test loading cBPF directly Marat Khalili
2026-05-06 17:22 ` [PATCH 08/10] test/bpf: test loading ELF file from memory Marat Khalili
2026-05-06 17:22 ` [PATCH 09/10] doc: add release notes for new extensible BPF API Marat Khalili
2026-05-06 17:22 ` [PATCH 10/10] doc: add load API to BPF programmer's guide Marat Khalili
2026-05-09 12:36 ` [PATCH 00/10] bpf: introduce extensible load API Konstantin Ananyev
2026-05-14  9:37 ` [PATCH v2 " Marat Khalili
2026-05-14  9:37   ` [PATCH v2 01/10] bpf: make logging prefixes more consistent Marat Khalili
2026-05-14  9:37   ` [PATCH v2 02/10] bpf: introduce extensible load API Marat Khalili
2026-05-14  9:37   ` [PATCH v2 03/10] bpf: support up to 5 arguments Marat Khalili
2026-05-14  9:37   ` [PATCH v2 04/10] bpf: add cBPF origin to rte_bpf_load_ex Marat Khalili
2026-05-14  9:37   ` [PATCH v2 05/10] bpf: support rte_bpf_prm_ex with port callbacks Marat Khalili
2026-05-14  9:37   ` [PATCH v2 06/10] bpf: support loading ELF files from memory Marat Khalili
2026-05-14  9:37   ` [PATCH v2 07/10] test/bpf: test loading cBPF directly Marat Khalili
2026-05-14  9:37   ` [PATCH v2 08/10] test/bpf: test loading ELF file from memory Marat Khalili
2026-05-14  9:37   ` [PATCH v2 09/10] doc: add release notes for new extensible BPF API Marat Khalili
2026-05-14  9:37   ` [PATCH v2 10/10] doc: add load API to BPF programmer's guide Marat Khalili
2026-05-18  8:49   ` [PATCH v3 00/10] bpf: introduce extensible load API Marat Khalili
2026-05-18  8:49     ` [PATCH v3 01/10] bpf: make logging prefixes more consistent Marat Khalili
2026-05-18  8:49     ` [PATCH v3 02/10] bpf: introduce extensible load API Marat Khalili
2026-05-18 17:56       ` Stephen Hemminger
2026-05-18  8:49     ` [PATCH v3 03/10] bpf: support up to 5 arguments Marat Khalili
2026-05-18  8:49     ` [PATCH v3 04/10] bpf: add cBPF origin to rte_bpf_load_ex Marat Khalili
2026-05-18  8:49     ` [PATCH v3 05/10] bpf: support rte_bpf_prm_ex with port callbacks Marat Khalili
2026-05-18  8:49     ` [PATCH v3 06/10] bpf: support loading ELF files from memory Marat Khalili
2026-05-18  8:49     ` [PATCH v3 07/10] test/bpf: test loading cBPF directly Marat Khalili
2026-05-18  8:49     ` [PATCH v3 08/10] test/bpf: test loading ELF file from memory Marat Khalili
2026-05-18  8:49     ` [PATCH v3 09/10] doc: add release notes for new extensible BPF API Marat Khalili
2026-05-18  8:49     ` [PATCH v3 10/10] doc: add load API to BPF programmer's guide Marat Khalili
2026-05-20 12:49     ` [PATCH v4 00/11] bpf: introduce extensible load API Marat Khalili
2026-05-20 12:49       ` [PATCH v4 01/11] bpf: make logging prefixes more consistent Marat Khalili
2026-05-20 12:49       ` [PATCH v4 02/11] bpf: introduce extensible load API Marat Khalili
2026-06-10 14:46         ` Thomas Monjalon
2026-06-12 10:48           ` Marat Khalili
2026-05-20 12:49       ` [PATCH v4 03/11] bpf: support up to 5 arguments Marat Khalili
2026-05-20 12:49       ` [PATCH v4 04/11] bpf: add cBPF origin to rte_bpf_load_ex Marat Khalili
2026-05-20 12:49       ` [PATCH v4 05/11] bpf: support rte_bpf_prm_ex with port callbacks Marat Khalili
2026-05-20 12:49       ` [PATCH v4 06/11] bpf: support loading ELF files from memory Marat Khalili
2026-05-20 12:49       ` [PATCH v4 07/11] test/bpf: test loading cBPF directly Marat Khalili
2026-05-20 12:49       ` [PATCH v4 08/11] test/bpf: test loading ELF file from memory Marat Khalili
2026-05-20 12:49       ` [PATCH v4 09/11] doc: add release notes for new extensible BPF API Marat Khalili
2026-05-20 12:49       ` [PATCH v4 10/11] doc: add load API to BPF programmer's guide Marat Khalili
2026-05-20 12:49       ` [PATCH v4 11/11] test/bpf: add tests for error handling contracts Marat Khalili
2026-06-12  8:42       ` [PATCH v5 00/11] bpf: introduce extensible load API Marat Khalili
2026-06-12  8:42         ` [PATCH v5 01/11] bpf: make logging prefixes more consistent Marat Khalili
2026-06-12  8:42         ` [PATCH v5 02/11] bpf: introduce extensible load API Marat Khalili
2026-06-12  8:42         ` [PATCH v5 03/11] bpf: support up to 5 arguments Marat Khalili
2026-06-12  8:42         ` [PATCH v5 04/11] bpf: add cBPF origin to rte_bpf_load_ex Marat Khalili
2026-06-12  8:42         ` [PATCH v5 05/11] bpf: support rte_bpf_prm_ex with port callbacks Marat Khalili
2026-06-12  8:42         ` [PATCH v5 06/11] bpf: support loading ELF files from memory Marat Khalili
2026-06-12  8:42         ` [PATCH v5 07/11] test/bpf: test loading cBPF directly Marat Khalili
2026-06-12  8:42         ` [PATCH v5 08/11] test/bpf: test loading ELF file from memory Marat Khalili
2026-06-12  8:42         ` [PATCH v5 09/11] doc: add release notes for new extensible BPF API Marat Khalili
2026-06-12  8:42         ` [PATCH v5 10/11] doc: add load API to BPF programmer's guide Marat Khalili
2026-06-12  8:42         ` [PATCH v5 11/11] test/bpf: add tests for error handling contracts Marat Khalili
2026-06-12 16:06         ` Stephen Hemminger [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=20260612090636.10d8bf26@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=marat.khalili@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox