Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eunomia-bpf/xdp-ebpf-in-dpdk
XDP in DPDK with userspace eBPF (Move to https://github.com/userspace-xdp/userspace-xdp
https://github.com/eunomia-bpf/xdp-ebpf-in-dpdk
dpdk ebpf xdp
Last synced: about 2 months ago
JSON representation
XDP in DPDK with userspace eBPF (Move to https://github.com/userspace-xdp/userspace-xdp
- Host: GitHub
- URL: https://github.com/eunomia-bpf/xdp-ebpf-in-dpdk
- Owner: eunomia-bpf
- Archived: true
- Created: 2024-01-28T18:24:02.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-09-11T16:18:11.000Z (2 months ago)
- Last Synced: 2024-09-25T21:59:20.227Z (about 2 months ago)
- Topics: dpdk, ebpf, xdp
- Language: C
- Homepage: https://eunomia.dev/bpftime/
- Size: 1.96 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# XDP in userspace eBPF with DPDK
The repo is moved to https://github.com/userspace-xdp/userspace-xdp
## XDP examples: libbpf-bootstrap
Use libbpf-bootsrap to load xdp program in userspace.
### Run xdp-observer
Run in kernel
```console
make -C xdp-observer
# xdp-observer/main ens33
Source IP, Destination IP, Source Port, Destination Port, SIN, FIN, RST, PSH, ACK
10.0.0.1 10.0.0.10 44698 8000 1 0 0 0 0
10.0.0.1 10.0.0.10 44698 8000 1 0 0 0 0
10.0.0.1 10.0.0.10 44698 8000 1 0 0 0 0
10.0.0.1 10.0.0.10 44698 8000 1 0 0 0 0
```Run in userspace with bpftime
```console
# LD_PRELOAD=build-bpftime/bpftime/runtime/syscall-server/libbpftime-syscall-server.so SPDLOG_LEVEL=error xdp-observer/main veth0 xdp-observer/userspace.btf
Successfully started! Please Ctrl+C to stop.
Source IP, Destination IP, Source Port, Destination Port, SIN, FIN, RST, PSH, ACK
10.0.0.1 10.0.0.10 44698 8000 1 0 0 0 0
10.0.0.1 10.0.0.10 44698 8000 1 0 0 0 0
10.0.0.1 10.0.0.10 44698 8000 1 0 0 0 0
10.0.0.1 10.0.0.10 44698 8000 1 0 0 0 0
^CTerminating
```Test
```sh
```
## Compile and run
To get and build dpdk from the root project directory:
(Also add bpftime in the directory)
```sh
git submodule update --init --recursive
make dpdk
```build bpftime library
```sh
export PKG_CONFIG_PATH=
cmake -B build-bpftime .
make -C build-bpftime
```To build the dpdk-based server:
```sh
export PKG_CONFIG_PATH=
# e.g. export PKG_CONFIG_PATH=/home/yunwei37/XDP-eBPF-in-DPDK/external/dpdk/install-dir/lib/x86_64-linux-gnu/pkgconfig
make build
```To run a very simple test:
In one terminal window
```sh
sudo ./build/base-server -l 0 --vdev=net_tap0,iface=tapdpdk
```In another terminal window:
```sh
sudo ./scripts/testbed-setup.sh
sudo arping -i veth0 1.2.3.4
```## clean up share memory
```sh
sudo build-bpftime/bpftime/tools/bpftimetool/bpftimetool remove
```