Skip to content

Tail call program removed from PROG_ARRAY #578

Answered by ti-mo
yasir-ss asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @yasir-ss. Sorry, but what you're describing wrt. removing the call to bpf_ringbuf_output() doesn't make much sense. As long as you keep your program running, tail_prog will remain loaded in the kernel, and will remain in jump_table at slot 0.

BPF objects' lifecycles are tied to the process that created them, except when they are attached to another kernel object (like you're doing here with XDP) or pinned to bpffs. The thing that's biting you here is that PROG_ARRAYs get cleared (not removed) when their last userspace reference disappears, or when its last bpffs pin is removed. Since XDP references main_prog, which references jump_table, the tail call map is not deallocated, so you ca…

Replies: 3 comments 18 replies

Comment options

You must be logged in to vote
1 reply
@yasir-ss
Comment options

Comment options

You must be logged in to vote
9 replies
@yasir-ss
Comment options

@yasir-ss
Comment options

@ti-mo
Comment options

@sivaaraali
Comment options

@ti-mo
Comment options

Answer selected by ti-mo
Comment options

You must be logged in to vote
8 replies
@yasir-ss
Comment options

@ti-mo
Comment options

@dylandreimerink
Comment options

@yasir-ss
Comment options

@ti-mo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #577 on February 21, 2022 10:49.