| 65d9b7c6 | 03-Nov-2021 |
Konstantin Ananyev <[email protected]> |
bpf: fix convert API when libpcap missing
rte_bpf_convert() implementation depends on libpcap. Right now it is defined only when this library is installed and RTE_PORT_PCAP is defined. Fix that by p
bpf: fix convert API when libpcap missing
rte_bpf_convert() implementation depends on libpcap. Right now it is defined only when this library is installed and RTE_PORT_PCAP is defined. Fix that by providing for such case stub rte_bpf_convert() implementation that will always return an error. To draw user attention, if proper implementation is disabled, warning will be thrown at meson configure stage. Also move stub for another function (rte_bpf_elf_load) into the same place (bpf_stub.c).
Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")
Signed-off-by: Konstantin Ananyev <[email protected]>
show more ...
|
| 2eccf6af | 20-Oct-2021 |
Stephen Hemminger <[email protected]> |
bpf: add function to convert classic BPF to DPDK BPF
The pcap library emits classic BPF (32 bit) and is useful for creating filter programs. The DPDK BPF library only implements extended BPF (eBPF)
bpf: add function to convert classic BPF to DPDK BPF
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 <[email protected]> Acked-by: Konstantin Ananyev <[email protected]> Acked-by: Ray Kinsella <[email protected]>
show more ...
|