KFunc bpf_list_pop_front
Remove the entry at the beginning of the BPF linked list.
Definition
Returns
Pointer to bpf_list_node of deleted entry, or NULL if list is empty.
struct bpf_list_node *bpf_list_pop_front(struct bpf_list_head *head)
Note
This kfunc returns a pointer to a refcounted object. The verifier will then ensure that the pointer to the object
is eventually released using a release kfunc, or transferred to a map using a referenced kptr
(by invoking bpf_kptr_xchg
). If not, the verifier fails the
loading of the BPF program until no lingering references remain in all possible explored states of the program.
Note
The pointer returned by the kfunc may be NULL. Hence, it forces the user to do a NULL check on the pointer returned from the kfunc before making use of it (dereferencing or passing to another helper).
Usage
Docs could be improved
This part of the docs is incomplete, contributions are very welcome
Program types
The following program types can make use of this kfunc:
BPF_PROG_TYPE_LSM
BPF_PROG_TYPE_SCHED_CLS
BPF_PROG_TYPE_STRUCT_OPS
BPF_PROG_TYPE_TRACING
BPF_PROG_TYPE_XDP
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome