[dpdk-dev] [PATCH v15 04/12] bpf: add function to convert classic BPF to DPDK BPF

Kinsella, Ray mdr at ashroe.eu
Thu Oct 21 16:15:21 CEST 2021



On 20/10/2021 22:42, Stephen Hemminger wrote:
> The pcap library emits classic BPF (32 bit) and is useful for
> creating filter programs.  The DPDK BPF library only implements
> extended BPF (eBPF).  Add an function to convert from old to
> new.
> 
> The rte_bpf_convert function uses rte_malloc to put the resulting
> program in hugepage shared memory so it can be passed from a
> secondary process to a primary process.
> 
> The code to convert was originally done as part of the Linux
> kernel implementation then converted to a userspace program.
> See https://github.com/tklauser/filter2xdp
> 
> Both authors have agreed that it is allowable to create a modified
> version of this code and license it with BSD license used by DPDK.
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
> ---
>   lib/bpf/bpf_convert.c | 575 ++++++++++++++++++++++++++++++++++++++++++
>   lib/bpf/meson.build   |   5 +
>   lib/bpf/rte_bpf.h     |  25 ++
>   lib/bpf/version.map   |   6 +
>   4 files changed, 611 insertions(+)
>   create mode 100644 lib/bpf/bpf_convert.c
> 

Acked-by: Ray Kinsella <mdr at ashroe.eu>


More information about the dev mailing list