zexapod
zexapod

Reputation: 45

What are bpf maps used for?

Can eBPF maps be used to share information between two functions?

For example: get process name from one function; and if processname == "something" drop the packet using XDP.

An example would be appreciated.

Upvotes: 0

Views: 574

Answers (2)

Qeole
Qeole

Reputation: 9114

Adding two reference links to pchaigno's answer, ebpf.io and Cilium's BPF and XDP reference guide.

Upvotes: 1

pchaigno
pchaigno

Reputation: 13063

BPF maps are used to retain information between two executions of BPF programs. So what you're describing is one possible use case.

Examples of map usage can be found in the Linux samples and in the bcc examples.

Upvotes: 3

Related Questions