xdp-project / xdp-tutorial

XDP tutorial
2.51k stars 582 forks source link

How to fill tail call map entries at userspace #447

Open pvvm opened 1 week ago

pvvm commented 1 week ago

Hello, I was trying to fill a BPF_MAP_TYPE_PROG_ARRAY map in userspace to execute tail calls. However, after loading and attaching the caller and callee eBPF functions, retrieving the file descriptor of the map, and updating its entry with the callee program's file descriptor, a "Killed" message is printed. bpf_map_update_elem(tail_map_fd, &key, &callee_prog_fd, 0)); Am I missing anything?

tohojo commented 1 week ago

Pedro Mizuno @.***> writes:

Hello, I was trying to fill a BPF_MAP_TYPE_PROG_ARRAY map in userspace to execute tail calls. However, after loading and attaching the caller and callee eBPF functions, retrieving the file descriptor of the map, and updating its entry with the callee program's file descriptor, a "Killed" message is printed. bpf_map_update_elem(tail_map_fd, &key, &callee_prog_fd, 0)); Am I missing anything?

A "killed" message, as in the whole userspace application is killed? That sounds like a segmentation fault, not a BPF-specific error. A debugger should be able to shed some light on where that is coming from...