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 <step...@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.anan...@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 <m...@ashroe.eu>

Reply via email to