Questions tagged [libbpf]
53 questions
0
votes
1 answer
ebpf-tc: how to keep unique information inside a ebpf instance when same program is attached to multiple interface
When we pin a MAP, we can able to share information from userspace to ebpf but it is system wide.
But if i want to share different value to different instance from tc ingress/egress (array map with size of 1)
Is there any way to pass argument ?
Map…

mohamed.hanif
- 35
- 5
0
votes
1 answer
Empty value from bpf_map_lookup_elem while 'bpftool map dump' does
I have a bpf program storing some stats in a map via BPF_TYPE_MAP_ARRAY. That side of code seems to works correctly, I can use bpftool to see my map.
# bpftool map show
31: array name xdp_stats_map flags 0x0
key 4B value 16B max_entries…

Maxux
- 199
- 1
- 1
- 11
0
votes
1 answer
BPF lib documentation
I have created an app with BPF library(https://github.com/libbpf/libbpf). Unfortunately it does not have documentation or at least I have not found it yet. Only thing I have found is this https://libbpf.readthedocs.io/en/latest/api.html, but it does…

Zakys98
- 53
- 9
0
votes
1 answer
Error fixing up map structure, incompatible struct bpf_elf_map used?
I am trying to learn ebpf map. Compiling the code with libbpf but getting the error like "Error fixing up map structure, incompatible struct bpf_elf_map used?". Here is my ebpf code:
#include
#include
#include…

Omar Faroque Anik
- 2,531
- 1
- 29
- 42
-1
votes
0 answers
Issue while using bpf_map_update_elem() function for flow statistics
I am trying to record TCP flows - if new, create an entry into a hash map with the 5-tuple as the key and then push out a new flow event (identified by SYN flag).
The problem I encounter is with the function bpf_map_update_elem(). When I use this…

hundredmiles
- 61
- 6
-1
votes
1 answer
adding code to bpf _kernel.c file for uprobe SEC routines (libbpf +c)
I am trying function count for given executable and pattern. trying
to explore latest introduced API bpf_program__attach_uprobe_multi,
couldn't find example for the same.
below code failing with invalid argument.
added prints in libbpf code, looks…

nullptr
- 5
- 3
-1
votes
1 answer
are bpf_probe_read's atomic?
Are bpf_probe_read functions etc, atomic ? And do they inc ref counts of the data structure they're are reading, because if the operation is not atomic while the read is going through the kernel deallocates that data structure can it not cause a…