Skip to content

Commit

Permalink
fix: wrong supported program types for xdp xfrm kfuncs (#96)
Browse files Browse the repository at this point in the history
This commit fixes the list of associated program types for the xdp xfrm kfuncs. The subsequent regeneration also corrected the newly added `BPF_PROG_TYPE_SCHED_ACT` page and hid_bpf_* kfunc pages.
  • Loading branch information
ianchen0119 authored Dec 5, 2024
1 parent 123eaae commit bcc6c65
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 25 deletions.
22 changes: 11 additions & 11 deletions data/kfuncs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ sets:
- BPF_PROG_TYPE_TRACING
attach_type:
- BPF_TRACE_ITER

fs_kfunc_set_ids:
funcs:
- name: bpf_get_file_xattr
flags: [KF_SLEEPABLE, KF_TRUSTED_ARGS]
program_types:
- BPF_PROG_TYPE_LSM

cpumask_kfunc_btf_ids:
cpumask_kfunc_btf_ids:
funcs:
- name: bpf_cpumask_create
flags: [KF_ACQUIRE, KF_RET_NULL]
Expand Down Expand Up @@ -88,7 +88,7 @@ sets:
- BPF_PROG_TYPE_STRUCT_OPS

generic_btf_ids:
funcs:
funcs:
- name: crash_kexec
flags: [KF_DESTRUCTIVE]
- name: bpf_obj_new_impl
Expand Down Expand Up @@ -132,11 +132,11 @@ sets:
flags: [KF_ACQUIRE, KF_RET_NULL]
- name: bpf_throw
program_types:
- BPF_PROG_TYPE_TRACING
- BPF_PROG_TYPE_LSM
- BPF_PROG_TYPE_SCHED_CLS
- BPF_PROG_TYPE_XDP
- BPF_PROG_TYPE_STRUCT_OPS
- BPF_PROG_TYPE_TRACING
- BPF_PROG_TYPE_LSM
- BPF_PROG_TYPE_SCHED_CLS
- BPF_PROG_TYPE_XDP
- BPF_PROG_TYPE_STRUCT_OPS

common_btf_ids:
funcs:
Expand Down Expand Up @@ -206,7 +206,7 @@ sets:

fsverity_set_ids:
funcs:
- name: bpf_get_fsverity_digest
- name: bpf_get_fsverity_digest
flags: [KF_TRUSTED_ARGS]
program_types:
- BPF_PROG_TYPE_LSM
Expand Down Expand Up @@ -248,7 +248,7 @@ sets:
- BPF_PROG_TYPE_CGROUP_SOCK_ADDR

bpf_sk_iter_kfunc_ids:
funcs:
funcs:
- name: bpf_sock_destroy
flags: [KF_TRUSTED_ARGS]
program_types:
Expand Down Expand Up @@ -356,7 +356,7 @@ sets:
- name: bpf_xdp_xfrm_state_release
flags: [KF_RELEASE]
program_types:
- BPF_PROG_TYPE_SCHED_CLS
- BPF_PROG_TYPE_XDP

hid_bpf_kfunc_ids:
funcs:
Expand Down
2 changes: 1 addition & 1 deletion docs/linux/kfuncs/bpf_xdp_get_xfrm_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ This kfunc helper accesses internal `xfrm_state` associated with an SA(Security
The following program types can make use of this kfunc:

<!-- [KFUNC_PROG_REF] -->
- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md)
- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md)
<!-- [/KFUNC_PROG_REF] -->

### Example
Expand Down
2 changes: 1 addition & 1 deletion docs/linux/kfuncs/bpf_xdp_xfrm_state_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The intent for this kfunc is to support software RSS (via XDP) for the ongoing/u
The following program types can make use of this kfunc:

<!-- [KFUNC_PROG_REF] -->
- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md)
- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md)
<!-- [/KFUNC_PROG_REF] -->

### Example
Expand Down
3 changes: 2 additions & 1 deletion docs/linux/kfuncs/hid_bpf_allocate_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ A pointer to &struct hid_bpf_ctx on success, `NULL` on error.
The following program types can make use of this kfunc:

<!-- [KFUNC_PROG_REF] -->
- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md)
- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md)
- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md)
<!-- [/KFUNC_PROG_REF] -->

### Example
Expand Down
3 changes: 2 additions & 1 deletion docs/linux/kfuncs/hid_bpf_hw_output_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ Returns the number of bytes transferred on success, a negative error code otherw
The following program types can make use of this kfunc:

<!-- [KFUNC_PROG_REF] -->
- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md)
- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md)
- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md)
<!-- [/KFUNC_PROG_REF] -->

### Example
Expand Down
3 changes: 2 additions & 1 deletion docs/linux/kfuncs/hid_bpf_hw_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ Communicate with a HID device
The following program types can make use of this kfunc:

<!-- [KFUNC_PROG_REF] -->
- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md)
- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md)
- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md)
<!-- [/KFUNC_PROG_REF] -->

### Example
Expand Down
3 changes: 2 additions & 1 deletion docs/linux/kfuncs/hid_bpf_input_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ Returns `0` on success, a negative error code otherwise. This function will wait
The following program types can make use of this kfunc:

<!-- [KFUNC_PROG_REF] -->
- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md)
- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md)
- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md)
<!-- [/KFUNC_PROG_REF] -->

### Example
Expand Down
3 changes: 2 additions & 1 deletion docs/linux/kfuncs/hid_bpf_release_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Release the previously allocated context @ctx
The following program types can make use of this kfunc:

<!-- [KFUNC_PROG_REF] -->
- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md)
- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md)
- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md)
<!-- [/KFUNC_PROG_REF] -->

### Example
Expand Down
43 changes: 38 additions & 5 deletions docs/linux/program-type/BPF_PROG_TYPE_SCHED_ACT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "This page documents the 'BPF_PROG_TYPE_SCHED_ACT' eBPF program typ
# Program type `BPF_PROG_TYPE_SCHED_ACT`

<!-- [FEATURE_TAG](BPF_PROG_TYPE_SCHED_CLS) -->
[:octicons-tag-24: v4.1](https://github.com/torvalds/linux/commit/94caee8c312d)
[:octicons-tag-24: v4.1](https://github.com/torvalds/linux/commit/96be4325f443dbbfeb37d2a157675ac0736531a1)
<!-- [/FEATURE_TAG] -->

This program type allows for the implementation of a Traffic Control (TC) action in eBPF.
Expand Down Expand Up @@ -194,10 +194,6 @@ Not all helper functions are available in all program types. These are the helpe
* [`bpf_task_pt_regs`](../helper-function/bpf_task_pt_regs.md)
* [`bpf_tcp_check_syncookie`](../helper-function/bpf_tcp_check_syncookie.md)
* [`bpf_tcp_gen_syncookie`](../helper-function/bpf_tcp_gen_syncookie.md)
* [`bpf_tcp_raw_check_syncookie_ipv4`](../helper-function/bpf_tcp_raw_check_syncookie_ipv4.md)
* [`bpf_tcp_raw_check_syncookie_ipv6`](../helper-function/bpf_tcp_raw_check_syncookie_ipv6.md)
* [`bpf_tcp_raw_gen_syncookie_ipv4`](../helper-function/bpf_tcp_raw_gen_syncookie_ipv4.md)
* [`bpf_tcp_raw_gen_syncookie_ipv6`](../helper-function/bpf_tcp_raw_gen_syncookie_ipv6.md)
* [`bpf_tcp_sock`](../helper-function/bpf_tcp_sock.md)
* [`bpf_this_cpu_ptr`](../helper-function/bpf_this_cpu_ptr.md)
* [`bpf_timer_cancel`](../helper-function/bpf_timer_cancel.md)
Expand All @@ -213,7 +209,44 @@ Not all helper functions are available in all program types. These are the helpe

<!-- [PROG_KFUNC_REF] -->
??? abstract "Supported kfuncs"
- [`bpf_arena_alloc_pages`](../kfuncs/bpf_arena_alloc_pages.md)
- [`bpf_arena_free_pages`](../kfuncs/bpf_arena_free_pages.md)
- [`bpf_cast_to_kern_ctx`](../kfuncs/bpf_cast_to_kern_ctx.md)
- [`bpf_crypto_decrypt`](../kfuncs/bpf_crypto_decrypt.md)
- [`bpf_crypto_encrypt`](../kfuncs/bpf_crypto_encrypt.md)
- [`bpf_dynptr_adjust`](../kfuncs/bpf_dynptr_adjust.md)
- [`bpf_dynptr_clone`](../kfuncs/bpf_dynptr_clone.md)
- [`bpf_dynptr_from_skb`](../kfuncs/bpf_dynptr_from_skb.md)
- [`bpf_dynptr_is_null`](../kfuncs/bpf_dynptr_is_null.md)
- [`bpf_dynptr_is_rdonly`](../kfuncs/bpf_dynptr_is_rdonly.md)
- [`bpf_dynptr_size`](../kfuncs/bpf_dynptr_size.md)
- [`bpf_dynptr_slice`](../kfuncs/bpf_dynptr_slice.md)
- [`bpf_dynptr_slice_rdwr`](../kfuncs/bpf_dynptr_slice_rdwr.md)
- [`bpf_iter_bits_destroy`](../kfuncs/bpf_iter_bits_destroy.md)
- [`bpf_iter_bits_new`](../kfuncs/bpf_iter_bits_new.md)
- [`bpf_iter_bits_next`](../kfuncs/bpf_iter_bits_next.md)
- [`bpf_iter_css_destroy`](../kfuncs/bpf_iter_css_destroy.md)
- [`bpf_iter_css_new`](../kfuncs/bpf_iter_css_new.md)
- [`bpf_iter_css_next`](../kfuncs/bpf_iter_css_next.md)
- [`bpf_iter_css_task_destroy`](../kfuncs/bpf_iter_css_task_destroy.md)
- [`bpf_iter_css_task_new`](../kfuncs/bpf_iter_css_task_new.md)
- [`bpf_iter_css_task_next`](../kfuncs/bpf_iter_css_task_next.md)
- [`bpf_iter_num_destroy`](../kfuncs/bpf_iter_num_destroy.md)
- [`bpf_iter_num_new`](../kfuncs/bpf_iter_num_new.md)
- [`bpf_iter_num_next`](../kfuncs/bpf_iter_num_next.md)
- [`bpf_iter_task_destroy`](../kfuncs/bpf_iter_task_destroy.md)
- [`bpf_iter_task_new`](../kfuncs/bpf_iter_task_new.md)
- [`bpf_iter_task_next`](../kfuncs/bpf_iter_task_next.md)
- [`bpf_iter_task_vma_destroy`](../kfuncs/bpf_iter_task_vma_destroy.md)
- [`bpf_iter_task_vma_new`](../kfuncs/bpf_iter_task_vma_new.md)
- [`bpf_iter_task_vma_next`](../kfuncs/bpf_iter_task_vma_next.md)
- [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md)
- [`bpf_preempt_disable`](../kfuncs/bpf_preempt_disable.md)
- [`bpf_preempt_enable`](../kfuncs/bpf_preempt_enable.md)
- [`bpf_rcu_read_lock`](../kfuncs/bpf_rcu_read_lock.md)
- [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md)
- [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md)
- [`bpf_wq_init`](../kfuncs/bpf_wq_init.md)
- [`bpf_wq_set_callback_impl`](../kfuncs/bpf_wq_set_callback_impl.md)
- [`bpf_wq_start`](../kfuncs/bpf_wq_start.md)
<!-- [/PROG_KFUNC_REF] -->
2 changes: 0 additions & 2 deletions docs/linux/program-type/BPF_PROG_TYPE_SCHED_CLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,5 @@ Not all helper functions are available in all program types. These are the helpe
- [`bpf_wq_start`](../kfuncs/bpf_wq_start.md)
- [`bpf_xdp_ct_alloc`](../kfuncs/bpf_xdp_ct_alloc.md)
- [`bpf_xdp_ct_lookup`](../kfuncs/bpf_xdp_ct_lookup.md)
- [`bpf_xdp_get_xfrm_state`](../kfuncs/bpf_xdp_get_xfrm_state.md)
- [`bpf_xdp_xfrm_state_release`](../kfuncs/bpf_xdp_xfrm_state_release.md)
- [`crash_kexec`](../kfuncs/crash_kexec.md)
<!-- [/PROG_KFUNC_REF] -->
2 changes: 2 additions & 0 deletions docs/linux/program-type/BPF_PROG_TYPE_XDP.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,10 @@ Not all helper functions are available in all program types. These are the helpe
- [`bpf_xdp_ct_alloc`](../kfuncs/bpf_xdp_ct_alloc.md)
- [`bpf_xdp_ct_lookup`](../kfuncs/bpf_xdp_ct_lookup.md)
- [`bpf_xdp_flow_lookup`](../kfuncs/bpf_xdp_flow_lookup.md)
- [`bpf_xdp_get_xfrm_state`](../kfuncs/bpf_xdp_get_xfrm_state.md)
- [`bpf_xdp_metadata_rx_hash`](../kfuncs/bpf_xdp_metadata_rx_hash.md)
- [`bpf_xdp_metadata_rx_timestamp`](../kfuncs/bpf_xdp_metadata_rx_timestamp.md)
- [`bpf_xdp_metadata_rx_vlan_tag`](../kfuncs/bpf_xdp_metadata_rx_vlan_tag.md)
- [`bpf_xdp_xfrm_state_release`](../kfuncs/bpf_xdp_xfrm_state_release.md)
- [`crash_kexec`](../kfuncs/crash_kexec.md)
<!-- [/PROG_KFUNC_REF] -->

0 comments on commit bcc6c65

Please sign in to comment.