-
Notifications
You must be signed in to change notification settings - Fork 22
Userspace eBPF
Peihao Yang edited this page Feb 23, 2022
·
1 revision
Sentinel can be integrated into a userspace eBPF program, for flow control at the early stage. The eBPF part is based on redbpf
.
It is recommended to install llvm-13 in advance. Because the Makefile is written with the expectation that llvm-13 is installed. Otherwise, you may change the Makefile according to your environment.
The basic idea for sentinel integration is to use eBPF map to interact with kernel eBPF probes and listen to kernel events.
- probe: A flow control demo based on xdp. The sentinel resource is named after
port:{destination_port_id}
. The corresponding kernel probe and user program are implemented inexamples/ebpf/probes/src/port
andexamples/ebpf/userspace/src
. Runmake ebpf_port
in root directory to verify it.
Examples on other kernel events are welcomed. Currently, the redbpf
supports KProbe
, KRetProbe
, UProbe
, URetProbe
, SocketFilter
, XDP
, StreamParser
, StreamVerdict
, TaskIter
, SkLookup
.