diff --git a/.aspell.en.pws b/.aspell.en.pws index 2b24b68..e1d18ba 100644 --- a/.aspell.en.pws +++ b/.aspell.en.pws @@ -230,4 +230,17 @@ programmatically tc tcx Netkit -netkit \ No newline at end of file +netkit +sched +scx +IRQ +IRQs +DSQ +DSQs +natively +enqueue +enqueued +enqueues +variadic +cpumask +scalable diff --git a/Makefile b/Makefile index c3edd51..a959908 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ clear-html: .PHONY: serve serve: - docker run --rm -p 8000:8000 -v "${REPODIR}:/docs" \ + docker run --rm -p 8000:8000 -it -v "${REPODIR}:/docs" \ -e "PROD=${PROD}" -e "GH_TOKEN=${GH_TOKEN}" \ -w /docs -e "AS_USER=$$(id -u $${USER})" -e "AS_GROUP=$$(id -g $${USER})" \ "${IMAGE}:${VERSION}" "mkdocs serve -a 0.0.0.0:8000 --watch /docs/docs" diff --git a/data/feature-versions.yaml b/data/feature-versions.yaml index 1cea25c..e62889f 100644 --- a/data/feature-versions.yaml +++ b/data/feature-versions.yaml @@ -2086,3 +2086,204 @@ - name: bpf_sk_assign_tcp_reqsk version: v6.11 commit: e472f88891abbc535a5e16a68a104073985f6061 + - name: bpf_task_from_vpid + version: v6.13 + commit: 675c3596ff32c040d1dd2e28dd57e83e634b9f60 + - name: bpf_send_signal_task + version: v6.13 + commit: 6280cf718db0c557b5fe44e2d2e8ad8e832696a7 + - name: bpf_copy_from_user_str + version: v6.12 + commit: 65ab5ac4df012388481d0414fcac1d5ac1721fb3 + - name: bpf_get_kmem_cache + version: v6.13 + commit: a992d7a3979120fbd7c13435d27b3da8d9ed095a + - name: bpf_iter_kmem_cache_new + version: v6.13 + commit: 2e9a548009c2d804e55cdd5b0e9903756cf7d9b3 + - name: bpf_iter_kmem_cache_next + version: v6.13 + commit: 2e9a548009c2d804e55cdd5b0e9903756cf7d9b3 + - name: bpf_iter_kmem_cache_destroy + version: v6.13 + commit: 2e9a548009c2d804e55cdd5b0e9903756cf7d9b3 + - name: bpf_local_irq_save + version: v6.14 + commit: c8e2ee1f3df05dc4caa746c062c6b5791c745c79 + - name: bpf_local_irq_restore + version: v6.14 + commit: c8e2ee1f3df05dc4caa746c062c6b5791c745c79 + - name: scx_bpf_select_cpu_dfl + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_dsq_insert + version: v6.13 + commit: cc26abb1a19adbb91b79d25a2e74976633ece429 + - name: scx_bpf_dsq_insert_vtime + version: v6.13 + commit: cc26abb1a19adbb91b79d25a2e74976633ece429 + - name: scx_bpf_dispatch + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_dispatch_vtime + version: v6.12 + commit: 06e51be3d5e7a07aea5c9012773df8d5de01db6c + - name: scx_bpf_dispatch_nr_slots + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_dispatch_cancel + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_dsq_move_to_local + version: v6.13 + commit: 5209c03c8ed215357a4827496a71fd32167d83ef + - name: scx_bpf_consume + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_dsq_move_set_slice + version: v6.13 + commit: 5cbb302880f50f3edf35f8c6a1d38b6948bf4d11 + - name: scx_bpf_dsq_move_set_vtime + version: v6.13 + commit: 5cbb302880f50f3edf35f8c6a1d38b6948bf4d11 + - name: scx_bpf_dispatch_from_dsq_set_slice + version: v6.12 + commit: 4c30f5ce4f7af4f639af99e0bdeada8b268b7361 + - name: scx_bpf_dispatch_from_dsq_set_vtime + version: v6.12 + commit: 4c30f5ce4f7af4f639af99e0bdeada8b268b7361 + - name: scx_bpf_dsq_move + version: v6.13 + commit: 5cbb302880f50f3edf35f8c6a1d38b6948bf4d11 + - name: scx_bpf_dsq_move_vtime + version: v6.13 + commit: 5cbb302880f50f3edf35f8c6a1d38b6948bf4d11 + - name: scx_bpf_dispatch_from_dsq + version: v6.12 + commit: 4c30f5ce4f7af4f639af99e0bdeada8b268b7361 + - name: scx_bpf_dispatch_vtime_from_dsq + version: v6.12 + commit: 4c30f5ce4f7af4f639af99e0bdeada8b268b7361 + - name: scx_bpf_reenqueue_local + version: v6.12 + commit: 245254f7081dbe1c8da54675d0e4ddbe74cee61b + - name: scx_bpf_dsq_move_set_slice + version: v6.13 + commit: 5cbb302880f50f3edf35f8c6a1d38b6948bf4d11 + - name: scx_bpf_dsq_move_set_vtime + version: v6.13 + commit: 5cbb302880f50f3edf35f8c6a1d38b6948bf4d11 + - name: scx_bpf_dispatch_from_dsq_set_slice + version: v6.12 + commit: 4c30f5ce4f7af4f639af99e0bdeada8b268b7361 + - name: scx_bpf_dispatch_from_dsq_set_vtime + version: v6.12 + commit: 4c30f5ce4f7af4f639af99e0bdeada8b268b7361 + - name: scx_bpf_create_dsq + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_dsq_move + version: v6.13 + commit: 5cbb302880f50f3edf35f8c6a1d38b6948bf4d11 + - name: scx_bpf_dsq_move_vtime + version: v6.13 + commit: 5cbb302880f50f3edf35f8c6a1d38b6948bf4d11 + - name: scx_bpf_dispatch_from_dsq + version: v6.12 + commit: 4c30f5ce4f7af4f639af99e0bdeada8b268b7361 + - name: scx_bpf_dispatch_vtime_from_dsq + version: v6.12 + commit: 4c30f5ce4f7af4f639af99e0bdeada8b268b7361 + - name: scx_bpf_kick_cpu + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_dsq_nr_queued + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_destroy_dsq + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: bpf_iter_scx_dsq_new + version: v6.12 + commit: 650ba21b131ed1f8ee57826b2c6295a3be221132 + - name: bpf_iter_scx_dsq_next + version: v6.12 + commit: 650ba21b131ed1f8ee57826b2c6295a3be221132 + - name: bpf_iter_scx_dsq_destroy + version: v6.12 + commit: 650ba21b131ed1f8ee57826b2c6295a3be221132 + - name: scx_bpf_exit_bstr + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_error_bstr + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_dump_bstr + version: v6.12 + commit: 07814a9439a3b03d79a1001614b5bc1cab69bcec + - name: scx_bpf_cpuperf_cap + version: v6.12 + commit: d86adb4fc0655a0867da811d000df75d2a325ef6 + - name: scx_bpf_cpuperf_cur + version: v6.12 + commit: d86adb4fc0655a0867da811d000df75d2a325ef6 + - name: scx_bpf_cpuperf_set + version: v6.12 + commit: d86adb4fc0655a0867da811d000df75d2a325ef6 + - name: scx_bpf_nr_cpu_ids + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_get_possible_cpumask + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_get_online_cpumask + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_put_cpumask + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_get_idle_cpumask + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_get_idle_smtmask + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_put_idle_cpumask + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_test_and_clear_cpu_idle + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_pick_idle_cpu + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_pick_any_cpu + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_task_running + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_task_cpu + version: v6.12 + commit: f0e1a0643a59bf1f922fa209cec86a170b784f3f + - name: scx_bpf_cpu_rq + version: v6.12 + commit: 6203ef73fa5c0358f7960b038628259be1448724 + - name: scx_bpf_task_cgroup + version: v6.12 + commit: 8195136669661fdfe54e9a8923c33b31c92fc1da + - name: scx_bpf_now + version: v6.14 + commit: 3a9910b5904d29c566e3ff9290990b519827ba75 + - name: bpf_get_task_exe_file + version: v6.12 + commit: d08e2045ebf0f5f2a97ad22cc7dae398b35354ba + - name: bpf_put_file + version: v6.12 + commit: d08e2045ebf0f5f2a97ad22cc7dae398b35354ba + - name: bpf_path_d_path + version: v6.12 + commit: d08e2045ebf0f5f2a97ad22cc7dae398b35354ba + - name: bpf_get_dentry_xattr + version: v6.12 + commit: ac13a4261afe81ca423eddd8e6571078fe2a7cea diff --git a/data/kfuncs.yaml b/data/kfuncs.yaml index 288add9..9afa1f8 100644 --- a/data/kfuncs.yaml +++ b/data/kfuncs.yaml @@ -5,8 +5,8 @@ sets: - name: cgroup_rstat_flush flags: [KF_SLEEPABLE] program_types: - - BPF_PROG_TYPE_TRACING - - BPF_PROG_TYPE_LSM + - name: BPF_PROG_TYPE_TRACING + - name: BPF_PROG_TYPE_LSM key_sig_kfunc_set: funcs: @@ -19,7 +19,7 @@ sets: - name: bpf_verify_pkcs7_signature flags: [KF_SLEEPABLE] program_types: - - BPF_PROG_TYPE_TRACING + - name: BPF_PROG_TYPE_TRACING attach_type: - BPF_TRACE_ITER @@ -28,7 +28,7 @@ sets: - name: bpf_get_file_xattr flags: [KF_SLEEPABLE, KF_TRUSTED_ARGS] program_types: - - BPF_PROG_TYPE_LSM + - name: BPF_PROG_TYPE_LSM cpumask_kfunc_btf_ids: funcs: @@ -83,9 +83,9 @@ sets: - name: bpf_cpumask_weight flags: [KF_RCU] program_types: - - BPF_PROG_TYPE_TRACING - - BPF_PROG_TYPE_LSM - - BPF_PROG_TYPE_STRUCT_OPS + - name: BPF_PROG_TYPE_TRACING + - name: BPF_PROG_TYPE_LSM + - name: BPF_PROG_TYPE_STRUCT_OPS generic_btf_ids: funcs: @@ -130,18 +130,24 @@ sets: flags: [KF_ACQUIRE, KF_RCU, KF_RET_NULL] - name: bpf_task_from_pid flags: [KF_ACQUIRE, KF_RET_NULL] + - name: bpf_task_from_vpid + flags: [KF_ACQUIRE, KF_RET_NULL] - name: bpf_throw + - name: bpf_send_signal_task + flags: [KF_TRUSTED_ARGS] program_types: - - BPF_PROG_TYPE_TRACING - - BPF_PROG_TYPE_LSM - - BPF_PROG_TYPE_SCHED_CLS - - BPF_PROG_TYPE_XDP - - BPF_PROG_TYPE_STRUCT_OPS + - name: BPF_PROG_TYPE_TRACING + - name: BPF_PROG_TYPE_LSM + - name: BPF_PROG_TYPE_SCHED_CLS + - name: BPF_PROG_TYPE_XDP + - name: BPF_PROG_TYPE_STRUCT_OPS common_btf_ids: funcs: - name: bpf_cast_to_kern_ctx + flags: [KF_FASTCALL] - name: bpf_rdonly_cast + flags: [KF_FASTCALL] - name: bpf_rcu_read_lock - name: bpf_rcu_read_unlock - name: bpf_dynptr_slice @@ -194,22 +200,33 @@ sets: flags: [KF_ITER_NEXT, KF_RET_NULL] - name: bpf_iter_bits_destroy flags: [KF_ITER_DESTROY] + - name: bpf_copy_from_user_str + flags: [KF_SLEEPABLE] + - name: bpf_get_kmem_cache + - name: bpf_iter_kmem_cache_new + flags: [KF_ITER_NEW, KF_SLEEPABLE] + - name: bpf_iter_kmem_cache_next + flags: [KF_ITER_NEXT, KF_RET_NULL, KF_SLEEPABLE] + - name: bpf_iter_kmem_cache_destroy + flags: [KF_ITER_DESTROY, KF_SLEEPABLE] + - name: bpf_local_irq_save + - name: bpf_local_irq_restore program_types: - - BPF_PROG_TYPE_UNSPEC + - name: BPF_PROG_TYPE_UNSPEC bpf_map_iter_kfunc_ids: funcs: - name: bpf_map_sum_elem_count flags: [KF_TRUSTED_ARGS] program_types: - - BPF_PROG_TYPE_UNSPEC + - name: BPF_PROG_TYPE_UNSPEC fsverity_set_ids: funcs: - name: bpf_get_fsverity_digest flags: [KF_TRUSTED_ARGS] program_types: - - BPF_PROG_TYPE_LSM + - name: BPF_PROG_TYPE_LSM xdp_metadata_kfunc_ids: funcs: @@ -217,42 +234,84 @@ sets: - name: bpf_xdp_metadata_rx_hash - name: bpf_xdp_metadata_rx_vlan_tag program_types: - - BPF_PROG_TYPE_XDP + - name: BPF_PROG_TYPE_XDP bpf_kfunc_check_set_skb: funcs: - name: bpf_dynptr_from_skb + flags: [KF_TRUSTED_ARGS] program_types: - - BPF_PROG_TYPE_SCHED_CLS - - BPF_PROG_TYPE_SCHED_ACT - - BPF_PROG_TYPE_SK_SKB - - BPF_PROG_TYPE_SOCKET_FILTER - - BPF_PROG_TYPE_CGROUP_SKB - - BPF_PROG_TYPE_LWT_OUT - - BPF_PROG_TYPE_LWT_IN - - BPF_PROG_TYPE_LWT_XMIT - - BPF_PROG_TYPE_LWT_SEG6LOCAL - - BPF_PROG_TYPE_NETFILTER + - name: BPF_PROG_TYPE_SCHED_CLS + - name: BPF_PROG_TYPE_SCHED_ACT + - name: BPF_PROG_TYPE_SK_SKB + - name: BPF_PROG_TYPE_SOCKET_FILTER + - name: BPF_PROG_TYPE_CGROUP_SKB + - name: BPF_PROG_TYPE_CGROUP_SOCK_ADDR + since: + version: 6.7 + commit: 53e380d21441909b12b6e0782b77187ae4b971c4 + - name: BPF_PROG_TYPE_CGROUP_SOCK + since: + version: 6.12 + commit: 67666479edf1e2b732f4d0ac797885e859a78de4 + - name: BPF_PROG_TYPE_CGROUP_DEVICE + since: + version: 6.12 + commit: 67666479edf1e2b732f4d0ac797885e859a78de4 + - name: BPF_PROG_TYPE_CGROUP_SOCKOPT + since: + version: 6.12 + commit: 67666479edf1e2b732f4d0ac797885e859a78de4 + - name: BPF_PROG_TYPE_CGROUP_SYSCTL + since: + version: 6.12 + commit: 67666479edf1e2b732f4d0ac797885e859a78de4 + - name: BPF_PROG_TYPE_LWT_OUT + - name: BPF_PROG_TYPE_LWT_IN + - name: BPF_PROG_TYPE_LWT_XMIT + - name: BPF_PROG_TYPE_LWT_SEG6LOCAL + - name: BPF_PROG_TYPE_NETFILTER + - name: BPF_PROG_TYPE_TRACING bpf_kfunc_check_set_xdp: funcs: - name: bpf_dynptr_from_xdp program_types: - - BPF_PROG_TYPE_XDP + - name: BPF_PROG_TYPE_XDP bpf_kfunc_check_set_sock_addr: funcs: - name: bpf_sock_addr_set_sun_path program_types: - - BPF_PROG_TYPE_CGROUP_SKB - - BPF_PROG_TYPE_CGROUP_SOCK_ADDR + - name: BPF_PROG_TYPE_CGROUP_SKB + - name: BPF_PROG_TYPE_CGROUP_SOCK_ADDR + since: + version: 6.7 + commit: 53e380d21441909b12b6e0782b77187ae4b971c4 + - name: BPF_PROG_TYPE_CGROUP_SOCK_ADDR + - name: BPF_PROG_TYPE_CGROUP_SOCK + since: + version: 6.12 + commit: 67666479edf1e2b732f4d0ac797885e859a78de4 + - name: BPF_PROG_TYPE_CGROUP_DEVICE + since: + version: 6.12 + commit: 67666479edf1e2b732f4d0ac797885e859a78de4 + - name: BPF_PROG_TYPE_CGROUP_SOCKOPT + since: + version: 6.12 + commit: 67666479edf1e2b732f4d0ac797885e859a78de4 + - name: BPF_PROG_TYPE_CGROUP_SYSCTL + since: + version: 6.12 + commit: 67666479edf1e2b732f4d0ac797885e859a78de4 bpf_sk_iter_kfunc_ids: funcs: - name: bpf_sock_destroy flags: [KF_TRUSTED_ARGS] program_types: - - BPF_PROG_TYPE_TRACING + - name: BPF_PROG_TYPE_TRACING attach_type: - BPF_TRACE_ITER @@ -267,14 +326,14 @@ sets: - name: bbr_min_tso_segs - name: bbr_set_state program_types: - - BPF_PROG_TYPE_STRUCT_OPS + - name: BPF_PROG_TYPE_STRUCT_OPS fou_kfunc_set: funcs: - name: bpf_skb_set_fou_encap - name: bpf_skb_get_fou_encap program_types: - - BPF_PROG_TYPE_SCHED_CLS + - name: BPF_PROG_TYPE_SCHED_CLS tcp_cubic_check_kfunc_ids: funcs: @@ -285,7 +344,7 @@ sets: - name: cubictcp_cwnd_event - name: cubictcp_acked program_types: - - BPF_PROG_TYPE_STRUCT_OPS + - name: BPF_PROG_TYPE_STRUCT_OPS tcp_dctcp_check_kfunc_ids: funcs: @@ -296,7 +355,7 @@ sets: - name: dctcp_cwnd_undo - name: dctcp_state program_types: - - BPF_PROG_TYPE_STRUCT_OPS + - name: BPF_PROG_TYPE_STRUCT_OPS bpf_tcp_ca_check_kfunc_ids: funcs: @@ -306,15 +365,15 @@ sets: - name: tcp_slow_start - name: tcp_cong_avoid_ai program_types: - - BPF_PROG_TYPE_STRUCT_OPS + - name: BPF_PROG_TYPE_STRUCT_OPS nf_nat_kfunc_set: funcs: - name: bpf_ct_set_nat_info flags: [KF_TRUSTED_ARGS] program_types: - - BPF_PROG_TYPE_XDP - - BPF_PROG_TYPE_SCHED_CLS + - name: BPF_PROG_TYPE_XDP + - name: BPF_PROG_TYPE_SCHED_CLS nf_ct_kfunc_set: funcs: @@ -339,15 +398,15 @@ sets: - name: bpf_ct_change_status flags: [KF_TRUSTED_ARGS] program_types: - - BPF_PROG_TYPE_XDP - - BPF_PROG_TYPE_SCHED_CLS + - name: BPF_PROG_TYPE_XDP + - name: BPF_PROG_TYPE_SCHED_CLS xfrm_ifc_kfunc_set: funcs: - name: bpf_skb_get_xfrm_info - name: bpf_skb_set_xfrm_info program_types: - - BPF_PROG_TYPE_SCHED_CLS + - name: BPF_PROG_TYPE_SCHED_CLS xfrm_state_kfunc_set: funcs: @@ -356,7 +415,7 @@ sets: - name: bpf_xdp_xfrm_state_release flags: [KF_RELEASE] program_types: - - BPF_PROG_TYPE_XDP + - name: BPF_PROG_TYPE_XDP # Excluding `hid_bpf_kfunc_ids` and `hid_bpf_syscall_kfunc_ids`, these have overlapping # kfuncs, which makes it difficult to automatically generate correct pages. @@ -373,20 +432,40 @@ sets: - name: hid_bpf_input_report - name: hid_bpf_try_input_report program_types: - - BPF_PROG_TYPE_TRACING # until v6.11 ebc0d8093e8c97de459615438edefad1a4ac352c - - BPF_PROG_TYPE_LSM # until v6.11 ebc0d8093e8c97de459615438edefad1a4ac352c - - BPF_PROG_TYPE_STRUCT_OPS # since v6.11 ebc0d8093e8c97de459615438edefad1a4ac352c + - name: BPF_PROG_TYPE_TRACING + until: + version: 6.11 + commit: ebc0d8093e8c97de459615438edefad1a4ac352c + - name: BPF_PROG_TYPE_LSM + until: + version: 6.11 + commit: ebc0d8093e8c97de459615438edefad1a4ac352c + - name: BPF_PROG_TYPE_STRUCT_OPS + since: + version: 6.11 + commit: ebc0d8093e8c97de459615438edefad1a4ac352c - hid_bpf_pseudo_syscall_kfunc_ids: + hid_bpf_pseudo_syscall_kfunc_removed_ids: funcs: - name: hid_bpf_attach_prog + program_types: + - name: BPF_PROG_TYPE_SYSCALL + since: + version: 6.3 + commit: f5c27da4e3c8a2e42fb4f41a0c685debcb9af294 + until: + version: 6.11 + commit: 4a86220e046da009bef0948e9f51d1d26d68f93c + + hid_bpf_pseudo_syscall_kfunc_ids: + funcs: - name: hid_bpf_allocate_context - name: hid_bpf_release_context - name: hid_bpf_hw_request - name: hid_bpf_hw_output_report - name: hid_bpf_input_report program_types: - - BPF_PROG_TYPE_SYSCALL + - name: BPF_PROG_TYPE_SYSCALL crypt_init_kfunc_btf_ids: funcs: @@ -397,7 +476,7 @@ sets: - name: bpf_crypto_ctx_acquire flags: [KF_ACQUIRE, KF_RCU, KF_RET_NULL] program_types: - - BPF_PROG_TYPE_SYSCALL + - name: BPF_PROG_TYPE_SYSCALL crypt_kfunc_btf_ids: funcs: @@ -406,16 +485,16 @@ sets: - name: bpf_crypto_encrypt flags: [KF_RCU] program_types: - - BPF_PROG_TYPE_SCHED_CLS - - BPF_PROG_TYPE_SCHED_ACT - - BPF_PROG_TYPE_XDP + - name: BPF_PROG_TYPE_SCHED_CLS + - name: BPF_PROG_TYPE_SCHED_ACT + - name: BPF_PROG_TYPE_XDP kprobe_multi_kfunc_set_ids: funcs: - name: bpf_session_is_return - name: bpf_session_cookie program_types: - - BPF_PROG_TYPE_KPROBE + - name: BPF_PROG_TYPE_KPROBE attach_type: - BPF_TRACE_KPROBE_SESSION @@ -426,18 +505,151 @@ sets: - name: bpf_arena_free_pages flags: [KF_TRUSTED_ARGS, KF_SLEEPABLE] program_types: - - BPF_PROG_TYPE_UNSPEC + - name: BPF_PROG_TYPE_UNSPEC bpf_kfunc_check_set_tcp_reqsk: funcs: - name: bpf_sk_assign_tcp_reqsk flags: [KF_TRUSTED_ARGS] program_types: - - BPF_PROG_TYPE_SCHED_CLS + - name: BPF_PROG_TYPE_SCHED_CLS nf_ft_kfunc_set: funcs: - name: bpf_xdp_flow_lookup flags: [KF_TRUSTED_ARGS, KF_RET_NULL] program_types: - - BPF_PROG_TYPE_XDP + - name: BPF_PROG_TYPE_XDP + + scx_kfunc_set_select_cpu: + funcs: + - name: scx_bpf_select_cpu_dfl + flags: [KF_RCU] + program_types: + - name: BPF_PROG_TYPE_STRUCT_OPS + + scx_kfunc_set_enqueue_dispatch: + funcs: + - name: scx_bpf_dsq_insert + flags: [KF_RCU] + - name: scx_bpf_dsq_insert_vtime + flags: [KF_RCU] + - name: scx_bpf_dispatch + flags: [KF_RCU] + - name: scx_bpf_dispatch_vtime + flags: [KF_RCU] + program_types: + - name: BPF_PROG_TYPE_STRUCT_OPS + + scx_kfunc_ids_dispatch: + funcs: + - name: scx_bpf_dispatch_nr_slots + - name: scx_bpf_dispatch_cancel + - name: scx_bpf_dsq_move_to_local + - name: scx_bpf_consume + - name: scx_bpf_dsq_move_set_slice + - name: scx_bpf_dsq_move_set_vtime + - name: scx_bpf_dispatch_from_dsq_set_slice + - name: scx_bpf_dispatch_from_dsq_set_vtime + - name: scx_bpf_dsq_move + flags: [KF_RCU] + - name: scx_bpf_dsq_move_vtime + flags: [KF_RCU] + - name: scx_bpf_dispatch_from_dsq + flags: [KF_RCU] + - name: scx_bpf_dispatch_vtime_from_dsq + flags: [KF_RCU] + program_types: + - name: BPF_PROG_TYPE_STRUCT_OPS + + scx_kfunc_ids_cpu_release: + funcs: + - name: scx_bpf_reenqueue_local + program_types: + - name: BPF_PROG_TYPE_STRUCT_OPS + + scx_kfunc_ids_unlocked: + funcs: + - name: scx_bpf_dsq_move_set_slice + - name: scx_bpf_dsq_move_set_vtime + - name: scx_bpf_dispatch_from_dsq_set_slice + - name: scx_bpf_dispatch_from_dsq_set_vtime + - name: scx_bpf_create_dsq + flags: [KF_SLEEPABLE] + - name: scx_bpf_dsq_move + flags: [KF_RCU] + - name: scx_bpf_dsq_move_vtime + flags: [KF_RCU] + - name: scx_bpf_dispatch_from_dsq + flags: [KF_RCU] + - name: scx_bpf_dispatch_vtime_from_dsq + flags: [KF_RCU] + program_types: + - name: BPF_PROG_TYPE_STRUCT_OPS + - name: BPF_PROG_TYPE_SYSCALL + + scx_kfunc_ids_any: + funcs: + - name: scx_bpf_kick_cpu + - name: scx_bpf_dsq_nr_queued + - name: scx_bpf_destroy_dsq + - name: bpf_iter_scx_dsq_new + flags: [KF_ITER_NEW, KF_RCU_PROTECTED] + - name: bpf_iter_scx_dsq_next + flags: [KF_ITER_NEXT, KF_RET_NULL] + - name: bpf_iter_scx_dsq_destroy + flags: [KF_ITER_DESTROY] + - name: scx_bpf_exit_bstr + flags: [KF_TRUSTED_ARGS] + - name: scx_bpf_error_bstr + flags: [KF_TRUSTED_ARGS] + - name: scx_bpf_dump_bstr + flags: [KF_TRUSTED_ARGS] + - name: scx_bpf_cpuperf_cap + - name: scx_bpf_cpuperf_cur + - name: scx_bpf_cpuperf_set + - name: scx_bpf_nr_cpu_ids + - name: scx_bpf_get_possible_cpumask + flags: [KF_ACQUIRE] + - name: scx_bpf_get_online_cpumask + flags: [KF_ACQUIRE] + - name: scx_bpf_put_cpumask + flags: [KF_RELEASE] + - name: scx_bpf_get_idle_cpumask + flags: [KF_ACQUIRE] + - name: scx_bpf_get_idle_smtmask + flags: [KF_ACQUIRE] + - name: scx_bpf_put_idle_cpumask + flags: [KF_RELEASE] + - name: scx_bpf_test_and_clear_cpu_idle + - name: scx_bpf_pick_idle_cpu + flags: [KF_RCU] + - name: scx_bpf_pick_any_cpu + flags: [KF_RCU] + - name: scx_bpf_task_running + flags: [KF_RCU] + - name: scx_bpf_task_cpu + flags: [KF_RCU] + - name: scx_bpf_cpu_rq + - name: scx_bpf_task_cgroup + flags: [KF_RCU, KF_ACQUIRE] + - name: scx_bpf_now + program_types: + - name: BPF_PROG_TYPE_STRUCT_OPS + - name: BPF_PROG_TYPE_SYSCALL + - name: BPF_PROG_TYPE_TRACING + + bpf_fs_kfunc_set_ids: + funcs: + - name: bpf_get_task_exe_file + flags: [KF_ACQUIRE, KF_TRUSTED_ARGS, KF_RET_NULL] + - name: bpf_put_file + flags: [KF_RELEASE] + - name: bpf_path_d_path + flags: [KF_TRUSTED_ARGS] + - name: bpf_get_dentry_xattr + flags: [KF_SLEEPABLE, KF_TRUSTED_ARGS] + - name: bpf_get_file_xattr + flags: [KF_SLEEPABLE, KF_TRUSTED_ARGS] + program_types: + - name: BPF_PROG_TYPE_LSM diff --git a/docs/ebpf-library/libbpf/ebpf/SUMMARY.md b/docs/ebpf-library/libbpf/ebpf/SUMMARY.md index b3abb51..04539da 100644 --- a/docs/ebpf-library/libbpf/ebpf/SUMMARY.md +++ b/docs/ebpf-library/libbpf/ebpf/SUMMARY.md @@ -92,3 +92,5 @@ - [`BPF_PROBE_READ_STR_INTO`](BPF_PROBE_READ_STR_INTO.md) - [`BPF_PROBE_READ_USER_STR_INTO`](BPF_PROBE_READ_USER_STR_INTO.md) - [`BPF_PROBE_READ_USER`](BPF_PROBE_READ_USER.md) +- Utility macros + - [`___bpf_fill`](___bpf_fill.md) diff --git a/docs/ebpf-library/libbpf/ebpf/___bpf_fill.md b/docs/ebpf-library/libbpf/ebpf/___bpf_fill.md new file mode 100644 index 0000000..d3446fa --- /dev/null +++ b/docs/ebpf-library/libbpf/ebpf/___bpf_fill.md @@ -0,0 +1,53 @@ +--- +title: "Libbpf eBPF macro '___bpf_fill'" +description: "This page documents the '___bpf_fill' libbpf eBPF macro, including its definition, usage, and examples." +--- +# Libbpf eBPF macro `___bpf_fill` + +[:octicons-tag-24: v0.4.0](https://github.com/libbpf/libbpf/releases/tag/v0.4.0) + +The `___bpf_fill` macros is used to fill an array with variadic arguments. + +## Definition + +```c +#define ___bpf_fill0(arr, p, x) do {} while (0) +#define ___bpf_fill1(arr, p, x) arr[p] = x +#define ___bpf_fill2(arr, p, x, args...) arr[p] = x; ___bpf_fill1(arr, p + 1, args) +#define ___bpf_fill3(arr, p, x, args...) arr[p] = x; ___bpf_fill2(arr, p + 1, args) +#define ___bpf_fill4(arr, p, x, args...) arr[p] = x; ___bpf_fill3(arr, p + 1, args) +#define ___bpf_fill5(arr, p, x, args...) arr[p] = x; ___bpf_fill4(arr, p + 1, args) +#define ___bpf_fill6(arr, p, x, args...) arr[p] = x; ___bpf_fill5(arr, p + 1, args) +#define ___bpf_fill7(arr, p, x, args...) arr[p] = x; ___bpf_fill6(arr, p + 1, args) +#define ___bpf_fill8(arr, p, x, args...) arr[p] = x; ___bpf_fill7(arr, p + 1, args) +#define ___bpf_fill9(arr, p, x, args...) arr[p] = x; ___bpf_fill8(arr, p + 1, args) +#define ___bpf_fill10(arr, p, x, args...) arr[p] = x; ___bpf_fill9(arr, p + 1, args) +#define ___bpf_fill11(arr, p, x, args...) arr[p] = x; ___bpf_fill10(arr, p + 1, args) +#define ___bpf_fill12(arr, p, x, args...) arr[p] = x; ___bpf_fill11(arr, p + 1, args) +#define ___bpf_fill(arr, args...) \ + ___bpf_apply(___bpf_fill, ___bpf_narg(args))(arr, 0, args) +``` + +## Usage + +This macro is mostly used by other Libbpf macros to turn variadic arguments into an array. + +### Example + +Here the `___bpf_fill` macro is used by the [`BPF_SEQ_PRINTF`](bpf_seq_printf.md) macro to turn the list of arguments given to the macro into an array so it can be passed to the [`bpf_seq_printf`](../../../linux/helper-function/bpf_seq_printf.md) helper. + +```c hl_lines="1" +#define BPF_SEQ_PRINTF(seq, fmt, args...) \ +({ \ + static const char ___fmt[] = fmt; \ + unsigned long long ___param[___bpf_narg(args)]; \ + \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \ + ___bpf_fill(___param, args); \ + _Pragma("GCC diagnostic pop") \ + \ + bpf_seq_printf(seq, ___fmt, sizeof(___fmt), \ + ___param, sizeof(___param)); \ +}) +``` diff --git a/docs/ebpf-library/libbpf/ebpf/index.md b/docs/ebpf-library/libbpf/ebpf/index.md index 46c3b89..66743e5 100644 --- a/docs/ebpf-library/libbpf/ebpf/index.md +++ b/docs/ebpf-library/libbpf/ebpf/index.md @@ -65,6 +65,8 @@ The file contains definitions for the following: * [`bpf_for_each`](bpf_for_each.md) * [`bpf_for`](bpf_for.md) * [`bpf_repeat`](bpf_repeat.md) +* Utility macros + * [`___bpf_fill`](___bpf_fill.md) ## [`bpf_endian.h`](https://github.com/libbpf/libbpf/blob/master/src/bpf_endian.h) diff --git a/docs/linux/kfuncs/SUMMARY.md b/docs/linux/kfuncs/SUMMARY.md index 80f7f42..cef41f2 100644 --- a/docs/linux/kfuncs/SUMMARY.md +++ b/docs/linux/kfuncs/SUMMARY.md @@ -9,6 +9,10 @@ - [`bpf_verify_pkcs7_signature`](bpf_verify_pkcs7_signature.md) - File related kfuncs - [`bpf_get_file_xattr`](bpf_get_file_xattr.md) + - [`bpf_get_task_exe_file`](bpf_get_task_exe_file.md) + - [`bpf_put_file`](bpf_put_file.md) + - [`bpf_path_d_path`](bpf_path_d_path.md) + - [`bpf_get_dentry_xattr`](bpf_get_dentry_xattr.md) - CPU mask KFuncs - [`bpf_cpumask_create`](bpf_cpumask_create.md) - [`bpf_cpumask_release`](bpf_cpumask_release.md) @@ -54,6 +58,7 @@ - BPF task KFuncs - [`bpf_task_acquire`](bpf_task_acquire.md) - [`bpf_task_release`](bpf_task_release.md) + - [`bpf_send_signal_task`](bpf_send_signal_task.md) - BPF cGroup KFuncs - [`bpf_rbtree_add_impl`](bpf_rbtree_add_impl.md) - [`bpf_rbtree_first`](bpf_rbtree_first.md) @@ -67,6 +72,9 @@ - [`bpf_task_under_cgroup`](bpf_task_under_cgroup.md) - [`bpf_task_get_cgroup1`](bpf_task_get_cgroup1.md) - [`bpf_task_from_pid`](bpf_task_from_pid.md) + - [`bpf_task_from_vpid`](bpf_task_from_vpid.md) +- KFuncs for memory allocator inspection + - [`bpf_get_kmem_cache`](bpf_get_kmem_cache.md) - Kfuncs for casting pointers - [`bpf_cast_to_kern_ctx`](bpf_cast_to_kern_ctx.md) - [`bpf_rdonly_cast`](bpf_rdonly_cast.md) @@ -100,6 +108,14 @@ - [`bpf_iter_task_new`](bpf_iter_task_new.md) - [`bpf_iter_task_next`](bpf_iter_task_next.md) - [`bpf_iter_task_destroy`](bpf_iter_task_destroy.md) +- Kfuncs for slab memory allocation iterators + - [`bpf_iter_kmem_cache_new`](bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](bpf_iter_kmem_cache_next.md) + - [`bpf_iter_kmem_cache_destroy`](bpf_iter_kmem_cache_destroy.md) +- Kfuncs for sched_ext dispatch queue iterators + - [`bpf_iter_scx_dsq_new`](bpf_iter_scx_dsq_new.md) + - [`bpf_iter_scx_dsq_next`](bpf_iter_scx_dsq_next.md) + - [`bpf_iter_scx_dsq_destroy`](bpf_iter_scx_dsq_destroy.md) - Kfuncs for dynamic pointers - [`bpf_dynptr_adjust`](bpf_dynptr_adjust.md) - [`bpf_dynptr_is_null`](bpf_dynptr_is_null.md) @@ -197,4 +213,59 @@ - KProbe session Kfuncs - [`bpf_session_cookie`](bpf_session_cookie.md) - [`bpf_session_is_return`](bpf_session_is_return.md) - +- Memory probe Kfuncs + - [`bpf_copy_from_user_str`](bpf_copy_from_user_str.md) +- IRQ Kfuncs + - [`bpf_local_irq_save`](bpf_local_irq_save.md) + - [`bpf_local_irq_restore`](bpf_local_irq_restore.md) +- sched_ext Kfuncs + - [`scx_bpf_kick_cpu`](scx_bpf_kick_cpu.md) + - [`scx_bpf_select_cpu_dfl`](scx_bpf_select_cpu_dfl.md) + - [`scx_bpf_cpu_rq`](scx_bpf_cpu_rq.md) + - [`scx_bpf_now`](scx_bpf_now.md) + - Dispatch Queue Kfuncs + - [`scx_bpf_create_dsq`](scx_bpf_create_dsq.md) + - [`scx_bpf_destroy_dsq`](scx_bpf_destroy_dsq.md) + - [`scx_bpf_dsq_nr_queued`](scx_bpf_dsq_nr_queued.md) + - [`scx_bpf_dsq_insert`](scx_bpf_dsq_insert.md) + - [`scx_bpf_dispatch`](scx_bpf_dispatch.md) + - [`scx_bpf_dsq_insert_vtime`](scx_bpf_dsq_insert_vtime.md) + - [`scx_bpf_dispatch_vtime`](scx_bpf_dispatch_vtime.md) + - [`scx_bpf_dsq_move_to_local`](scx_bpf_dsq_move_to_local.md) + - [`scx_bpf_consume`](scx_bpf_consume.md) + - [`scx_bpf_dsq_move_set_slice`](scx_bpf_dsq_move_set_slice.md) + - [`scx_bpf_dispatch_from_dsq_set_slice`](scx_bpf_dispatch_from_dsq_set_slice.md) + - [`scx_bpf_dsq_move_set_vtime`](scx_bpf_dsq_move_set_vtime.md) + - [`scx_bpf_dispatch_from_dsq_set_vtime`](scx_bpf_dispatch_from_dsq_set_vtime.md) + - [`scx_bpf_dsq_move`](scx_bpf_dsq_move.md) + - [`scx_bpf_dispatch_from_dsq`](scx_bpf_dispatch_from_dsq.md) + - [`scx_bpf_dsq_move_vtime`](scx_bpf_dsq_move_vtime.md) + - [`scx_bpf_dispatch_vtime_from_dsq`](scx_bpf_dispatch_vtime_from_dsq.md) + - [`scx_bpf_reenqueue_local`](scx_bpf_reenqueue_local.md) + - Dispatch Kfuncs + - [`scx_bpf_dispatch_nr_slots`](scx_bpf_dispatch_nr_slots.md) + - [`scx_bpf_dispatch_cancel`](scx_bpf_dispatch_cancel.md) + - Error and debug Kfuncs + - [`scx_bpf_exit_bstr`](scx_bpf_exit_bstr.md) + - [`scx_bpf_error_bstr`](scx_bpf_error_bstr.md) + - [`scx_bpf_dump_bstr`](scx_bpf_dump_bstr.md) + - CPU performance Kfuncs + - [`scx_bpf_cpuperf_cap`](scx_bpf_cpuperf_cap.md) + - [`scx_bpf_cpuperf_cur`](scx_bpf_cpuperf_cur.md) + - [`scx_bpf_cpuperf_set`](scx_bpf_cpuperf_set.md) + - [`scx_bpf_nr_cpu_ids`](scx_bpf_nr_cpu_ids.md) + - CPU mask Kfuncs + - [`scx_bpf_get_possible_cpumask`](scx_bpf_get_possible_cpumask.md) + - [`scx_bpf_get_online_cpumask`](scx_bpf_get_online_cpumask.md) + - [`scx_bpf_put_cpumask`](scx_bpf_put_cpumask.md) + - Idle CPU mask Kfuncs + - [`scx_bpf_get_idle_cpumask`](scx_bpf_get_idle_cpumask.md) + - [`scx_bpf_get_idle_smtmask`](scx_bpf_get_idle_smtmask.md) + - [`scx_bpf_put_idle_cpumask`](scx_bpf_put_idle_cpumask.md) + - [`scx_bpf_test_and_clear_cpu_idle`](scx_bpf_test_and_clear_cpu_idle.md) + - [`scx_bpf_pick_idle_cpu`](scx_bpf_pick_idle_cpu.md) + - [`scx_bpf_pick_any_cpu`](scx_bpf_pick_any_cpu.md) + - Task Kfuncs + - [`scx_bpf_task_running`](scx_bpf_task_running.md) + - [`scx_bpf_task_cpu`](scx_bpf_task_cpu.md) + - [`scx_bpf_task_cgroup`](scx_bpf_task_cgroup.md) diff --git a/docs/linux/kfuncs/bbr_cwnd_event.md b/docs/linux/kfuncs/bbr_cwnd_event.md index ff8a917..8194c7e 100644 --- a/docs/linux/kfuncs/bbr_cwnd_event.md +++ b/docs/linux/kfuncs/bbr_cwnd_event.md @@ -12,6 +12,8 @@ Call when congestion window event occurs. ## Definition +**Signature** + `#!c void bbr_cwnd_event(struct sock *sk, tcp_ca_event event)` diff --git a/docs/linux/kfuncs/bbr_init.md b/docs/linux/kfuncs/bbr_init.md index 468061b..fa329e3 100644 --- a/docs/linux/kfuncs/bbr_init.md +++ b/docs/linux/kfuncs/bbr_init.md @@ -12,6 +12,8 @@ Initialise BBR congestion control algorithm on a socket. ## Definition +**Signature** + `#!c void bbr_init(struct sock *sk)` diff --git a/docs/linux/kfuncs/bbr_main.md b/docs/linux/kfuncs/bbr_main.md index 1fae926..b4253f0 100644 --- a/docs/linux/kfuncs/bbr_main.md +++ b/docs/linux/kfuncs/bbr_main.md @@ -12,6 +12,8 @@ Notify BBR congestion control algorithm of newly delivered packets. ## Definition +**Signature** + `#!c void bbr_main(struct sock *sk, u32 ack, int flag, const struct rate_sample *rs)` diff --git a/docs/linux/kfuncs/bbr_min_tso_segs.md b/docs/linux/kfuncs/bbr_min_tso_segs.md index 279223c..c3e21a7 100644 --- a/docs/linux/kfuncs/bbr_min_tso_segs.md +++ b/docs/linux/kfuncs/bbr_min_tso_segs.md @@ -12,6 +12,8 @@ Override `sysctl_tcp_min_tso_segs` ## Definition +**Signature** + `#!c u32 bbr_min_tso_segs(struct sock *sk)` diff --git a/docs/linux/kfuncs/bbr_set_state.md b/docs/linux/kfuncs/bbr_set_state.md index 3350d4e..30fc1fc 100644 --- a/docs/linux/kfuncs/bbr_set_state.md +++ b/docs/linux/kfuncs/bbr_set_state.md @@ -12,6 +12,8 @@ Call before changing ca_state ## Definition +**Signature** + `#!c void bbr_set_state(struct sock *sk, u8 new_state)` diff --git a/docs/linux/kfuncs/bbr_sndbuf_expand.md b/docs/linux/kfuncs/bbr_sndbuf_expand.md index 6cacc20..6b1945c 100644 --- a/docs/linux/kfuncs/bbr_sndbuf_expand.md +++ b/docs/linux/kfuncs/bbr_sndbuf_expand.md @@ -14,6 +14,8 @@ Returns the multiplier used in `tcp_sndbuf_expand` Provision 3 * `cwnd` since BBR may slow-start even during recovery. +**Signature** + `#!c u32 bbr_sndbuf_expand(struct sock *sk)` diff --git a/docs/linux/kfuncs/bbr_ssthresh.md b/docs/linux/kfuncs/bbr_ssthresh.md index b0a363d..ecb977b 100644 --- a/docs/linux/kfuncs/bbr_ssthresh.md +++ b/docs/linux/kfuncs/bbr_ssthresh.md @@ -14,6 +14,8 @@ Returns slow start threshold Entering loss recovery, so save `cwnd` for when we exit or undo recovery. +**Signature** + `#!c u32 bbr_ssthresh(struct sock *sk)` diff --git a/docs/linux/kfuncs/bbr_undo_cwnd.md b/docs/linux/kfuncs/bbr_undo_cwnd.md index 4e17343..60ba888 100644 --- a/docs/linux/kfuncs/bbr_undo_cwnd.md +++ b/docs/linux/kfuncs/bbr_undo_cwnd.md @@ -14,6 +14,8 @@ Return new value of congestion window after loss. In theory BBR does not need to undo the `cwnd` since it does not always reduce `cwnd` on losses (see `bbr_main()`). +**Signature** + `#!c u32 bbr_undo_cwnd(struct sock *sk)` diff --git a/docs/linux/kfuncs/bpf_arena_alloc_pages.md b/docs/linux/kfuncs/bpf_arena_alloc_pages.md index 5089f16..9667390 100644 --- a/docs/linux/kfuncs/bpf_arena_alloc_pages.md +++ b/docs/linux/kfuncs/bpf_arena_alloc_pages.md @@ -22,6 +22,8 @@ Allocate pages of memory for a arena. `flags`: Flags for future use, currently no valid flags exist. +**Signature** + `#!c void *bpf_arena_alloc_pages(void *p__map, void *addr__ign, u32 page_cnt, int node_id, u64 flags)` @@ -42,8 +44,12 @@ The kfunc is used to allocate these pages. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_arena_free_pages.md b/docs/linux/kfuncs/bpf_arena_free_pages.md index ee35481..7644196 100644 --- a/docs/linux/kfuncs/bpf_arena_free_pages.md +++ b/docs/linux/kfuncs/bpf_arena_free_pages.md @@ -18,6 +18,8 @@ Free pages of memory for a arena. `page_cnt`: Number of pages to free. +**Signature** + `#!c void bpf_arena_free_pages(void *p__map, void *ptr__ign, u32 page_cnt)` @@ -38,8 +40,12 @@ The kfunc is used to free these pages. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_cast_to_kern_ctx.md b/docs/linux/kfuncs/bpf_cast_to_kern_ctx.md index b8211eb..ca733f3 100644 --- a/docs/linux/kfuncs/bpf_cast_to_kern_ctx.md +++ b/docs/linux/kfuncs/bpf_cast_to_kern_ctx.md @@ -10,6 +10,8 @@ description: "This page documents the 'bpf_cast_to_kern_ctx' eBPF kfunc, includi ## Definition +**Signature** + `#!c void *bpf_cast_to_kern_ctx(void *obj)` @@ -26,8 +28,12 @@ So for example an `BPF_PROG_TYPE_SCHED_CLS` program would get a `struct __sk_buf The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_cgroup_acquire.md b/docs/linux/kfuncs/bpf_cgroup_acquire.md index 8f7847d..73cac64 100644 --- a/docs/linux/kfuncs/bpf_cgroup_acquire.md +++ b/docs/linux/kfuncs/bpf_cgroup_acquire.md @@ -14,6 +14,8 @@ Acquire a reference to a cGroup. A cGroup acquired by this kfunc which is not stored in a map as a kptr, must be released by calling [`bpf_cgroup_release()`](bpf_cgroup_release.md). +**Signature** + `#!c struct cgroup *bpf_cgroup_acquire(struct cgroup *cgrp)` diff --git a/docs/linux/kfuncs/bpf_cgroup_ancestor.md b/docs/linux/kfuncs/bpf_cgroup_ancestor.md index eae4b8d..8d1082f 100644 --- a/docs/linux/kfuncs/bpf_cgroup_ancestor.md +++ b/docs/linux/kfuncs/bpf_cgroup_ancestor.md @@ -14,6 +14,8 @@ Perform a lookup on an entry in a cGroups ancestor array. A cGroup returned by this kfunc which is not subsequently stored in a map, must be released by calling [`bpf_cgroup_release()`](bpf_cgroup_release.md). +**Signature** + `#!c struct cgroup *bpf_cgroup_ancestor(struct cgroup *cgrp, int level)` diff --git a/docs/linux/kfuncs/bpf_cgroup_from_id.md b/docs/linux/kfuncs/bpf_cgroup_from_id.md index 39096e7..219b3d2 100644 --- a/docs/linux/kfuncs/bpf_cgroup_from_id.md +++ b/docs/linux/kfuncs/bpf_cgroup_from_id.md @@ -14,6 +14,8 @@ Find a cGroup from its ID. cGroup returned by this kfunc which is not subsequently stored in a map, must be released by calling [`bpf_cgroup_release()`](bpf_cgroup_release.md). +**Signature** + `#!c struct cgroup *bpf_cgroup_from_id(u64 cgid)` diff --git a/docs/linux/kfuncs/bpf_cgroup_release.md b/docs/linux/kfuncs/bpf_cgroup_release.md index 6fe6ca8..5f8fc91 100644 --- a/docs/linux/kfuncs/bpf_cgroup_release.md +++ b/docs/linux/kfuncs/bpf_cgroup_release.md @@ -14,6 +14,8 @@ Release the reference acquired on a cGroup. If this kfunc is invoked in an RCU read region, the cGroup is guaranteed to not be freed until the current grace period has ended, even if its refcount drops to `0`. +**Signature** + `#!c void bpf_cgroup_release(struct cgroup *cgrp)` diff --git a/docs/linux/kfuncs/bpf_copy_from_user_str.md b/docs/linux/kfuncs/bpf_copy_from_user_str.md new file mode 100644 index 0000000..f428a2b --- /dev/null +++ b/docs/linux/kfuncs/bpf_copy_from_user_str.md @@ -0,0 +1,150 @@ +--- +title: "KFunc 'bpf_copy_from_user_str'" +description: "This page documents the 'bpf_copy_from_user_str' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_copy_from_user_str` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/65ab5ac4df012388481d0414fcac1d5ac1721fb3) + + +This function copies a string from an unsafe user address. + +## Definition + +Copies a `NULL`-terminated string from userspace to BPF space. If user string is too long this will still ensure zero termination in the `dst` buffer unless buffer size is `0`. + +**Parameters** + +`dst`: Destination address, in kernel space. This buffer must be at least `dst__sz` bytes long. + +`dst__sz`: Maximum number of bytes to copy, includes the trailing `NULL`. + +`unsafe_ptr__ign`: Source address, in user space. + +`flags`: The only supported flag is `BPF_F_PAD_ZEROS` + +**Flags** + +If `BPF_F_PAD_ZEROS` flag is set, `memset` the tail of `dst` to `0` on success and `memset` all of @dst on failure. + +**Returns** + +0 on success, or a negative error code on failure. + +**Signature** + + +`#!c int bpf_copy_from_user_str(void *dst, u32 dst__sz, const void *unsafe_ptr__ign, u64 flags)` + +!!! note + This function may sleep, and therefore can only be used from [sleepable programs](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable). + + +## Usage + +!!! example "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_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) +- [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) +- [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) +- [`BPF_PROG_TYPE_LWT_SEG6LOCAL`](../program-type/BPF_PROG_TYPE_LWT_SEG6LOCAL.md) +- [`BPF_PROG_TYPE_LWT_XMIT`](../program-type/BPF_PROG_TYPE_LWT_XMIT.md) +- [`BPF_PROG_TYPE_NETFILTER`](../program-type/BPF_PROG_TYPE_NETFILTER.md) +- [`BPF_PROG_TYPE_SCHED_ACT`](../program-type/BPF_PROG_TYPE_SCHED_ACT.md) +- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md) +- [`BPF_PROG_TYPE_SK_SKB`](../program-type/BPF_PROG_TYPE_SK_SKB.md) +- [`BPF_PROG_TYPE_SOCKET_FILTER`](../program-type/BPF_PROG_TYPE_SOCKET_FILTER.md) +- [`BPF_PROG_TYPE_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) +- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md) + + +### Example + +```c +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2017 Facebook + +#include "vmlinux.h" +#include +#include +#include +#include +#include "bpf_misc.h" + +u32 dynamic_sz = 1; +int uprobe_byname3_str_sleepable_res = 0; +void *user_ptr = 0; + +int bpf_copy_from_user_str(void *dst, u32, const void *, u64) __weak __ksym; + +static __always_inline bool verify_sleepable_user_copy_str(void) +{ + int ret; + char data_long[20]; + char data_long_pad[20]; + char data_long_err[20]; + char data_short[4]; + char data_short_pad[4]; + + ret = bpf_copy_from_user_str(data_short, sizeof(data_short), user_ptr, 0); + + if (bpf_strncmp(data_short, 4, "tes\0") != 0 || ret != 4) + return false; + + ret = bpf_copy_from_user_str(data_short_pad, sizeof(data_short_pad), user_ptr, BPF_F_PAD_ZEROS); + + if (bpf_strncmp(data_short, 4, "tes\0") != 0 || ret != 4) + return false; + + /* Make sure this passes the verifier */ + ret = bpf_copy_from_user_str(data_long, dynamic_sz & sizeof(data_long), user_ptr, 0); + + if (ret != 0) + return false; + + ret = bpf_copy_from_user_str(data_long, sizeof(data_long), user_ptr, 0); + + if (bpf_strncmp(data_long, 10, "test_data\0") != 0 || ret != 10) + return false; + + ret = bpf_copy_from_user_str(data_long_pad, sizeof(data_long_pad), user_ptr, BPF_F_PAD_ZEROS); + + if (bpf_strncmp(data_long_pad, 10, "test_data\0") != 0 || ret != 10 || data_long_pad[19] != '\0') + return false; + + ret = bpf_copy_from_user_str(data_long_err, sizeof(data_long_err), (void *)data_long, BPF_F_PAD_ZEROS); + + if (ret > 0 || data_long_err[19] != '\0') + return false; + + ret = bpf_copy_from_user_str(data_long, sizeof(data_long), user_ptr, 2); + + if (ret != -EINVAL) + return false; + + return true; +} + +SEC("uprobe.s//proc/self/exe:trigger_func3") +int handle_uprobe_byname3_sleepable(struct pt_regs *ctx) +{ + if (verify_sleepable_user_copy_str()) + uprobe_byname3_str_sleepable_res = 10; + return 0; +} +``` diff --git a/docs/linux/kfuncs/bpf_cpumask_acquire.md b/docs/linux/kfuncs/bpf_cpumask_acquire.md index 5920d45..cca924a 100644 --- a/docs/linux/kfuncs/bpf_cpumask_acquire.md +++ b/docs/linux/kfuncs/bpf_cpumask_acquire.md @@ -16,6 +16,8 @@ Acquires a reference to a BPF CPU-mask. The CPU-mask returned by this function must either be embedded in a map as a kptr, or freed with [`bpf_cpumask_release()`](bpf_cpumask_release.md). +**Signature** + `#!c struct bpf_cpumask *bpf_cpumask_acquire(struct bpf_cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_and.md b/docs/linux/kfuncs/bpf_cpumask_and.md index 8f0c0fa..934fe23 100644 --- a/docs/linux/kfuncs/bpf_cpumask_and.md +++ b/docs/linux/kfuncs/bpf_cpumask_and.md @@ -22,6 +22,8 @@ Return: `struct bpf_cpumask` pointers may be safely passed to `src1` and `src2`. +**Signature** + `#!c bool bpf_cpumask_and(struct bpf_cpumask *dst, const struct cpumask *src1, const struct cpumask *src2)` diff --git a/docs/linux/kfuncs/bpf_cpumask_any_and_distribute.md b/docs/linux/kfuncs/bpf_cpumask_any_and_distribute.md index 1e65d59..1176e17 100644 --- a/docs/linux/kfuncs/bpf_cpumask_any_and_distribute.md +++ b/docs/linux/kfuncs/bpf_cpumask_any_and_distribute.md @@ -22,6 +22,8 @@ Return: `struct bpf_cpumask` pointers may be safely passed to `src1` and `src2`. +**Signature** + `#!c u32 bpf_cpumask_any_and_distribute(const struct cpumask *src1, const struct cpumask *src2)` diff --git a/docs/linux/kfuncs/bpf_cpumask_any_distribute.md b/docs/linux/kfuncs/bpf_cpumask_any_distribute.md index cad9719..5d0e5ad 100644 --- a/docs/linux/kfuncs/bpf_cpumask_any_distribute.md +++ b/docs/linux/kfuncs/bpf_cpumask_any_distribute.md @@ -20,6 +20,8 @@ Return: A `struct bpf_cpumask` pointer may be safely passed to `src`. +**Signature** + `#!c u32 bpf_cpumask_any_distribute(const struct cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_clear.md b/docs/linux/kfuncs/bpf_cpumask_clear.md index 4875229..5a7fffc 100644 --- a/docs/linux/kfuncs/bpf_cpumask_clear.md +++ b/docs/linux/kfuncs/bpf_cpumask_clear.md @@ -14,6 +14,8 @@ Clear all of the bits in a BPF CPU-mask. `cpumask`: The BPF CPU-mask being cleared. +**Signature** + `#!c void bpf_cpumask_clear(struct bpf_cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_clear_cpu.md b/docs/linux/kfuncs/bpf_cpumask_clear_cpu.md index 66fe6df..92dbc43 100644 --- a/docs/linux/kfuncs/bpf_cpumask_clear_cpu.md +++ b/docs/linux/kfuncs/bpf_cpumask_clear_cpu.md @@ -16,6 +16,8 @@ Clear a bit for a CPU in a BPF CPU-mask. `cpumask`: The BPF CPU-mask in which a bit is being cleared. +**Signature** + `#!c void bpf_cpumask_clear_cpu(u32 cpu, struct bpf_cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_copy.md b/docs/linux/kfuncs/bpf_cpumask_copy.md index f749d88..6b289fb 100644 --- a/docs/linux/kfuncs/bpf_cpumask_copy.md +++ b/docs/linux/kfuncs/bpf_cpumask_copy.md @@ -17,6 +17,8 @@ Copy the contents of a CPU-mask into a BPF CPU-mask. A `struct bpf_cpumask` pointer may be safely passed to `src`. +**Signature** + `#!c void bpf_cpumask_copy(struct bpf_cpumask *dst, const struct cpumask *src)` diff --git a/docs/linux/kfuncs/bpf_cpumask_create.md b/docs/linux/kfuncs/bpf_cpumask_create.md index a79b26e..7bdbbc0 100644 --- a/docs/linux/kfuncs/bpf_cpumask_create.md +++ b/docs/linux/kfuncs/bpf_cpumask_create.md @@ -19,6 +19,8 @@ in a map as a kptr, or freed with [`bpf_cpumask_release()`](bpf_cpumask_release. `bpf_cpumask_create()` allocates memory using the BPF memory allocator, and will not block. It may return NULL if no memory is available. +**Signature** + `#!c struct bpf_cpumask *bpf_cpumask_create()` diff --git a/docs/linux/kfuncs/bpf_cpumask_empty.md b/docs/linux/kfuncs/bpf_cpumask_empty.md index 4ecd1f4..6b2e5c4 100644 --- a/docs/linux/kfuncs/bpf_cpumask_empty.md +++ b/docs/linux/kfuncs/bpf_cpumask_empty.md @@ -20,6 +20,8 @@ Return: A `struct bpf_cpumask` pointer may be safely passed to `cpumask`. +**Signature** + `#!c bool bpf_cpumask_empty(const struct cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_equal.md b/docs/linux/kfuncs/bpf_cpumask_equal.md index 574d447..f8e437e 100644 --- a/docs/linux/kfuncs/bpf_cpumask_equal.md +++ b/docs/linux/kfuncs/bpf_cpumask_equal.md @@ -21,6 +21,8 @@ Return: `struct bpf_cpumask` pointers may be safely passed to `src1` and `src2`. +**Signature** + `#!c bool bpf_cpumask_equal(const struct cpumask *src1, const struct cpumask *src2)` diff --git a/docs/linux/kfuncs/bpf_cpumask_first.md b/docs/linux/kfuncs/bpf_cpumask_first.md index 5e8b00d..f6f09f5 100644 --- a/docs/linux/kfuncs/bpf_cpumask_first.md +++ b/docs/linux/kfuncs/bpf_cpumask_first.md @@ -15,6 +15,8 @@ Get the index of the first nonzero bit in the CPU-mask. Find the index of the first nonzero bit of the CPU-mask. A `struct bpf_cpumask` pointer may be safely passed to this function. +**Signature** + `#!c u32 bpf_cpumask_first(const struct cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_first_and.md b/docs/linux/kfuncs/bpf_cpumask_first_and.md index ac6082a..2e4c321 100644 --- a/docs/linux/kfuncs/bpf_cpumask_first_and.md +++ b/docs/linux/kfuncs/bpf_cpumask_first_and.md @@ -15,6 +15,8 @@ Return the index of the first nonzero bit from the AND of two CPU-masks. Find the index of the first nonzero bit of the AND of two CPU-masks. `struct bpf_cpumask` pointers may be safely passed to `src1` and `src2`. +**Signature** + `#!c u32 bpf_cpumask_first_and(const struct cpumask *src1, const struct cpumask *src2)` diff --git a/docs/linux/kfuncs/bpf_cpumask_first_zero.md b/docs/linux/kfuncs/bpf_cpumask_first_zero.md index a364e3d..d011b17 100644 --- a/docs/linux/kfuncs/bpf_cpumask_first_zero.md +++ b/docs/linux/kfuncs/bpf_cpumask_first_zero.md @@ -15,6 +15,8 @@ Get the index of the first unset bit in the CPU-mask. Find the index of the first unset bit of the CPU-mask. A `struct bpf_cpumask` pointer may be safely passed to this function. +**Signature** + `#!c u32 bpf_cpumask_first_zero(const struct cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_full.md b/docs/linux/kfuncs/bpf_cpumask_full.md index 357e11b..78aa46c 100644 --- a/docs/linux/kfuncs/bpf_cpumask_full.md +++ b/docs/linux/kfuncs/bpf_cpumask_full.md @@ -20,6 +20,8 @@ Return: A `struct bpf_cpumask` pointer may be safely passed to `cpumask`. +**Signature** + `#!c bool bpf_cpumask_full(const struct cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_intersects.md b/docs/linux/kfuncs/bpf_cpumask_intersects.md index f9b4c91..549dd55 100644 --- a/docs/linux/kfuncs/bpf_cpumask_intersects.md +++ b/docs/linux/kfuncs/bpf_cpumask_intersects.md @@ -21,6 +21,8 @@ Return: `struct bpf_cpumask` pointers may be safely passed to `src1` and `src2`. +**Signature** + `#!c bool bpf_cpumask_intersects(const struct cpumask *src1, const struct cpumask *src2)` diff --git a/docs/linux/kfuncs/bpf_cpumask_or.md b/docs/linux/kfuncs/bpf_cpumask_or.md index 641ba86..e5f5d99 100644 --- a/docs/linux/kfuncs/bpf_cpumask_or.md +++ b/docs/linux/kfuncs/bpf_cpumask_or.md @@ -18,6 +18,8 @@ OR two CPU-masks and store the result. `struct bpf_cpumask` pointers may be safely passed to `src1` and `src2`. +**Signature** + `#!c void bpf_cpumask_or(struct bpf_cpumask *dst, const struct cpumask *src1, const struct cpumask *src2)` diff --git a/docs/linux/kfuncs/bpf_cpumask_release.md b/docs/linux/kfuncs/bpf_cpumask_release.md index 4ae1c75..7051d68 100644 --- a/docs/linux/kfuncs/bpf_cpumask_release.md +++ b/docs/linux/kfuncs/bpf_cpumask_release.md @@ -16,6 +16,8 @@ Releases a previously acquired reference to a BPF CPU-mask. When the final reference of the BPF CPU-mask has been released, it is subsequently freed in an RCU callback in the BPF memory allocator. +**Signature** + `#!c void bpf_cpumask_release(struct bpf_cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_set_cpu.md b/docs/linux/kfuncs/bpf_cpumask_set_cpu.md index ba742f1..fa56937 100644 --- a/docs/linux/kfuncs/bpf_cpumask_set_cpu.md +++ b/docs/linux/kfuncs/bpf_cpumask_set_cpu.md @@ -16,6 +16,8 @@ Set a bit for a CPU in a BPF CPU-mask. `cpumask`: The BPF CPU-mask in which a bit is being set. +**Signature** + `#!c void bpf_cpumask_set_cpu(u32 cpu, struct bpf_cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_setall.md b/docs/linux/kfuncs/bpf_cpumask_setall.md index 93890f0..97a8a55 100644 --- a/docs/linux/kfuncs/bpf_cpumask_setall.md +++ b/docs/linux/kfuncs/bpf_cpumask_setall.md @@ -14,6 +14,8 @@ Set all of the bits in a BPF CPU-mask. `cpumask`: The BPF CPU-mask having all of its bits set. +**Signature** + `#!c void bpf_cpumask_setall(struct bpf_cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_subset.md b/docs/linux/kfuncs/bpf_cpumask_subset.md index 5c2e2ad..2abaf2a 100644 --- a/docs/linux/kfuncs/bpf_cpumask_subset.md +++ b/docs/linux/kfuncs/bpf_cpumask_subset.md @@ -21,6 +21,8 @@ Return: `struct bpf_cpumask` pointers may be safely passed to `src1` and `src2`. +**Signature** + `#!c bool bpf_cpumask_subset(const struct cpumask *src1, const struct cpumask *src2)` diff --git a/docs/linux/kfuncs/bpf_cpumask_test_and_clear_cpu.md b/docs/linux/kfuncs/bpf_cpumask_test_and_clear_cpu.md index 0fe7525..e5c5e36 100644 --- a/docs/linux/kfuncs/bpf_cpumask_test_and_clear_cpu.md +++ b/docs/linux/kfuncs/bpf_cpumask_test_and_clear_cpu.md @@ -19,6 +19,8 @@ Return: * `true` - `cpu` is set in the CPU-mask * `false` - `cpu` was not set in the CPU-mask, or `cpu` is invalid. +**Signature** + `#!c bool bpf_cpumask_test_and_clear_cpu(u32 cpu, struct bpf_cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_test_and_set_cpu.md b/docs/linux/kfuncs/bpf_cpumask_test_and_set_cpu.md index 28d3a21..a94240f 100644 --- a/docs/linux/kfuncs/bpf_cpumask_test_and_set_cpu.md +++ b/docs/linux/kfuncs/bpf_cpumask_test_and_set_cpu.md @@ -19,6 +19,8 @@ Return: * `true` - `cpu` is set in the CPU-mask * `false` - `cpu` was not set in the CPU-mask, or `cpu` is invalid. +**Signature** + `#!c bool bpf_cpumask_test_and_set_cpu(u32 cpu, struct bpf_cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_test_cpu.md b/docs/linux/kfuncs/bpf_cpumask_test_cpu.md index 12cb9c0..5e5b0bb 100644 --- a/docs/linux/kfuncs/bpf_cpumask_test_cpu.md +++ b/docs/linux/kfuncs/bpf_cpumask_test_cpu.md @@ -21,6 +21,8 @@ Return: * `false` - `cpu` was not set in the CPU-mask, or `cpu` is an invalid cpu. +**Signature** + `#!c bool bpf_cpumask_test_cpu(u32 cpu, const struct cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_weight.md b/docs/linux/kfuncs/bpf_cpumask_weight.md index 633bb79..dc84fa2 100644 --- a/docs/linux/kfuncs/bpf_cpumask_weight.md +++ b/docs/linux/kfuncs/bpf_cpumask_weight.md @@ -16,6 +16,8 @@ Return the number of bits in CPU-mask. Count the number of set bits in the given CPU-mask. +**Signature** + `#!c u32 bpf_cpumask_weight(const struct cpumask *cpumask)` diff --git a/docs/linux/kfuncs/bpf_cpumask_xor.md b/docs/linux/kfuncs/bpf_cpumask_xor.md index 1c1dec1..af6aae5 100644 --- a/docs/linux/kfuncs/bpf_cpumask_xor.md +++ b/docs/linux/kfuncs/bpf_cpumask_xor.md @@ -18,6 +18,8 @@ XOR two CPU-masks and store the result. `struct bpf_cpumask` pointers may be safely passed to `src1` and `src2`. +**Signature** + `#!c void bpf_cpumask_xor(struct bpf_cpumask *dst, const struct cpumask *src1, const struct cpumask *src2)` diff --git a/docs/linux/kfuncs/bpf_crypto_ctx_acquire.md b/docs/linux/kfuncs/bpf_crypto_ctx_acquire.md index 6c6fba8..eb1165d 100644 --- a/docs/linux/kfuncs/bpf_crypto_ctx_acquire.md +++ b/docs/linux/kfuncs/bpf_crypto_ctx_acquire.md @@ -20,6 +20,8 @@ Acquires a reference to a BPF crypto context. The context returned by this funct Returns `ctx` on success, or `NULL` if a reference could not be acquired. +**Signature** + `#!c struct bpf_crypto_ctx *bpf_crypto_ctx_acquire(struct bpf_crypto_ctx *ctx)` diff --git a/docs/linux/kfuncs/bpf_crypto_ctx_create.md b/docs/linux/kfuncs/bpf_crypto_ctx_create.md index c1a103f..8a141a9 100644 --- a/docs/linux/kfuncs/bpf_crypto_ctx_create.md +++ b/docs/linux/kfuncs/bpf_crypto_ctx_create.md @@ -24,6 +24,8 @@ Allocates a crypto context that can be used, acquired, and released by a BPF pro Returns an allocated crypto context on success, may return NULL if no memory is available. +**Signature** + `#!c struct bpf_crypto_ctx *bpf_crypto_ctx_create(const struct bpf_crypto_params *params, u32 params__sz, int *err)` diff --git a/docs/linux/kfuncs/bpf_crypto_ctx_release.md b/docs/linux/kfuncs/bpf_crypto_ctx_release.md index 5ba2cc9..0fbc214 100644 --- a/docs/linux/kfuncs/bpf_crypto_ctx_release.md +++ b/docs/linux/kfuncs/bpf_crypto_ctx_release.md @@ -16,6 +16,8 @@ Releases a previously acquired reference to a BPF crypto context. When the final `ctx`: The crypto context being released. +**Signature** + `#!c void bpf_crypto_ctx_release(struct bpf_crypto_ctx *ctx)` diff --git a/docs/linux/kfuncs/bpf_crypto_decrypt.md b/docs/linux/kfuncs/bpf_crypto_decrypt.md index c5c1256..2a49046 100644 --- a/docs/linux/kfuncs/bpf_crypto_decrypt.md +++ b/docs/linux/kfuncs/bpf_crypto_decrypt.md @@ -26,6 +26,8 @@ Decrypts provided buffer using IV data and the crypto context. Crypto context mu Return 0 on success, or a negative error code on failure. +**Signature** + `#!c int bpf_crypto_decrypt(struct bpf_crypto_ctx *ctx, const struct bpf_dynptr *src, const struct bpf_dynptr *dst, const struct bpf_dynptr *siv__nullable)` diff --git a/docs/linux/kfuncs/bpf_crypto_encrypt.md b/docs/linux/kfuncs/bpf_crypto_encrypt.md index 7286253..ba295be 100644 --- a/docs/linux/kfuncs/bpf_crypto_encrypt.md +++ b/docs/linux/kfuncs/bpf_crypto_encrypt.md @@ -26,6 +26,8 @@ Encrypts provided buffer using IV data and the crypto context. Crypto context mu Return 0 on success, or a negative error code on failure. +**Signature** + `#!c int bpf_crypto_encrypt(struct bpf_crypto_ctx *ctx, const struct bpf_dynptr *src, const struct bpf_dynptr *dst, const struct bpf_dynptr *siv__nullable)` diff --git a/docs/linux/kfuncs/bpf_ct_change_status.md b/docs/linux/kfuncs/bpf_ct_change_status.md index 3a99443..bfe196f 100644 --- a/docs/linux/kfuncs/bpf_ct_change_status.md +++ b/docs/linux/kfuncs/bpf_ct_change_status.md @@ -21,6 +21,8 @@ This must be invoked for referenced `PTR_TO_BTF_ID` to `nf_conn`. `status`: New status value. +**Signature** + `#!c int bpf_ct_change_status(struct nf_conn *nfct, u32 status)` diff --git a/docs/linux/kfuncs/bpf_ct_change_timeout.md b/docs/linux/kfuncs/bpf_ct_change_timeout.md index 589104f..6c680e0 100644 --- a/docs/linux/kfuncs/bpf_ct_change_timeout.md +++ b/docs/linux/kfuncs/bpf_ct_change_timeout.md @@ -21,6 +21,8 @@ This helper must be invoked for refcounted pointer to `nf_conn`. `timeout`: New timeout in msecs. +**Signature** + `#!c int bpf_ct_change_timeout(struct nf_conn *nfct, u32 timeout)` diff --git a/docs/linux/kfuncs/bpf_ct_insert_entry.md b/docs/linux/kfuncs/bpf_ct_insert_entry.md index 8e43328..37bde34 100644 --- a/docs/linux/kfuncs/bpf_ct_insert_entry.md +++ b/docs/linux/kfuncs/bpf_ct_insert_entry.md @@ -18,6 +18,8 @@ This must be invoked for referenced `PTR_TO_BTF_ID`. `nfct__ref`: Pointer to referenced `nf_conn___init` object, obtained using `bpf_xdp_ct_alloc` or `bpf_skb_ct_alloc`. +**Signature** + `#!c struct nf_conn *bpf_ct_insert_entry(struct nf_conn___init *nfct_i)` diff --git a/docs/linux/kfuncs/bpf_ct_release.md b/docs/linux/kfuncs/bpf_ct_release.md index 60a04d8..8809a1c 100644 --- a/docs/linux/kfuncs/bpf_ct_release.md +++ b/docs/linux/kfuncs/bpf_ct_release.md @@ -18,6 +18,8 @@ This must be invoked for referenced `PTR_TO_BTF_ID`, and the verifier rejects th `nf_conn`: Pointer to referenced `nf_conn` object, obtained using [`bpf_xdp_ct_lookup`](bpf_xdp_ct_lookup.md) or [`bpf_skb_ct_lookup`](bpf_skb_ct_alloc.md). +**Signature** + `#!c void bpf_ct_release(struct nf_conn *nfct)` diff --git a/docs/linux/kfuncs/bpf_ct_set_nat_info.md b/docs/linux/kfuncs/bpf_ct_set_nat_info.md index cee61fc..ef36e4f 100644 --- a/docs/linux/kfuncs/bpf_ct_set_nat_info.md +++ b/docs/linux/kfuncs/bpf_ct_set_nat_info.md @@ -24,6 +24,8 @@ Set source or destination address network translation address of the newly alloc `manip`: `NF_NAT_MANIP_SRC` or `NF_NAT_MANIP_DST` +**Signature** + `#!c int bpf_ct_set_nat_info(struct nf_conn___init *nfct, union nf_inet_addr *addr, int port, nf_nat_manip_type manip)` diff --git a/docs/linux/kfuncs/bpf_ct_set_status.md b/docs/linux/kfuncs/bpf_ct_set_status.md index 8d0bd7b..c6c459e 100644 --- a/docs/linux/kfuncs/bpf_ct_set_status.md +++ b/docs/linux/kfuncs/bpf_ct_set_status.md @@ -21,6 +21,8 @@ This must be invoked for referenced `PTR_TO_BTF_ID` to `nf_conn___init`. `status`: New status value. +**Signature** + `#!c int bpf_ct_set_status(const struct nf_conn___init *nfct, u32 status)` diff --git a/docs/linux/kfuncs/bpf_ct_set_timeout.md b/docs/linux/kfuncs/bpf_ct_set_timeout.md index 59028f3..f6667f1 100644 --- a/docs/linux/kfuncs/bpf_ct_set_timeout.md +++ b/docs/linux/kfuncs/bpf_ct_set_timeout.md @@ -21,6 +21,8 @@ This helper must be invoked for refcounted pointer to `nf_conn___init`. `timeout`: Timeout in msecs. +**Signature** + `#!c void bpf_ct_set_timeout(struct nf_conn___init *nfct, u32 timeout)` diff --git a/docs/linux/kfuncs/bpf_dynptr_adjust.md b/docs/linux/kfuncs/bpf_dynptr_adjust.md index 56f0167..4bbd17e 100644 --- a/docs/linux/kfuncs/bpf_dynptr_adjust.md +++ b/docs/linux/kfuncs/bpf_dynptr_adjust.md @@ -14,6 +14,8 @@ Adjusts the dynptr to reflect the new [start, end) interval. It advances the offset of the dynptr by `start` bytes, and if end is less than the size of the dynptr, then this will trim the dynptr accordingly. +**Signature** + `#!c int bpf_dynptr_adjust(const struct bpf_dynptr *p, u32 start, u32 end)` @@ -27,8 +29,12 @@ Adjusting the dynptr interval may be useful in certain situations. For example, The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_dynptr_clone.md b/docs/linux/kfuncs/bpf_dynptr_clone.md index 198ae63..4007153 100644 --- a/docs/linux/kfuncs/bpf_dynptr_clone.md +++ b/docs/linux/kfuncs/bpf_dynptr_clone.md @@ -21,6 +21,8 @@ Any writes to a dynptr will be reflected across all instances (by 'instance', th Changing the view of the dynptr (for example advancing the offset or trimming the size) will only affect that dynptr and not affect any other instances. +**Signature** + `#!c int bpf_dynptr_clone(const struct bpf_dynptr *p, struct bpf_dynptr *clone__uninit)` @@ -34,8 +36,12 @@ One example use case where cloning may be helpful is for hashing or iterating th The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_dynptr_from_skb.md b/docs/linux/kfuncs/bpf_dynptr_from_skb.md index 9907075..dc9d4d0 100644 --- a/docs/linux/kfuncs/bpf_dynptr_from_skb.md +++ b/docs/linux/kfuncs/bpf_dynptr_from_skb.md @@ -16,6 +16,8 @@ For bpf program types that don't support writes on skb data, the dynptr is read- For reads and writes through the [`bpf_dynptr_read()`](../helper-function/bpf_dynptr_read.md) and [`bpf_dynptr_write()`](../helper-function/bpf_dynptr_write.md) interfaces, reading and writing from/to data in the head as well as from/to non-linear paged buffers is supported. Data slices through the bpf_dynptr_data API are not supported; instead [`bpf_dynptr_slice()`](bpf_dynptr_slice.md) and [`bpf_dynptr_slice_rdwr()`](bpf_dynptr_slice_rdwr.md) should be used. +**Signature** + `#!c int bpf_dynptr_from_skb(struct __sk_buff *s, u64 flags, struct bpf_dynptr *ptr__uninit)` @@ -29,7 +31,12 @@ The dynptr acts on skb data. skb dynptrs have two main benefits. One is that the The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) - [`BPF_PROG_TYPE_LWT_SEG6LOCAL`](../program-type/BPF_PROG_TYPE_LWT_SEG6LOCAL.md) @@ -39,6 +46,7 @@ The following program types can make use of this kfunc: - [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md) - [`BPF_PROG_TYPE_SK_SKB`](../program-type/BPF_PROG_TYPE_SK_SKB.md) - [`BPF_PROG_TYPE_SOCKET_FILTER`](../program-type/BPF_PROG_TYPE_SOCKET_FILTER.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) ### Example diff --git a/docs/linux/kfuncs/bpf_dynptr_from_xdp.md b/docs/linux/kfuncs/bpf_dynptr_from_xdp.md index 9824970..8f97b53 100644 --- a/docs/linux/kfuncs/bpf_dynptr_from_xdp.md +++ b/docs/linux/kfuncs/bpf_dynptr_from_xdp.md @@ -14,6 +14,8 @@ Get dynptrs whose underlying pointer points to a xdp_buff. For reads and writes on the dynptr, this includes reading/writing from/to and across fragments. Data slices through the [`bpf_dynptr_data`](../helper-function/bpf_dynptr_data.md) API are not supported; instead [`bpf_dynptr_slice()`](bpf_dynptr_slice.md) and [`bpf_dynptr_slice_rdwr()`](bpf_dynptr_slice_rdwr.md) should be used. +**Signature** + `#!c int bpf_dynptr_from_xdp(struct xdp_md *x, u64 flags, struct bpf_dynptr *ptr__uninit)` diff --git a/docs/linux/kfuncs/bpf_dynptr_is_null.md b/docs/linux/kfuncs/bpf_dynptr_is_null.md index 0dc79f2..a214311 100644 --- a/docs/linux/kfuncs/bpf_dynptr_is_null.md +++ b/docs/linux/kfuncs/bpf_dynptr_is_null.md @@ -15,6 +15,8 @@ Returns true if the dynptr is null / invalid. Returns true if the dynptr is `null` / invalid (determined by whether `ptr->data` is `NULL`), else false if the dynptr is a valid dynptr. +**Signature** + `#!c bool bpf_dynptr_is_null(const struct bpf_dynptr *p)` @@ -29,8 +31,12 @@ the dynptr is a valid dynptr. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_dynptr_is_rdonly.md b/docs/linux/kfuncs/bpf_dynptr_is_rdonly.md index 1401500..d75ee37 100644 --- a/docs/linux/kfuncs/bpf_dynptr_is_rdonly.md +++ b/docs/linux/kfuncs/bpf_dynptr_is_rdonly.md @@ -14,6 +14,8 @@ Returns true if the dynptr is read-only `bpf_dynptr_is_rdonly` returns true if the dynptr is read-only, else false if the dynptr is read-writable. If the dynptr is null / invalid, false is returned by default. +**Signature** + `#!c bool bpf_dynptr_is_rdonly(const struct bpf_dynptr *p)` @@ -28,8 +30,12 @@ Returns true if the dynptr is read-only The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_dynptr_size.md b/docs/linux/kfuncs/bpf_dynptr_size.md index 3a731ea..ed45f8f 100644 --- a/docs/linux/kfuncs/bpf_dynptr_size.md +++ b/docs/linux/kfuncs/bpf_dynptr_size.md @@ -12,6 +12,8 @@ Returns the number of usable bytes in a dynptr. ## Definition +**Signature** + `#!c __u32 bpf_dynptr_size(const struct bpf_dynptr *p)` @@ -26,8 +28,12 @@ Returns the number of usable bytes in a dynptr. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_dynptr_slice.md b/docs/linux/kfuncs/bpf_dynptr_slice.md index 429ee40..37b85ec 100644 --- a/docs/linux/kfuncs/bpf_dynptr_slice.md +++ b/docs/linux/kfuncs/bpf_dynptr_slice.md @@ -14,6 +14,8 @@ Get a pointer to dynptr data up to `len` bytes for read only access. If the dynptr doesn't have continuous data up to `len` bytes, return NULL. +**Signature** + `#!c void *bpf_dynptr_slice(const struct bpf_dynptr *p, u32 offset, void *buffer__opt, u32 buffer__szk)` @@ -32,8 +34,12 @@ If the dynptr doesn't have continuous data up to `len` bytes, return NULL. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_dynptr_slice_rdwr.md b/docs/linux/kfuncs/bpf_dynptr_slice_rdwr.md index fb92b2e..ad9f1fe 100644 --- a/docs/linux/kfuncs/bpf_dynptr_slice_rdwr.md +++ b/docs/linux/kfuncs/bpf_dynptr_slice_rdwr.md @@ -14,6 +14,8 @@ Get a pointer to dynptr data up to `len` bytes for read write access. If the dynptr doesn't have continuous data up to `len` bytes, or the dynptr is read only, return `NULL`. +**Signature** + `#!c void *bpf_dynptr_slice_rdwr(const struct bpf_dynptr *p, u32 offset, void *buffer__opt, u32 buffer__szk)` @@ -32,8 +34,12 @@ If the dynptr doesn't have continuous data up to `len` bytes, or the dynptr is r The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_get_dentry_xattr.md b/docs/linux/kfuncs/bpf_get_dentry_xattr.md new file mode 100644 index 0000000..19cc82b --- /dev/null +++ b/docs/linux/kfuncs/bpf_get_dentry_xattr.md @@ -0,0 +1,58 @@ +--- +title: "KFunc 'bpf_get_dentry_xattr'" +description: "This page documents the 'bpf_get_dentry_xattr' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_get_dentry_xattr` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/ac13a4261afe81ca423eddd8e6571078fe2a7cea) + + +This function gets extended attribute(xattr) of a directory entry(dentry). + +## Definition + +Get xattr `name__str` of `dentry` and store the output in `value_ptr`. + +For security reasons, only `name__str` with prefix "user." is allowed. + +**Parameters** + +`dentry`: dentry to get xattr from + +`name__str`: name of the xattr + +`value_p`: output buffer of the xattr value + +**Returns** + +0 on success, a negative value on error. + + +**Signature** + + +`#!c int bpf_get_dentry_xattr(struct dentry *dentry, const char *name__str, struct bpf_dynptr *value_p)` + +!!! note + This function may sleep, and therefore can only be used from [sleepable programs](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable). + + +## Usage + +!!! example "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`](../program-type/BPF_PROG_TYPE_LSM.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_get_file_xattr.md b/docs/linux/kfuncs/bpf_get_file_xattr.md index 67572c1..5c102b6 100644 --- a/docs/linux/kfuncs/bpf_get_file_xattr.md +++ b/docs/linux/kfuncs/bpf_get_file_xattr.md @@ -16,10 +16,12 @@ Get extended attributed `name__str` of `file` and store the output in `value_ptr For security reasons, only `name__str` with prefix "user." is allowed. -**Return** +**Returns** 0 on success, a negative value on error. +**Signature** + `#!c int bpf_get_file_xattr(struct file *file, const char *name__str, struct bpf_dynptr *value_p)` diff --git a/docs/linux/kfuncs/bpf_get_fsverity_digest.md b/docs/linux/kfuncs/bpf_get_fsverity_digest.md index 3a43c80..c792629 100644 --- a/docs/linux/kfuncs/bpf_get_fsverity_digest.md +++ b/docs/linux/kfuncs/bpf_get_fsverity_digest.md @@ -12,6 +12,8 @@ Get the `fs-verity` digest of a file. ## Definition +**Signature** + `#!c int bpf_get_fsverity_digest(struct file *file, struct bpf_dynptr *digest_p)` diff --git a/docs/linux/kfuncs/bpf_get_kmem_cache.md b/docs/linux/kfuncs/bpf_get_kmem_cache.md new file mode 100644 index 0000000..53bd220 --- /dev/null +++ b/docs/linux/kfuncs/bpf_get_kmem_cache.md @@ -0,0 +1,109 @@ +--- +title: "KFunc 'bpf_get_kmem_cache'" +description: "This page documents the 'bpf_get_kmem_cache' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_get_kmem_cache` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/a992d7a3979120fbd7c13435d27b3da8d9ed095a) + + +This function returns slab cache information from a virtual address of a slab object. + +## Definition + +This function returns slab cache information from a virtual address of a slab object. + +It doesn't grab a reference count of the `kmem_cache` so the caller is responsible to manage the access. The returned point is marked as `PTR_UNTRUSTED`. + +**Parameters** + +`addr`: virtual address of the slab object + +**Returns** + +A valid `kmem_cache` pointer, otherwise `NULL`. + +**Signature** + + +`#!c struct kmem_cache *bpf_get_kmem_cache(u64 addr)` + + +## Usage + +This kfunc has many possible use cases. One example is its usage by perf to resolve names of slab objects, when used in combination with a slab allocator iterator(`iter/kmem_cache`). see: [commit](https://github.com/torvalds/linux/commit/0c631ef07c96536a66d8168dc7e176de5fa82878) + +### Program types + +The following program types can make use of this kfunc: + + +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) +- [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) +- [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) +- [`BPF_PROG_TYPE_LWT_SEG6LOCAL`](../program-type/BPF_PROG_TYPE_LWT_SEG6LOCAL.md) +- [`BPF_PROG_TYPE_LWT_XMIT`](../program-type/BPF_PROG_TYPE_LWT_XMIT.md) +- [`BPF_PROG_TYPE_NETFILTER`](../program-type/BPF_PROG_TYPE_NETFILTER.md) +- [`BPF_PROG_TYPE_SCHED_ACT`](../program-type/BPF_PROG_TYPE_SCHED_ACT.md) +- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md) +- [`BPF_PROG_TYPE_SK_SKB`](../program-type/BPF_PROG_TYPE_SK_SKB.md) +- [`BPF_PROG_TYPE_SOCKET_FILTER`](../program-type/BPF_PROG_TYPE_SOCKET_FILTER.md) +- [`BPF_PROG_TYPE_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) +- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md) + + +### Example + +```c +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2024 Google */ +#include +#include +#include +#include "bpf_experimental.h" + +char _license[] SEC("license") = "GPL"; + +#define SLAB_NAME_MAX 32 + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(key_size, sizeof(void *)); + __uint(value_size, SLAB_NAME_MAX); + __uint(max_entries, 1); +} slab_hash SEC(".maps"); + +extern struct kmem_cache *bpf_get_kmem_cache(u64 addr) __ksym; + +/* Result, will be checked by userspace */ +int task_struct_found; + +SEC("raw_tp/bpf_test_finish") +int BPF_PROG(check_task_struct) +{ + u64 curr = bpf_get_current_task(); + struct kmem_cache *s; + char *name; + + s = bpf_get_kmem_cache(curr); + if (s == NULL) { + task_struct_found = -1; + return 0; + } + name = bpf_map_lookup_elem(&slab_hash, &s); + if (name && !bpf_strncmp(name, 11, "task_struct")) + task_struct_found = 1; + else + task_struct_found = -2; + return 0; +} +``` diff --git a/docs/linux/kfuncs/bpf_get_task_exe_file.md b/docs/linux/kfuncs/bpf_get_task_exe_file.md new file mode 100644 index 0000000..a788c81 --- /dev/null +++ b/docs/linux/kfuncs/bpf_get_task_exe_file.md @@ -0,0 +1,62 @@ +--- +title: "KFunc 'bpf_get_task_exe_file'" +description: "This page documents the 'bpf_get_task_exe_file' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_get_task_exe_file` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/d08e2045ebf0f5f2a97ad22cc7dae398b35354ba) + + +This function gets a reference on the `exe_file` struct file member of the `mm_struct` that is nested within the supplied `task_struct`. + +## Definition + +Get a reference on the `exe_file` struct file member field of the `mm_struct` nested within the supplied `task`. The referenced file pointer acquired by this BPF kfunc must be released using [`bpf_put_file`](bpf_put_file.md). Failing to call [`bpf_put_file`](bpf_put_file.md) on the returned referenced struct file pointer that has been acquired by this BPF kfunc will result in the BPF program being rejected by the BPF verifier. + +This BPF kfunc may only be called from BPF LSM programs. + +Internally, this BPF kfunc leans on `get_task_exe_file`, such that calling `bpf_get_task_exe_file` would be analogous to calling `get_task_exe_file` directly in kernel context. + +**Parameters** + +`task`: `task_struct` of which the nested `mm_struct` `exe_file` member to get a reference on + +**Returns** + +A referenced struct file pointer to the `exe_file` member of the `mm_struct` that is nested within the supplied `task`. On error, `NULL` is returned. + +**Signature** + + +`#!c struct file *bpf_get_task_exe_file(struct task_struct *task)` + +!!! 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`](../helper-function/bpf_kptr_xchg.md)). 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 + +!!! example "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`](../program-type/BPF_PROG_TYPE_LSM.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_iter_bits_destroy.md b/docs/linux/kfuncs/bpf_iter_bits_destroy.md index 80d1dc0..2882fd2 100644 --- a/docs/linux/kfuncs/bpf_iter_bits_destroy.md +++ b/docs/linux/kfuncs/bpf_iter_bits_destroy.md @@ -18,6 +18,8 @@ Destroy the resource associated with the `bpf_iter_bits`. `it`: The `bpf_iter_bits` to be destroyed +**Signature** + `#!c void bpf_iter_bits_destroy(struct bpf_iter_bits *it)` @@ -32,8 +34,12 @@ Destroy the resource associated with the `bpf_iter_bits`. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_bits_new.md b/docs/linux/kfuncs/bpf_iter_bits_new.md index 1ef7993..6da0442 100644 --- a/docs/linux/kfuncs/bpf_iter_bits_new.md +++ b/docs/linux/kfuncs/bpf_iter_bits_new.md @@ -22,10 +22,12 @@ This function initializes a new `bpf_iter_bits` structure for iterating over a m `nr_words`: The size of the specified memory area, measured in 8-byte units. Due to the limitation of memalloc, it can't be greater than 512. -**Return** +**Returns** On success, 0 is returned. On failure, `ERR` is returned. +**Signature** + `#!c int bpf_iter_bits_new(struct bpf_iter_bits *it, const u64 *unsafe_ptr__ign, u32 nr_words)` @@ -40,8 +42,12 @@ On success, 0 is returned. On failure, `ERR` is returned. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_bits_next.md b/docs/linux/kfuncs/bpf_iter_bits_next.md index 37a7f33..955fbbc 100644 --- a/docs/linux/kfuncs/bpf_iter_bits_next.md +++ b/docs/linux/kfuncs/bpf_iter_bits_next.md @@ -18,10 +18,12 @@ This function returns a pointer to a number representing the value of the next b `it`: The `bpf_iter_bits` to be checked -**Return** +**Returns** If there are no further bits available, it returns `NULL`. +**Signature** + `#!c int *bpf_iter_bits_next(struct bpf_iter_bits *it)` @@ -40,8 +42,12 @@ If there are no further bits available, it returns `NULL`. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_css_destroy.md b/docs/linux/kfuncs/bpf_iter_css_destroy.md index de0afa1..8a3a2b4 100644 --- a/docs/linux/kfuncs/bpf_iter_css_destroy.md +++ b/docs/linux/kfuncs/bpf_iter_css_destroy.md @@ -12,6 +12,8 @@ Destroy a cGroup iterator. ## Definition +**Signature** + `#!c void bpf_iter_css_destroy(struct bpf_iter_css *it)` @@ -25,8 +27,12 @@ See [`bpf_iter_css_new`](bpf_iter_css_new.md#usage) for usage details. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_css_new.md b/docs/linux/kfuncs/bpf_iter_css_new.md index 00143b8..e6f75f9 100644 --- a/docs/linux/kfuncs/bpf_iter_css_new.md +++ b/docs/linux/kfuncs/bpf_iter_css_new.md @@ -18,6 +18,8 @@ Initialize a cGroup iterator. - `BPF_CGROUP_ITER_DESCENDANTS_POST`: Walk descendants of the cgroup in post-order. - `BPF_CGROUP_ITER_ANCESTORS_UP`: Walk ancestors of the cgroup upward. +**Signature** + `#!c int bpf_iter_css_new(struct bpf_iter_css *it, struct cgroup_subsys_state *start, unsigned int flags)` @@ -38,8 +40,12 @@ Initialize a cGroup iterator. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_css_next.md b/docs/linux/kfuncs/bpf_iter_css_next.md index 9e23af7..c3c3032 100644 --- a/docs/linux/kfuncs/bpf_iter_css_next.md +++ b/docs/linux/kfuncs/bpf_iter_css_next.md @@ -12,6 +12,8 @@ Iterate over cGroup subsystem states. ## Definition +**Signature** + `#!c struct cgroup_subsys_state *bpf_iter_css_next(struct bpf_iter_css *it)` @@ -29,8 +31,12 @@ See [`bpf_iter_css_new`](bpf_iter_css_new.md#usage) for usage details. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_css_task_destroy.md b/docs/linux/kfuncs/bpf_iter_css_task_destroy.md index fa915c5..9c2dddb 100644 --- a/docs/linux/kfuncs/bpf_iter_css_task_destroy.md +++ b/docs/linux/kfuncs/bpf_iter_css_task_destroy.md @@ -10,6 +10,8 @@ description: "This page documents the 'bpf_iter_css_task_destroy' eBPF kfunc, in ## Definition +**Signature** + `#!c void bpf_iter_css_task_destroy(struct bpf_iter_css_task *it)` @@ -24,8 +26,12 @@ description: "This page documents the 'bpf_iter_css_task_destroy' eBPF kfunc, in The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_css_task_new.md b/docs/linux/kfuncs/bpf_iter_css_task_new.md index 0e66887..db0cf0c 100644 --- a/docs/linux/kfuncs/bpf_iter_css_task_new.md +++ b/docs/linux/kfuncs/bpf_iter_css_task_new.md @@ -18,6 +18,8 @@ Initialize a task iterator for a cGroup. - `CSS_TASK_ITER_PROCS`: Walk only threadgroup leaders. - `CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED`: Walk all threaded css_sets in the domain. +**Signature** + `#!c int bpf_iter_css_task_new(struct bpf_iter_css_task *it, struct cgroup_subsys_state *css, unsigned int flags)` @@ -32,8 +34,12 @@ Initialize a task iterator for a cGroup. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_css_task_next.md b/docs/linux/kfuncs/bpf_iter_css_task_next.md index 5ca4eb6..2064fb4 100644 --- a/docs/linux/kfuncs/bpf_iter_css_task_next.md +++ b/docs/linux/kfuncs/bpf_iter_css_task_next.md @@ -12,6 +12,8 @@ Advance the iterator to the next task. ## Definition +**Signature** + `#!c struct task_struct *bpf_iter_css_task_next(struct bpf_iter_css_task *it)` @@ -29,8 +31,12 @@ See [`bpf_iter_css_task_new`](bpf_iter_css_task_new.md#usage) for usage details. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_kmem_cache_destroy.md b/docs/linux/kfuncs/bpf_iter_kmem_cache_destroy.md new file mode 100644 index 0000000..217983a --- /dev/null +++ b/docs/linux/kfuncs/bpf_iter_kmem_cache_destroy.md @@ -0,0 +1,64 @@ +--- +title: "KFunc 'bpf_iter_kmem_cache_destroy'" +description: "This page documents the 'bpf_iter_kmem_cache_destroy' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_iter_kmem_cache_destroy` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/2e9a548009c2d804e55cdd5b0e9903756cf7d9b3) + + +This function destroys the iterator for slab caches. + +## Definition + +**Parameters** + +`it`: A pointer to a stack allocated `struct bpf_iter_kmem_cache`. + +**Signature** + + +`#!c void bpf_iter_kmem_cache_destroy(struct bpf_iter_kmem_cache *it)` + +!!! note + This function may sleep, and therefore can only be used from [sleepable programs](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable). + + +## Usage + +!!! example "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_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) +- [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) +- [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) +- [`BPF_PROG_TYPE_LWT_SEG6LOCAL`](../program-type/BPF_PROG_TYPE_LWT_SEG6LOCAL.md) +- [`BPF_PROG_TYPE_LWT_XMIT`](../program-type/BPF_PROG_TYPE_LWT_XMIT.md) +- [`BPF_PROG_TYPE_NETFILTER`](../program-type/BPF_PROG_TYPE_NETFILTER.md) +- [`BPF_PROG_TYPE_SCHED_ACT`](../program-type/BPF_PROG_TYPE_SCHED_ACT.md) +- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md) +- [`BPF_PROG_TYPE_SK_SKB`](../program-type/BPF_PROG_TYPE_SK_SKB.md) +- [`BPF_PROG_TYPE_SOCKET_FILTER`](../program-type/BPF_PROG_TYPE_SOCKET_FILTER.md) +- [`BPF_PROG_TYPE_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) +- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_iter_kmem_cache_new.md b/docs/linux/kfuncs/bpf_iter_kmem_cache_new.md new file mode 100644 index 0000000..bcf8309 --- /dev/null +++ b/docs/linux/kfuncs/bpf_iter_kmem_cache_new.md @@ -0,0 +1,68 @@ +--- +title: "KFunc 'bpf_iter_kmem_cache_new'" +description: "This page documents the 'bpf_iter_kmem_cache_new' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_iter_kmem_cache_new` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/2e9a548009c2d804e55cdd5b0e9903756cf7d9b3) + + +This function initializes a iterator for slab caches. + +## Definition + +**Parameters** + +`it`: A pointer to a stack allocated `struct bpf_iter_kmem_cache` that is used to iterate over slab caches. + +**Returns** + +`0` on success, a negative error code on failure + +**Signature** + + +`#!c int bpf_iter_kmem_cache_new(struct bpf_iter_kmem_cache *it)` + +!!! note + This function may sleep, and therefore can only be used from [sleepable programs](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable). + + +## Usage + +!!! example "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_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) +- [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) +- [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) +- [`BPF_PROG_TYPE_LWT_SEG6LOCAL`](../program-type/BPF_PROG_TYPE_LWT_SEG6LOCAL.md) +- [`BPF_PROG_TYPE_LWT_XMIT`](../program-type/BPF_PROG_TYPE_LWT_XMIT.md) +- [`BPF_PROG_TYPE_NETFILTER`](../program-type/BPF_PROG_TYPE_NETFILTER.md) +- [`BPF_PROG_TYPE_SCHED_ACT`](../program-type/BPF_PROG_TYPE_SCHED_ACT.md) +- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md) +- [`BPF_PROG_TYPE_SK_SKB`](../program-type/BPF_PROG_TYPE_SK_SKB.md) +- [`BPF_PROG_TYPE_SOCKET_FILTER`](../program-type/BPF_PROG_TYPE_SOCKET_FILTER.md) +- [`BPF_PROG_TYPE_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) +- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_iter_kmem_cache_next.md b/docs/linux/kfuncs/bpf_iter_kmem_cache_next.md new file mode 100644 index 0000000..31f8123 --- /dev/null +++ b/docs/linux/kfuncs/bpf_iter_kmem_cache_next.md @@ -0,0 +1,72 @@ +--- +title: "KFunc 'bpf_iter_kmem_cache_next'" +description: "This page documents the 'bpf_iter_kmem_cache_next' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_iter_kmem_cache_next` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/2e9a548009c2d804e55cdd5b0e9903756cf7d9b3) + + +This function returns the current slab cache and advances the iterator to the next slab cache. + +## Definition + +**Parameters** + +`it`: A pointer to a stack allocated `struct bpf_iter_kmem_cache` that is used to iterate over slab caches. + +**Returns** + +A pointer to the next slab cache, or `NULL` if there are no more slab caches to iterate over. + +**Signature** + + +`#!c struct kmem_cache *bpf_iter_kmem_cache_next(struct bpf_iter_kmem_cache *it)` + +!!! 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). + +!!! note + This function may sleep, and therefore can only be used from [sleepable programs](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable). + + +## Usage + +!!! example "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_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) +- [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) +- [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) +- [`BPF_PROG_TYPE_LWT_SEG6LOCAL`](../program-type/BPF_PROG_TYPE_LWT_SEG6LOCAL.md) +- [`BPF_PROG_TYPE_LWT_XMIT`](../program-type/BPF_PROG_TYPE_LWT_XMIT.md) +- [`BPF_PROG_TYPE_NETFILTER`](../program-type/BPF_PROG_TYPE_NETFILTER.md) +- [`BPF_PROG_TYPE_SCHED_ACT`](../program-type/BPF_PROG_TYPE_SCHED_ACT.md) +- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md) +- [`BPF_PROG_TYPE_SK_SKB`](../program-type/BPF_PROG_TYPE_SK_SKB.md) +- [`BPF_PROG_TYPE_SOCKET_FILTER`](../program-type/BPF_PROG_TYPE_SOCKET_FILTER.md) +- [`BPF_PROG_TYPE_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) +- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_iter_num_destroy.md b/docs/linux/kfuncs/bpf_iter_num_destroy.md index 59a54bb..9ca36c0 100644 --- a/docs/linux/kfuncs/bpf_iter_num_destroy.md +++ b/docs/linux/kfuncs/bpf_iter_num_destroy.md @@ -14,6 +14,8 @@ This kfunc destroys the iterator `it`. This kfunc destroys the iterator `it`, the iterator can be reused, but as to be re-initialized with [`bpf_iter_num_new`](bpf_iter_num_new.md) before being used again. +**Signature** + `#!c void bpf_iter_num_destroy(struct bpf_iter_num *it)` @@ -27,8 +29,12 @@ See [`bpf_iter_num_new`](bpf_iter_num_new.md#usage) for usage details. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_num_new.md b/docs/linux/kfuncs/bpf_iter_num_new.md index 3383137..ddec52a 100644 --- a/docs/linux/kfuncs/bpf_iter_num_new.md +++ b/docs/linux/kfuncs/bpf_iter_num_new.md @@ -16,6 +16,8 @@ This kfunc initializes the iterator `it`, priming it to do a numeric iteration f If any of the input arguments are invalid, constructor should make sure to still initialize it such that subsequent `bpf_iter_num_next()` calls will return `NULL`. I.e., on error, return error and construct empty iterator. +**Signature** + `#!c int bpf_iter_num_new(struct bpf_iter_num *it, int start, int end)` @@ -33,8 +35,12 @@ The advantages over the [`bpf_loop`](../helper-function/bpf_loop.md) is that we The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_num_next.md b/docs/linux/kfuncs/bpf_iter_num_next.md index 75a32b2..4854bc5 100644 --- a/docs/linux/kfuncs/bpf_iter_num_next.md +++ b/docs/linux/kfuncs/bpf_iter_num_next.md @@ -14,6 +14,8 @@ Get the next number from the iterator. This kfunc returns the next number from the iterator `it`. If the iterator is exhausted, it returns NULL. +**Signature** + `#!c int *bpf_iter_num_next(struct bpf_iter_num *it)` @@ -31,8 +33,12 @@ See [``bpf_iter_num_new``](bpf_iter_num_new.md#usage) for usage details. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_scx_dsq_destroy.md b/docs/linux/kfuncs/bpf_iter_scx_dsq_destroy.md new file mode 100644 index 0000000..7b1ea23 --- /dev/null +++ b/docs/linux/kfuncs/bpf_iter_scx_dsq_destroy.md @@ -0,0 +1,46 @@ +--- +title: "KFunc 'bpf_iter_scx_dsq_destroy'" +description: "This page documents the 'bpf_iter_scx_dsq_destroy' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_iter_scx_dsq_destroy` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/650ba21b131ed1f8ee57826b2c6295a3be221132) + + +This function destroys a DSQ iterator. + +## Definition + +Undo [`bpf_iter_scx_dsq_new`](bpf_iter_scx_dsq_new.md). + +**Parameters** + +`it`: iterator to destroy + +**Signature** + + +`#!c void bpf_iter_scx_dsq_destroy(struct bpf_iter_scx_dsq *it)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_iter_scx_dsq_new.md b/docs/linux/kfuncs/bpf_iter_scx_dsq_new.md new file mode 100644 index 0000000..84bec42 --- /dev/null +++ b/docs/linux/kfuncs/bpf_iter_scx_dsq_new.md @@ -0,0 +1,64 @@ +--- +title: "KFunc 'bpf_iter_scx_dsq_new'" +description: "This page documents the 'bpf_iter_scx_dsq_new' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_iter_scx_dsq_new` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/650ba21b131ed1f8ee57826b2c6295a3be221132) + + +This function creates a DSQ iterator. + +## Definition + +Initialize BPF iterator `it` which can be used with [`bpf_for_each`](../../ebpf-library/libbpf/ebpf/bpf_for_each.md) to walk tasks in the DSQ specified by `dsq_id`. Iteration using `it` only includes tasks which are already queued when this function is invoked. + +**Parameters** + +`it`: iterator to initialize + +`dsq_id`: DSQ to iterate + +`flags`: `SCX_DSQ_ITER_*` + +**Flags** + +`SCX_DSQ_ITER_REV`: iterate in the reverse dispatch order + +**Returns** + +`0` on success, negative error code on failure + +**Signature** + + +`#!c int bpf_iter_scx_dsq_new(struct bpf_iter_scx_dsq *it, u64 dsq_id, u64 flags)` + +!!! note + This kfunc is RCU protected. This means that the kfunc can be called from RCU read-side critical section. + If a program isn't called from RCU read-side critical section, such as sleepable programs, the + [`bpf_rcu_read_lock`](../kfuncs/bpf_rcu_read_lock.md) and + [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) to protect the calls to such KFuncs. + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_iter_scx_dsq_next.md b/docs/linux/kfuncs/bpf_iter_scx_dsq_next.md new file mode 100644 index 0000000..b2ca36c --- /dev/null +++ b/docs/linux/kfuncs/bpf_iter_scx_dsq_next.md @@ -0,0 +1,50 @@ +--- +title: "KFunc 'bpf_iter_scx_dsq_next'" +description: "This page documents the 'bpf_iter_scx_dsq_next' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_iter_scx_dsq_next` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/650ba21b131ed1f8ee57826b2c6295a3be221132) + + +This function progresses a DSQ iterator. + +## Definition + +`it`: iterator to progress + +**Returns** + +The next task. See [`bpf_iter_scx_dsq_new`](bpf_iter_scx_dsq_new.md). + +**Signature** + + +`#!c struct task_struct *bpf_iter_scx_dsq_next(struct bpf_iter_scx_dsq *it)` + +!!! 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 + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_iter_task_destroy.md b/docs/linux/kfuncs/bpf_iter_task_destroy.md index 5edba09..1b65584 100644 --- a/docs/linux/kfuncs/bpf_iter_task_destroy.md +++ b/docs/linux/kfuncs/bpf_iter_task_destroy.md @@ -12,6 +12,8 @@ Destroy a task iterator. ## Definition +**Signature** + `#!c void bpf_iter_task_destroy(struct bpf_iter_task *it)` @@ -26,8 +28,12 @@ Destroy a task iterator. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_task_new.md b/docs/linux/kfuncs/bpf_iter_task_new.md index 5f27a2d..0c03590 100644 --- a/docs/linux/kfuncs/bpf_iter_task_new.md +++ b/docs/linux/kfuncs/bpf_iter_task_new.md @@ -18,6 +18,8 @@ Initialize a task iterator. - `BPF_TASK_ITER_ALL_THREADS`: Iterating all threads in the system. - `BPF_TASK_ITER_PROC_THREADS`: Iterating all threads of a specific tas +**Signature** + `#!c int bpf_iter_task_new(struct bpf_iter_task *it, struct task_struct *task__nullable, unsigned int flags)` @@ -38,8 +40,12 @@ Initialize a task iterator. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_task_next.md b/docs/linux/kfuncs/bpf_iter_task_next.md index 0437c3e..3c09ea6 100644 --- a/docs/linux/kfuncs/bpf_iter_task_next.md +++ b/docs/linux/kfuncs/bpf_iter_task_next.md @@ -12,6 +12,8 @@ Iterate over tasks (processes or threads). ## Definition +**Signature** + `#!c struct task_struct *bpf_iter_task_next(struct bpf_iter_task *it)` @@ -30,8 +32,12 @@ Iterate over tasks (processes or threads). The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_task_vma_destroy.md b/docs/linux/kfuncs/bpf_iter_task_vma_destroy.md index fa1cf36..17dd6f7 100644 --- a/docs/linux/kfuncs/bpf_iter_task_vma_destroy.md +++ b/docs/linux/kfuncs/bpf_iter_task_vma_destroy.md @@ -12,6 +12,8 @@ Destroy the task virtual memory area iterator. ## Definition +**Signature** + `#!c void bpf_iter_task_vma_destroy(struct bpf_iter_task_vma *it)` @@ -25,8 +27,12 @@ See [`bpf_iter_task_vma_new`](bpf_iter_task_vma_new.md#usage) for usage details. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_task_vma_new.md b/docs/linux/kfuncs/bpf_iter_task_vma_new.md index 5a5c8d6..5eff90a 100644 --- a/docs/linux/kfuncs/bpf_iter_task_vma_new.md +++ b/docs/linux/kfuncs/bpf_iter_task_vma_new.md @@ -12,6 +12,8 @@ Create a new task virtual memory area iterator. ## Definition +**Signature** + `#!c int bpf_iter_task_vma_new(struct bpf_iter_task_vma *it, struct task_struct *task, u64 addr)` @@ -26,8 +28,12 @@ Create a new task virtual memory area iterator. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_iter_task_vma_next.md b/docs/linux/kfuncs/bpf_iter_task_vma_next.md index ab02ed1..d2831aa 100644 --- a/docs/linux/kfuncs/bpf_iter_task_vma_next.md +++ b/docs/linux/kfuncs/bpf_iter_task_vma_next.md @@ -12,6 +12,8 @@ Get the next virtual memory area from the iterator. ## Definition +**Signature** + `#!c struct vm_area_struct *bpf_iter_task_vma_next(struct bpf_iter_task_vma *it)` @@ -29,8 +31,12 @@ See [`bpf_iter_task_vma_new`](bpf_iter_task_vma_new.md#usage) for usage details. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_key_put.md b/docs/linux/kfuncs/bpf_key_put.md index 33b520b..5676db7 100644 --- a/docs/linux/kfuncs/bpf_key_put.md +++ b/docs/linux/kfuncs/bpf_key_put.md @@ -14,6 +14,8 @@ Decrement key reference count if key is valid and free bpf_key Decrement the reference count of the key inside `bkey`, if the pointer is valid, and free `bkey`. +**Signature** + `#!c void bpf_key_put(struct bpf_key *bkey)` diff --git a/docs/linux/kfuncs/bpf_list_pop_back.md b/docs/linux/kfuncs/bpf_list_pop_back.md index 0a27281..f197aba 100644 --- a/docs/linux/kfuncs/bpf_list_pop_back.md +++ b/docs/linux/kfuncs/bpf_list_pop_back.md @@ -15,6 +15,8 @@ Remove the entry at the end of the BPF linked list. **Returns** Pointer to bpf_list_node of deleted entry, or NULL if list is empty. +**Signature** + `#!c struct bpf_list_node *bpf_list_pop_back(struct bpf_list_head *head)` diff --git a/docs/linux/kfuncs/bpf_list_pop_front.md b/docs/linux/kfuncs/bpf_list_pop_front.md index 22a8a4e..f527a14 100644 --- a/docs/linux/kfuncs/bpf_list_pop_front.md +++ b/docs/linux/kfuncs/bpf_list_pop_front.md @@ -16,6 +16,8 @@ Remove the entry at the beginning of the BPF linked list. Pointer to bpf_list_node of deleted entry, or NULL if list is empty. +**Signature** + `#!c struct bpf_list_node *bpf_list_pop_front(struct bpf_list_head *head)` diff --git a/docs/linux/kfuncs/bpf_list_push_back_impl.md b/docs/linux/kfuncs/bpf_list_push_back_impl.md index d5d42cd..e82afd8 100644 --- a/docs/linux/kfuncs/bpf_list_push_back_impl.md +++ b/docs/linux/kfuncs/bpf_list_push_back_impl.md @@ -19,6 +19,8 @@ The `meta` and `off` parameters are rewritten by the verifier, no need for BPF p * `0` if the node was successfully added * `-EINVAL` if the node wasn't added because it's already in a list +**Signature** + `#!c int bpf_list_push_back_impl(struct bpf_list_head *head, struct bpf_list_node *node, void *meta__ign, u64 off)` diff --git a/docs/linux/kfuncs/bpf_list_push_front_impl.md b/docs/linux/kfuncs/bpf_list_push_front_impl.md index 26fe239..a026cd8 100644 --- a/docs/linux/kfuncs/bpf_list_push_front_impl.md +++ b/docs/linux/kfuncs/bpf_list_push_front_impl.md @@ -19,6 +19,8 @@ The `meta` and `off` parameters are rewritten by the verifier, no need for BPF p * `0` if the node was successfully added * `-EINVAL` if the node wasn't added because it's already in a list +**Signature** + `#!c int bpf_list_push_front_impl(struct bpf_list_head *head, struct bpf_list_node *node, void *meta__ign, u64 off)` diff --git a/docs/linux/kfuncs/bpf_local_irq_restore.md b/docs/linux/kfuncs/bpf_local_irq_restore.md new file mode 100644 index 0000000..264ac4a --- /dev/null +++ b/docs/linux/kfuncs/bpf_local_irq_restore.md @@ -0,0 +1,60 @@ +--- +title: "KFunc 'bpf_local_irq_restore'" +description: "This page documents the 'bpf_local_irq_restore' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_local_irq_restore` + + +[:octicons-tag-24: v6.14](https://github.com/torvalds/linux/commit/c8e2ee1f3df05dc4caa746c062c6b5791c745c79) + + +This function restores the Interrupt Request(IRQ) state from the stack and re-enables IRQs. + +## Definition + +**Parameters** + +`flags__irq_flag` Pointer to a 64 bit integer where the current IRQ state will be restored. + +**Signature** + + +`#!c void bpf_local_irq_restore(long unsigned int *flags__irq_flag)` + + +## Usage + +Intended use cases are writing IRQ safe data structures (e.g. memory allocator) in BPF programs natively, and use in new spin locking primitives. + +### Program types + +The following program types can make use of this kfunc: + + +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) +- [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) +- [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) +- [`BPF_PROG_TYPE_LWT_SEG6LOCAL`](../program-type/BPF_PROG_TYPE_LWT_SEG6LOCAL.md) +- [`BPF_PROG_TYPE_LWT_XMIT`](../program-type/BPF_PROG_TYPE_LWT_XMIT.md) +- [`BPF_PROG_TYPE_NETFILTER`](../program-type/BPF_PROG_TYPE_NETFILTER.md) +- [`BPF_PROG_TYPE_SCHED_ACT`](../program-type/BPF_PROG_TYPE_SCHED_ACT.md) +- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md) +- [`BPF_PROG_TYPE_SK_SKB`](../program-type/BPF_PROG_TYPE_SK_SKB.md) +- [`BPF_PROG_TYPE_SOCKET_FILTER`](../program-type/BPF_PROG_TYPE_SOCKET_FILTER.md) +- [`BPF_PROG_TYPE_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) +- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_local_irq_save.md b/docs/linux/kfuncs/bpf_local_irq_save.md new file mode 100644 index 0000000..b0f67d1 --- /dev/null +++ b/docs/linux/kfuncs/bpf_local_irq_save.md @@ -0,0 +1,62 @@ +--- +title: "KFunc 'bpf_local_irq_save'" +description: "This page documents the 'bpf_local_irq_save' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_local_irq_save` + + +[:octicons-tag-24: v6.14](https://github.com/torvalds/linux/commit/c8e2ee1f3df05dc4caa746c062c6b5791c745c79) + + +This function saves the current Interrupt Request(IRQ) state to the stack and disable IRQs. + +## Definition + +This function disables IRQs, saving the current state to the stack. The verifier tracks the stored states and enforces that the state is restored before the program exits and that if multiple calls are made, the state is restored in the reverse order using the [`bpf_local_irq_restore`](bpf_local_irq_restore.md) kfunc. + +**Parameters** + +`flags__irq_flag` (output) - Pointer to a 64 bit integer where the current IRQ state will be saved. + +**Signature** + + +`#!c void bpf_local_irq_save(long unsigned int *flags__irq_flag)` + + +## Usage + +Intended use cases are writing IRQ safe data structures (e.g. memory allocator) in BPF programs natively, and use in new spin locking primitives. + +### Program types + +The following program types can make use of this kfunc: + + +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) +- [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) +- [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) +- [`BPF_PROG_TYPE_LWT_SEG6LOCAL`](../program-type/BPF_PROG_TYPE_LWT_SEG6LOCAL.md) +- [`BPF_PROG_TYPE_LWT_XMIT`](../program-type/BPF_PROG_TYPE_LWT_XMIT.md) +- [`BPF_PROG_TYPE_NETFILTER`](../program-type/BPF_PROG_TYPE_NETFILTER.md) +- [`BPF_PROG_TYPE_SCHED_ACT`](../program-type/BPF_PROG_TYPE_SCHED_ACT.md) +- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md) +- [`BPF_PROG_TYPE_SK_SKB`](../program-type/BPF_PROG_TYPE_SK_SKB.md) +- [`BPF_PROG_TYPE_SOCKET_FILTER`](../program-type/BPF_PROG_TYPE_SOCKET_FILTER.md) +- [`BPF_PROG_TYPE_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) +- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_lookup_system_key.md b/docs/linux/kfuncs/bpf_lookup_system_key.md index b3f5885..290e2c1 100644 --- a/docs/linux/kfuncs/bpf_lookup_system_key.md +++ b/docs/linux/kfuncs/bpf_lookup_system_key.md @@ -28,10 +28,12 @@ in those keyrings) keyring (primarily used by the integrity subsystem to verify a kexec'ed kerned image and, possibly, the initramfs signature). -**Return** +**Returns** a bpf_key pointer with an invalid key pointer set from the pre-determined ID on success, a NULL pointer otherwise +**Signature** + `#!c struct bpf_key *bpf_lookup_system_key(u64 id)` diff --git a/docs/linux/kfuncs/bpf_lookup_user_key.md b/docs/linux/kfuncs/bpf_lookup_user_key.md index fff23c0..9c8a1c9 100644 --- a/docs/linux/kfuncs/bpf_lookup_user_key.md +++ b/docs/linux/kfuncs/bpf_lookup_user_key.md @@ -22,10 +22,12 @@ Set `flags` with `KEY_LOOKUP_CREATE`, to attempt creating a requested special ke Set `flags` with `KEY_LOOKUP_PARTIAL`, to lookup a key without waiting for the key construction, and to retrieve uninstantiated keys (keys without data attached to them). -**Return** +**Returns** a bpf_key pointer with a valid key pointer if the key is found, a NULL pointer otherwise. +**Signature** + `#!c struct bpf_key *bpf_lookup_user_key(u32 serial, u64 flags)` diff --git a/docs/linux/kfuncs/bpf_map_sum_elem_count.md b/docs/linux/kfuncs/bpf_map_sum_elem_count.md index b98665a..dfc7098 100644 --- a/docs/linux/kfuncs/bpf_map_sum_elem_count.md +++ b/docs/linux/kfuncs/bpf_map_sum_elem_count.md @@ -15,6 +15,8 @@ Get the sum of a map per-CPU element counters. Get the sum of a map per-CPU element counters. If a map doesn't implement the counter, then the function will always return 0. +**Signature** + `#!c s64 bpf_map_sum_elem_count(const struct bpf_map *map)` @@ -29,8 +31,12 @@ function will always return 0. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_obj_drop_impl.md b/docs/linux/kfuncs/bpf_obj_drop_impl.md index 06aad28..40aef1e 100644 --- a/docs/linux/kfuncs/bpf_obj_drop_impl.md +++ b/docs/linux/kfuncs/bpf_obj_drop_impl.md @@ -17,6 +17,8 @@ All fields of the object that require destruction will be destructed before the The `meta` parameter is rewritten by the verifier, no need for BPF program to set it. +**Signature** + `#!c void bpf_obj_drop_impl(void *p__alloc, void *meta__ign)` diff --git a/docs/linux/kfuncs/bpf_obj_new_impl.md b/docs/linux/kfuncs/bpf_obj_new_impl.md index d50e7e7..f1f68c4 100644 --- a/docs/linux/kfuncs/bpf_obj_new_impl.md +++ b/docs/linux/kfuncs/bpf_obj_new_impl.md @@ -24,6 +24,8 @@ program to set it. A pointer to an object of the type corresponding to the passed in `local_type_id`, or NULL on failure. +**Signature** + `#!c void *bpf_obj_new_impl(u64 local_type_id__k, void *meta__ign)` diff --git a/docs/linux/kfuncs/bpf_path_d_path.md b/docs/linux/kfuncs/bpf_path_d_path.md new file mode 100644 index 0000000..c8c7aa7 --- /dev/null +++ b/docs/linux/kfuncs/bpf_path_d_path.md @@ -0,0 +1,55 @@ +--- +title: "KFunc 'bpf_path_d_path'" +description: "This page documents the 'bpf_path_d_path' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_path_d_path` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/d08e2045ebf0f5f2a97ad22cc7dae398b35354ba) + + +This function resolve the path name for the supplied path. + +## Definition + +Resolve the path name for the supplied `path` and store it in `buf`. This BPF kfunc is the safer variant of the legacy [`bpf_d_path`](../helper-function/bpf_d_path.md) helper and should be used in place of [`bpf_d_path`](../helper-function/bpf_d_path.md) whenever possible. It enforces `KF_TRUSTED_ARGS` semantics, meaning that the supplied `path` must itself hold a valid reference, or else the BPF program will be outright rejected by the BPF verifier. + +This BPF kfunc may only be called from BPF LSM programs. + +**Parameters** + +`path`: path to resolve the pathname for + +`buf`: buffer to return the resolved path name in + +`buf__sz`: length of the supplied buffer + +**Returns** + +A positive integer corresponding to the length of the resolved path name in `buf`, including the `NULL` termination character. On error, a negative integer is returned. + + +**Signature** + + +`#!c int bpf_path_d_path(struct path *path, char *buf, size_t buf__sz)` + + +## Usage + +!!! example "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`](../program-type/BPF_PROG_TYPE_LSM.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_percpu_obj_drop_impl.md b/docs/linux/kfuncs/bpf_percpu_obj_drop_impl.md index 32e8a44..14c7e07 100644 --- a/docs/linux/kfuncs/bpf_percpu_obj_drop_impl.md +++ b/docs/linux/kfuncs/bpf_percpu_obj_drop_impl.md @@ -16,6 +16,8 @@ All fields of the object that require destruction will be destructed before the The `meta` parameter is rewritten by the verifier, no need for BPF program to set it. +**Signature** + `#!c void bpf_percpu_obj_drop_impl(void *p__alloc, void *meta__ign)` diff --git a/docs/linux/kfuncs/bpf_percpu_obj_new_impl.md b/docs/linux/kfuncs/bpf_percpu_obj_new_impl.md index b14a22d..b24e6cb 100644 --- a/docs/linux/kfuncs/bpf_percpu_obj_new_impl.md +++ b/docs/linux/kfuncs/bpf_percpu_obj_new_impl.md @@ -20,6 +20,8 @@ The `local_type_id` parameter must be a known constant. The 'meta' parameter is A pointer to a pre-CPU object of the type corresponding to the passed in `local_type_id`, or NULL on failure. +**Signature** + `#!c void *bpf_percpu_obj_new_impl(u64 local_type_id__k, void *meta__ign)` diff --git a/docs/linux/kfuncs/bpf_preempt_disable.md b/docs/linux/kfuncs/bpf_preempt_disable.md index 7378f3c..b5af07f 100644 --- a/docs/linux/kfuncs/bpf_preempt_disable.md +++ b/docs/linux/kfuncs/bpf_preempt_disable.md @@ -12,6 +12,8 @@ Disable preemption in eBPF programs. ## Definition +**Signature** + `#!c void bpf_preempt_disable()` @@ -27,8 +29,12 @@ Global functions are disallowed from being called in non-preemptible regions. St The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_preempt_enable.md b/docs/linux/kfuncs/bpf_preempt_enable.md index 560050b..22ab83b 100644 --- a/docs/linux/kfuncs/bpf_preempt_enable.md +++ b/docs/linux/kfuncs/bpf_preempt_enable.md @@ -12,6 +12,8 @@ Enable preemption in eBPF programs. ## Definition +**Signature** + `#!c void bpf_preempt_enable()` @@ -25,8 +27,12 @@ This kfunc re-enables preemption in BPF programs. Nesting is allowed. See [`bpf_ The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_put_file.md b/docs/linux/kfuncs/bpf_put_file.md new file mode 100644 index 0000000..38528bc --- /dev/null +++ b/docs/linux/kfuncs/bpf_put_file.md @@ -0,0 +1,50 @@ +--- +title: "KFunc 'bpf_put_file'" +description: "This page documents the 'bpf_put_file' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_put_file` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/d08e2045ebf0f5f2a97ad22cc7dae398b35354ba) + + +This function puts a reference on the supplied file. + +## Definition + +Put a reference on the supplied `file`. Only referenced file pointers may be passed to this BPF kfunc. Attempting to pass an unreferenced file pointer, or any other arbitrary pointer for that matter, will result in the BPF program being rejected by the BPF verifier. + +This BPF kfunc may only be called from BPF LSM programs. + +**Parameters** + +`file`: file to put a reference on + +**Signature** + + +`#!c void bpf_put_file(struct file *file)` + +!!! note + This kfunc releases the pointer passed in to it. There can be only one referenced pointer that can be passed in. + All copies of the pointer being released are invalidated as a result of invoking this kfunc. + + +## Usage + +!!! example "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`](../program-type/BPF_PROG_TYPE_LSM.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_rbtree_add_impl.md b/docs/linux/kfuncs/bpf_rbtree_add_impl.md index e610131..8d50f56 100644 --- a/docs/linux/kfuncs/bpf_rbtree_add_impl.md +++ b/docs/linux/kfuncs/bpf_rbtree_add_impl.md @@ -19,6 +19,8 @@ The `meta` and `off` parameters are rewritten by the verifier, no need for BPF p * `0` if the node was successfully added * `-EINVAL` if the node wasn't added because it's already in a tree +**Signature** + `#!c int bpf_rbtree_add_impl(struct bpf_rb_root *root, struct bpf_rb_node *node, bool (less)(struct bpf_rb_node * , const struct bpf_rb_node * ), void *meta__ign, u64 off)` diff --git a/docs/linux/kfuncs/bpf_rbtree_first.md b/docs/linux/kfuncs/bpf_rbtree_first.md index 0cacd29..67cbfd9 100644 --- a/docs/linux/kfuncs/bpf_rbtree_first.md +++ b/docs/linux/kfuncs/bpf_rbtree_first.md @@ -16,6 +16,8 @@ Return the first (leftmost) node in input tree Pointer to the node, which is _not_ removed from the tree. If the tree contains no nodes, returns `NULL`. +**Signature** + `#!c struct bpf_rb_node *bpf_rbtree_first(struct bpf_rb_root *root)` diff --git a/docs/linux/kfuncs/bpf_rbtree_remove.md b/docs/linux/kfuncs/bpf_rbtree_remove.md index 2ac4ff9..3403889 100644 --- a/docs/linux/kfuncs/bpf_rbtree_remove.md +++ b/docs/linux/kfuncs/bpf_rbtree_remove.md @@ -16,6 +16,8 @@ Remove `node` from red-black-tree with root `root` Pointer to the removed node, or `NULL` if `root` didn't contain `node` +**Signature** + `#!c struct bpf_rb_node *bpf_rbtree_remove(struct bpf_rb_root *root, struct bpf_rb_node *node)` diff --git a/docs/linux/kfuncs/bpf_rcu_read_lock.md b/docs/linux/kfuncs/bpf_rcu_read_lock.md index 66e25de..a51759c 100644 --- a/docs/linux/kfuncs/bpf_rcu_read_lock.md +++ b/docs/linux/kfuncs/bpf_rcu_read_lock.md @@ -16,6 +16,8 @@ The end of such a region is marked by [`bpf_rcu_read_unlock`](bpf_rcu_read_unloc The current implementation does not support nested RCU read lock region in the program. +**Signature** + `#!c void bpf_rcu_read_lock()` @@ -50,8 +52,12 @@ Let us say the program executes `task = bpf_get_current_task_btf()` to get a The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_rcu_read_unlock.md b/docs/linux/kfuncs/bpf_rcu_read_unlock.md index 7620aa5..0c7509e 100644 --- a/docs/linux/kfuncs/bpf_rcu_read_unlock.md +++ b/docs/linux/kfuncs/bpf_rcu_read_unlock.md @@ -12,6 +12,8 @@ description: "This page documents the 'bpf_rcu_read_unlock' eBPF kfunc, includin Release a RCU read lock region in the BPF program. +**Signature** + `#!c void bpf_rcu_read_unlock()` @@ -25,8 +27,12 @@ See [`bpf_rcu_read_lock`](bpf_rcu_read_lock.md) for the usage of this kfunc. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_rdonly_cast.md b/docs/linux/kfuncs/bpf_rdonly_cast.md index e5c48e6..5dfc49b 100644 --- a/docs/linux/kfuncs/bpf_rdonly_cast.md +++ b/docs/linux/kfuncs/bpf_rdonly_cast.md @@ -20,6 +20,8 @@ represents, the returned `btf_id` is marked as `PTR_UNTRUSTED`, so the return value and subsequent pointer chasing cannot be used as helper/kfunc arguments. +**Signature** + `#!c void *bpf_rdonly_cast(const void *obj__ign, u32 btf_id__k)` @@ -42,8 +44,12 @@ be casted to `struct skb_shared_info *`. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_refcount_acquire_impl.md b/docs/linux/kfuncs/bpf_refcount_acquire_impl.md index 087f49d..bd26002 100644 --- a/docs/linux/kfuncs/bpf_refcount_acquire_impl.md +++ b/docs/linux/kfuncs/bpf_refcount_acquire_impl.md @@ -18,6 +18,8 @@ The `meta` parameter is rewritten by the verifier, no need for BPF program to se An owning reference to the object pointed to by `kptr` +**Signature** + `#!c void *bpf_refcount_acquire_impl(void *p__refcounted_kptr, void *meta__ign)` diff --git a/docs/linux/kfuncs/bpf_send_signal_task.md b/docs/linux/kfuncs/bpf_send_signal_task.md new file mode 100644 index 0000000..715eaf6 --- /dev/null +++ b/docs/linux/kfuncs/bpf_send_signal_task.md @@ -0,0 +1,108 @@ +--- +title: "KFunc 'bpf_send_signal_task'" +description: "This page documents the 'bpf_send_signal_task' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_send_signal_task` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/6280cf718db0c557b5fe44e2d2e8ad8e832696a7) + + +This function allows for the sending of signals to threads and processes. + +## Definition + +`bpf_send_signal_task` is a kfunc that is similar to the [`bpf_send_signal_thread`](../helper-function/bpf_send_signal_thread.md) and [`bpf_send_signal`](../helper-function/bpf_send_signal.md) helpers, but can be used to send signals to other threads and processes. It also supports sending a cookie with the signal similar to [`sigqueue()`](https://man7.org/linux/man-pages/man3/sigqueue.3.html). + +If the receiving process establishes a handler for the signal using the `SA_SIGINFO` flag to [`sigaction()`](https://man7.org/linux/man-pages/man2/sigaction.2.html), then it can obtain this cookie via the `si_value` field of the `siginfo_t` structure passed as the second argument to the handler. + +**Parameters** + +`task`: Pointer to the task_struct of the thread or process to send the signal to. + +`sig`: Signal number to send. + +`type`: Specifies to send the signal to a specific process or a thread. Possible values: `PIDTYPE_PID`(0) and `PIDTYPE_TGID`(1) + +`value`: Cookie to send with the signal. + +**Returns** + +`0` on success, a negative error code on failure + +**Signature** + + +`#!c int bpf_send_signal_task(struct task_struct *task, int sig, pid_type type, u64 value)` + + +## Usage + +!!! example "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`](../program-type/BPF_PROG_TYPE_LSM.md) +- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md) +- [`BPF_PROG_TYPE_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) +- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md) + + +### Example + +```c +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2019 Facebook +#include +#include +#include + +struct task_struct *bpf_task_from_pid(int pid) __ksym; +void bpf_task_release(struct task_struct *p) __ksym; +int bpf_send_signal_task(struct task_struct *task, int sig, enum pid_type type, u64 value) __ksym; + +__u32 sig = 0, pid = 0, status = 0, signal_thread = 0, target_pid = 0; + +static __always_inline int bpf_send_signal_test(void *ctx) +{ + struct task_struct *target_task = NULL; + int ret; + u64 value; + + if (status != 0 || pid == 0) + return 0; + + if ((bpf_get_current_pid_tgid() >> 32) == pid) { + if (target_pid) { + target_task = bpf_task_from_pid(target_pid); + if (!target_task) + return 0; + value = 8; + } + + if (signal_thread) { + if (target_pid) + ret = bpf_send_signal_task(target_task, sig, PIDTYPE_PID, value); + else + ret = bpf_send_signal_thread(sig); + } else { + if (target_pid) + ret = bpf_send_signal_task(target_task, sig, PIDTYPE_TGID, value); + else + ret = bpf_send_signal(sig); + } + if (ret == 0) + status = 1; + } + + if (target_task) + bpf_task_release(target_task); + + return 0; +} +``` diff --git a/docs/linux/kfuncs/bpf_session_cookie.md b/docs/linux/kfuncs/bpf_session_cookie.md index 53b4d75..2348365 100644 --- a/docs/linux/kfuncs/bpf_session_cookie.md +++ b/docs/linux/kfuncs/bpf_session_cookie.md @@ -16,6 +16,8 @@ Get a pointer to a 64-bit session cookie. Returns pointer to the cookie value. The bpf program can use the pointer to store (on entry) and load (on return) the value. +**Signature** + `#!c __u64 *bpf_session_cookie()` diff --git a/docs/linux/kfuncs/bpf_session_is_return.md b/docs/linux/kfuncs/bpf_session_is_return.md index 4de4dde..b325037 100644 --- a/docs/linux/kfuncs/bpf_session_is_return.md +++ b/docs/linux/kfuncs/bpf_session_is_return.md @@ -16,6 +16,8 @@ Check if the bpf program is executed from the exit probe of the kprobe multi lin Returns `true` if the bpf program is executed from the exit probe of the kprobe multi link attached in wrapper mode. It returns `false` otherwise. +**Signature** + `#!c bool bpf_session_is_return()` diff --git a/docs/linux/kfuncs/bpf_sk_assign_tcp_reqsk.md b/docs/linux/kfuncs/bpf_sk_assign_tcp_reqsk.md index 23fc28a..9842b9b 100644 --- a/docs/linux/kfuncs/bpf_sk_assign_tcp_reqsk.md +++ b/docs/linux/kfuncs/bpf_sk_assign_tcp_reqsk.md @@ -14,6 +14,8 @@ Assign custom parameters used to validate SYN cookies. `bpf_sk_assign_tcp_reqsk()` takes `skb`, a listener `sk`, and `struct bpf_tcp_req_attrs` and allocates `reqsk` and configures it. Then, bpf_sk_assign_tcp_reqsk() links `reqsk` with `skb` and the listener. +**Signature** + `#!c int bpf_sk_assign_tcp_reqsk(struct __sk_buff *s, struct sock *sk, struct bpf_tcp_req_attrs *attrs, int attrs__sz)` diff --git a/docs/linux/kfuncs/bpf_skb_ct_alloc.md b/docs/linux/kfuncs/bpf_skb_ct_alloc.md index 38fc480..ac78a0e 100644 --- a/docs/linux/kfuncs/bpf_skb_ct_alloc.md +++ b/docs/linux/kfuncs/bpf_skb_ct_alloc.md @@ -46,6 +46,8 @@ Allocate a new CT entry `opts__sz`: Length of the bpf_ct_opts structure. Must be `NF_BPF_CT_OPTS_SZ` (12) +**Signature** + `#!c struct nf_conn___init *bpf_skb_ct_alloc(struct __sk_buff *skb_ctx, struct bpf_sock_tuple *bpf_tuple, u32 tuple__sz, struct bpf_ct_opts *opts, u32 opts__sz)` diff --git a/docs/linux/kfuncs/bpf_skb_ct_lookup.md b/docs/linux/kfuncs/bpf_skb_ct_lookup.md index aab717c..19c864b 100644 --- a/docs/linux/kfuncs/bpf_skb_ct_lookup.md +++ b/docs/linux/kfuncs/bpf_skb_ct_lookup.md @@ -44,6 +44,8 @@ Lookup CT entry for the given tuple, and acquire a reference to it. `opts__sz`: Length of the bpf_ct_opts structure. Must be `NF_BPF_CT_OPTS_SZ` (12) +**Signature** + `#!c struct nf_conn *bpf_skb_ct_lookup(struct __sk_buff *skb_ctx, struct bpf_sock_tuple *bpf_tuple, u32 tuple__sz, struct bpf_ct_opts *opts, u32 opts__sz)` diff --git a/docs/linux/kfuncs/bpf_skb_get_fou_encap.md b/docs/linux/kfuncs/bpf_skb_get_fou_encap.md index 372fbee..b22156f 100644 --- a/docs/linux/kfuncs/bpf_skb_get_fou_encap.md +++ b/docs/linux/kfuncs/bpf_skb_get_fou_encap.md @@ -25,6 +25,8 @@ This function allows for reading encapsulation metadata from a packet received o `0` on success, a negative error code on failure +**Signature** + `#!c int bpf_skb_get_fou_encap(struct __sk_buff *skb_ctx, struct bpf_fou_encap *encap)` diff --git a/docs/linux/kfuncs/bpf_skb_get_xfrm_info.md b/docs/linux/kfuncs/bpf_skb_get_xfrm_info.md index 7f06318..ea54770 100644 --- a/docs/linux/kfuncs/bpf_skb_get_xfrm_info.md +++ b/docs/linux/kfuncs/bpf_skb_get_xfrm_info.md @@ -30,6 +30,8 @@ Get XFRM metadata - Transmit: used as the underlying device in VRF routing - Receive: the device on which the packet had been received +**Signature** + `#!c int bpf_skb_get_xfrm_info(struct __sk_buff *skb_ctx, struct bpf_xfrm_info *to)` diff --git a/docs/linux/kfuncs/bpf_skb_set_fou_encap.md b/docs/linux/kfuncs/bpf_skb_set_fou_encap.md index 28f5bb5..5311940 100644 --- a/docs/linux/kfuncs/bpf_skb_set_fou_encap.md +++ b/docs/linux/kfuncs/bpf_skb_set_fou_encap.md @@ -31,6 +31,8 @@ It is meant to be used in BPF traffic control hooks and after a call to the [`bp `0` on success, a negative error code on failure +**Signature** + `#!c int bpf_skb_set_fou_encap(struct __sk_buff *skb_ctx, struct bpf_fou_encap *encap, int type)` diff --git a/docs/linux/kfuncs/bpf_skb_set_xfrm_info.md b/docs/linux/kfuncs/bpf_skb_set_xfrm_info.md index 8661a35..4b692ea 100644 --- a/docs/linux/kfuncs/bpf_skb_set_xfrm_info.md +++ b/docs/linux/kfuncs/bpf_skb_set_xfrm_info.md @@ -30,6 +30,8 @@ Set XFRM metadata - Transmit: used as the underlying device in VRF routing - Receive: the device on which the packet had been received +**Signature** + `#!c int bpf_skb_set_xfrm_info(struct __sk_buff *skb_ctx, const struct bpf_xfrm_info *from)` diff --git a/docs/linux/kfuncs/bpf_sock_addr_set_sun_path.md b/docs/linux/kfuncs/bpf_sock_addr_set_sun_path.md index 72b8283..a6ab68e 100644 --- a/docs/linux/kfuncs/bpf_sock_addr_set_sun_path.md +++ b/docs/linux/kfuncs/bpf_sock_addr_set_sun_path.md @@ -12,6 +12,8 @@ Modify the socket address of a socket. ## Definition +**Signature** + `#!c int bpf_sock_addr_set_sun_path(struct bpf_sock_addr_kern *sa_kern, const u8 *sun_path, u32 sun_path__sz)` @@ -26,8 +28,12 @@ Modify the socket address of a socket. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - ### Example diff --git a/docs/linux/kfuncs/bpf_sock_destroy.md b/docs/linux/kfuncs/bpf_sock_destroy.md index e276f6b..54bb4e6 100644 --- a/docs/linux/kfuncs/bpf_sock_destroy.md +++ b/docs/linux/kfuncs/bpf_sock_destroy.md @@ -19,9 +19,11 @@ The helper can only be called from BPF contexts that have acquired the socket lo **Parameters** `sock`: Pointer to socket to be destroyed -**Return** +**Returns** On error, may return `EPROTONOSUPPORT`, `EINVAL`. `EPROTONOSUPPORT` if protocol specific destroy handler is not supported. `0` otherwise +**Signature** + `#!c int bpf_sock_destroy(struct sock_common *sock)` diff --git a/docs/linux/kfuncs/bpf_task_acquire.md b/docs/linux/kfuncs/bpf_task_acquire.md index de0eca3..b187fa4 100644 --- a/docs/linux/kfuncs/bpf_task_acquire.md +++ b/docs/linux/kfuncs/bpf_task_acquire.md @@ -16,6 +16,8 @@ A task acquired by this kfunc which is not stored in a map as a kptr, must be re `p`: The task on which a reference is being acquired. +**Signature** + `#!c struct task_struct *bpf_task_acquire(struct task_struct *p)` diff --git a/docs/linux/kfuncs/bpf_task_from_pid.md b/docs/linux/kfuncs/bpf_task_from_pid.md index 4da1812..832e7f7 100644 --- a/docs/linux/kfuncs/bpf_task_from_pid.md +++ b/docs/linux/kfuncs/bpf_task_from_pid.md @@ -14,6 +14,8 @@ Find a `struct task_struct` from its pid by looking it up in the root pid namesp If a task is returned, it must either be stored in a map, or released with [`bpf_task_release()`](bpf_task_release.md). +**Signature** + `#!c struct task_struct *bpf_task_from_pid(s32 pid)` diff --git a/docs/linux/kfuncs/bpf_task_from_vpid.md b/docs/linux/kfuncs/bpf_task_from_vpid.md new file mode 100644 index 0000000..bdbb266 --- /dev/null +++ b/docs/linux/kfuncs/bpf_task_from_vpid.md @@ -0,0 +1,62 @@ +--- +title: "KFunc 'bpf_task_from_vpid'" +description: "This page documents the 'bpf_task_from_vpid' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `bpf_task_from_vpid` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/675c3596ff32c040d1dd2e28dd57e83e634b9f60) + + +Find a struct task_struct from its `vpid`. + +## Definition + +Find a struct `task_struct` from its `vpid` by looking it up in the `pid` namespace of the current task. + +**Parameters** + +`vpid`: The `vpid` of the task being looked up. + +**Returns** + +A pointer to a task struct or `NULL`. If a task is returned, it must either be stored in a map, or released with [`bpf_task_release`](bpf_task_release.md). + +**Signature** + + +`#!c struct task_struct *bpf_task_from_vpid(s32 vpid)` + +!!! 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`](../helper-function/bpf_kptr_xchg.md)). 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 + +!!! example "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`](../program-type/BPF_PROG_TYPE_LSM.md) +- [`BPF_PROG_TYPE_SCHED_CLS`](../program-type/BPF_PROG_TYPE_SCHED_CLS.md) +- [`BPF_PROG_TYPE_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) +- [`BPF_PROG_TYPE_XDP`](../program-type/BPF_PROG_TYPE_XDP.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/bpf_task_get_cgroup1.md b/docs/linux/kfuncs/bpf_task_get_cgroup1.md index 6ff5b84..7167948 100644 --- a/docs/linux/kfuncs/bpf_task_get_cgroup1.md +++ b/docs/linux/kfuncs/bpf_task_get_cgroup1.md @@ -18,6 +18,8 @@ The cGroup1 hierarchy is identified by its hierarchy ID. On success, the cGroup is returned. On failure, NULL is returned. +**Signature** + `#!c struct cgroup *bpf_task_get_cgroup1(struct task_struct *task, int hierarchy_id)` diff --git a/docs/linux/kfuncs/bpf_task_release.md b/docs/linux/kfuncs/bpf_task_release.md index e403809..6a21830 100644 --- a/docs/linux/kfuncs/bpf_task_release.md +++ b/docs/linux/kfuncs/bpf_task_release.md @@ -14,6 +14,8 @@ Release the reference acquired on a task. `p`: The task on which a reference is being released. +**Signature** + `#!c void bpf_task_release(struct task_struct *p)` diff --git a/docs/linux/kfuncs/bpf_task_under_cgroup.md b/docs/linux/kfuncs/bpf_task_under_cgroup.md index d8382ef..c77b5a1 100644 --- a/docs/linux/kfuncs/bpf_task_under_cgroup.md +++ b/docs/linux/kfuncs/bpf_task_under_cgroup.md @@ -14,6 +14,8 @@ Wrap `task_under_cgroup_hierarchy()` as a kfunc, test task's membership of cGrou Tests whether `task`'s default cgroup hierarchy is a descendant of `ancestor`. It follows all the same rules as cgroup_is_descendant, and only applies to the default hierarchy. +**Signature** + `#!c long int bpf_task_under_cgroup(struct task_struct *task, struct cgroup *ancestor)` diff --git a/docs/linux/kfuncs/bpf_throw.md b/docs/linux/kfuncs/bpf_throw.md index 90f3557..983b661 100644 --- a/docs/linux/kfuncs/bpf_throw.md +++ b/docs/linux/kfuncs/bpf_throw.md @@ -22,7 +22,7 @@ Thus, in case of default exception callback, `cookie` is subjected to constraint !!! note callbacks **cannot** call this helper. -**Return** +**Returns** Never. @@ -30,6 +30,8 @@ Never. An exception with the specified `cookie` value. +**Signature** + `#!c void bpf_throw(u64 cookie)` diff --git a/docs/linux/kfuncs/bpf_verify_pkcs7_signature.md b/docs/linux/kfuncs/bpf_verify_pkcs7_signature.md index 0af8ba8..a7c1963 100644 --- a/docs/linux/kfuncs/bpf_verify_pkcs7_signature.md +++ b/docs/linux/kfuncs/bpf_verify_pkcs7_signature.md @@ -14,6 +14,8 @@ Verify a PKCS#7 signature Verify the PKCS#7 signature `sig_ptr` against the supplied `data_ptr` with keys in a keyring referenced by `trusted_keyring`. +**Signature** + `#!c int bpf_verify_pkcs7_signature(struct bpf_dynptr *data_p, struct bpf_dynptr *sig_p, struct bpf_key *trusted_keyring)` diff --git a/docs/linux/kfuncs/bpf_wq_init.md b/docs/linux/kfuncs/bpf_wq_init.md index b7ba1e6..7f8cb01 100644 --- a/docs/linux/kfuncs/bpf_wq_init.md +++ b/docs/linux/kfuncs/bpf_wq_init.md @@ -22,7 +22,9 @@ This kfunc initializes a work-queue which allows eBPF programs to schedule work **Returns** -Return `0` on success, or a negative error code on failure. +Return 0 on success, or a negative error code on failure. + +**Signature** `#!c int bpf_wq_init(struct bpf_wq *wq, void *p__map, unsigned int flags)` @@ -39,8 +41,12 @@ The callback will be called asynchronously sometime after the current eBPF progr The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_wq_set_callback_impl.md b/docs/linux/kfuncs/bpf_wq_set_callback_impl.md index 39a3e15..ec5f679 100644 --- a/docs/linux/kfuncs/bpf_wq_set_callback_impl.md +++ b/docs/linux/kfuncs/bpf_wq_set_callback_impl.md @@ -22,7 +22,9 @@ The callback will be called asynchronously sometime after the current eBPF progr **Returns** -Return `0` on success, or a negative error code on failure. +Return 0 on success, or a negative error code on failure. + +**Signature** `#!c int bpf_wq_set_callback_impl(struct bpf_wq *wq, int (callback_fn)(void * , int * , void * ), unsigned int flags, void *aux__ign)` @@ -38,8 +40,12 @@ Return `0` on success, or a negative error code on failure. The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_wq_start.md b/docs/linux/kfuncs/bpf_wq_start.md index cebbf32..67576c6 100644 --- a/docs/linux/kfuncs/bpf_wq_start.md +++ b/docs/linux/kfuncs/bpf_wq_start.md @@ -20,7 +20,9 @@ This kfunc starts a work-queue which allows eBPF programs to schedule work to be **Returns** -Return `0` on success, or a negative error code on failure. +Return 0 on success, or a negative error code on failure. + +**Signature** `#!c int bpf_wq_start(struct bpf_wq *wq, unsigned int flags)` @@ -37,8 +39,12 @@ The callback will be called asynchronously sometime after the current eBPF progr The following program types can make use of this kfunc: +- [`BPF_PROG_TYPE_CGROUP_DEVICE`](../program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_CGROUP_SKB`](../program-type/BPF_PROG_TYPE_CGROUP_SKB.md) -- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) +- [`BPF_PROG_TYPE_CGROUP_SOCK`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCKOPT`](../program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - +- [`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`](../program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - +- [`BPF_PROG_TYPE_CGROUP_SYSCTL`](../program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - - [`BPF_PROG_TYPE_LSM`](../program-type/BPF_PROG_TYPE_LSM.md) - [`BPF_PROG_TYPE_LWT_IN`](../program-type/BPF_PROG_TYPE_LWT_IN.md) - [`BPF_PROG_TYPE_LWT_OUT`](../program-type/BPF_PROG_TYPE_LWT_OUT.md) diff --git a/docs/linux/kfuncs/bpf_xdp_ct_alloc.md b/docs/linux/kfuncs/bpf_xdp_ct_alloc.md index e9de79d..138a158 100644 --- a/docs/linux/kfuncs/bpf_xdp_ct_alloc.md +++ b/docs/linux/kfuncs/bpf_xdp_ct_alloc.md @@ -46,6 +46,8 @@ Allocate a new CT (connection tracking) entry `opts__sz`: Length of the bpf_ct_opts structure. Must be `NF_BPF_CT_OPTS_SZ` (12) +**Signature** + `#!c struct nf_conn___init *bpf_xdp_ct_alloc(struct xdp_md *xdp_ctx, struct bpf_sock_tuple *bpf_tuple, u32 tuple__sz, struct bpf_ct_opts *opts, u32 opts__sz)` diff --git a/docs/linux/kfuncs/bpf_xdp_ct_lookup.md b/docs/linux/kfuncs/bpf_xdp_ct_lookup.md index 744cf8e..9ac94ad 100644 --- a/docs/linux/kfuncs/bpf_xdp_ct_lookup.md +++ b/docs/linux/kfuncs/bpf_xdp_ct_lookup.md @@ -47,6 +47,8 @@ Lookup CT entry for the given tuple, and acquire a reference to it `opts__sz`: Length of the bpf_ct_opts structure. Must be `NF_BPF_CT_OPTS_SZ` (12) +**Signature** + `#!c struct nf_conn *bpf_xdp_ct_lookup(struct xdp_md *xdp_ctx, struct bpf_sock_tuple *bpf_tuple, u32 tuple__sz, struct bpf_ct_opts *opts, u32 opts__sz)` diff --git a/docs/linux/kfuncs/bpf_xdp_flow_lookup.md b/docs/linux/kfuncs/bpf_xdp_flow_lookup.md index df5add6..a30a9c8 100644 --- a/docs/linux/kfuncs/bpf_xdp_flow_lookup.md +++ b/docs/linux/kfuncs/bpf_xdp_flow_lookup.md @@ -12,6 +12,8 @@ Perform the lookup of a given flow-table entry based on a fib tuple of incoming ## Definition +**Signature** + `#!c struct flow_offload_tuple_rhash *bpf_xdp_flow_lookup(struct xdp_md *ctx, struct bpf_fib_lookup *fib_tuple, struct bpf_flowtable_opts *opts, u32 opts_len)` diff --git a/docs/linux/kfuncs/bpf_xdp_get_xfrm_state.md b/docs/linux/kfuncs/bpf_xdp_get_xfrm_state.md index 6105ef0..b22e6bd 100644 --- a/docs/linux/kfuncs/bpf_xdp_get_xfrm_state.md +++ b/docs/linux/kfuncs/bpf_xdp_get_xfrm_state.md @@ -46,6 +46,8 @@ A `struct xfrm_state *`, if found, must be released with a corresponding bpf_xdp `opts__sz` - Length of the bpf_xfrm_state_opts structure. Must be `BPF_XFRM_STATE_OPTS_SZ` +**Signature** + `#!c struct xfrm_state *bpf_xdp_get_xfrm_state(struct xdp_md *ctx, struct bpf_xfrm_state_opts *opts, u32 opts__sz)` diff --git a/docs/linux/kfuncs/bpf_xdp_metadata_rx_hash.md b/docs/linux/kfuncs/bpf_xdp_metadata_rx_hash.md index a7b5517..b826538 100644 --- a/docs/linux/kfuncs/bpf_xdp_metadata_rx_hash.md +++ b/docs/linux/kfuncs/bpf_xdp_metadata_rx_hash.md @@ -14,6 +14,8 @@ Read XDP frame RX hash. If `bpf_xdp_metadata_rx_hash` is not supported by the target device, the default implementation is called instead. The verifier, at load time, replaces a call to the generic kfunc with a call to the per-device one. +**Signature** + `#!c int bpf_xdp_metadata_rx_hash(const struct xdp_md *ctx, u32 *hash, xdp_rss_hash_type *rss_type)` diff --git a/docs/linux/kfuncs/bpf_xdp_metadata_rx_timestamp.md b/docs/linux/kfuncs/bpf_xdp_metadata_rx_timestamp.md index f80d5e2..9f67a52 100644 --- a/docs/linux/kfuncs/bpf_xdp_metadata_rx_timestamp.md +++ b/docs/linux/kfuncs/bpf_xdp_metadata_rx_timestamp.md @@ -14,6 +14,8 @@ Read XDP frame RX timestamp. If `bpf_xdp_metadata_rx_timestamp` is not supported by the target device, the default implementation is called instead. The verifier, at load time, replaces a call to the generic kfunc with a call to the per-device one. +**Signature** + `#!c int bpf_xdp_metadata_rx_timestamp(const struct xdp_md *ctx, u64 *timestamp)` diff --git a/docs/linux/kfuncs/bpf_xdp_metadata_rx_vlan_tag.md b/docs/linux/kfuncs/bpf_xdp_metadata_rx_vlan_tag.md index e6c27eb..a4edafe 100644 --- a/docs/linux/kfuncs/bpf_xdp_metadata_rx_vlan_tag.md +++ b/docs/linux/kfuncs/bpf_xdp_metadata_rx_vlan_tag.md @@ -32,11 +32,13 @@ For detailed meaning of DEI and PCP, please refer to other sources. `vlan_proto`: Destination pointer for VLAN Tag protocol identifier (TPID). `vlan_tci`: Destination pointer for VLAN TCI (VID + DEI + PCP) -**Return** +**Returns** * Returns 0 on success or ``-errno`` on error. * ``-EOPNOTSUPP`` : device driver doesn't implement kfunc * ``-ENODATA`` : VLAN tag was not stripped or is not available +**Signature** + `#!c int bpf_xdp_metadata_rx_vlan_tag(const struct xdp_md *ctx, __be16 *vlan_proto, u16 *vlan_tci)` diff --git a/docs/linux/kfuncs/bpf_xdp_xfrm_state_release.md b/docs/linux/kfuncs/bpf_xdp_xfrm_state_release.md index e25c987..7fb2e44 100644 --- a/docs/linux/kfuncs/bpf_xdp_xfrm_state_release.md +++ b/docs/linux/kfuncs/bpf_xdp_xfrm_state_release.md @@ -18,6 +18,8 @@ This must be invoked for referenced `PTR_TO_BTF_ID`, and the verifier rejects th `x`: Pointer to referenced `xfrm_state` object, obtained using `bpf_xdp_get_xfrm_state` +**Signature** + `#!c void bpf_xdp_xfrm_state_release(struct xfrm_state *x)` diff --git a/docs/linux/kfuncs/cgroup_rstat_flush.md b/docs/linux/kfuncs/cgroup_rstat_flush.md index 80f9868..a1588f1 100644 --- a/docs/linux/kfuncs/cgroup_rstat_flush.md +++ b/docs/linux/kfuncs/cgroup_rstat_flush.md @@ -22,6 +22,8 @@ This function may block. `cgrp`: target cgroup +**Signature** + `#!c void cgroup_rstat_flush(struct cgroup *cgrp)` diff --git a/docs/linux/kfuncs/cgroup_rstat_updated.md b/docs/linux/kfuncs/cgroup_rstat_updated.md index 8646e5a..c18a5fd 100644 --- a/docs/linux/kfuncs/cgroup_rstat_updated.md +++ b/docs/linux/kfuncs/cgroup_rstat_updated.md @@ -21,6 +21,8 @@ Keep track of updated `rstat_cpu` `cpu`: cpu on which rstat_cpu was updated +**Signature** + `#!c void cgroup_rstat_updated(struct cgroup *cgrp, int cpu)` diff --git a/docs/linux/kfuncs/crash_kexec.md b/docs/linux/kfuncs/crash_kexec.md index 9cc940c..55a0a21 100644 --- a/docs/linux/kfuncs/crash_kexec.md +++ b/docs/linux/kfuncs/crash_kexec.md @@ -12,6 +12,8 @@ Crash the kernel at a specific point in the code. ## Definition +**Signature** + `#!c void crash_kexec(struct pt_regs *regs)` diff --git a/docs/linux/kfuncs/cubictcp_acked.md b/docs/linux/kfuncs/cubictcp_acked.md index fe2380c..a26d253 100644 --- a/docs/linux/kfuncs/cubictcp_acked.md +++ b/docs/linux/kfuncs/cubictcp_acked.md @@ -12,6 +12,8 @@ Hook for packet ack accounting ## Definition +**Signature** + `#!c void cubictcp_acked(struct sock *sk, const struct ack_sample *sample)` diff --git a/docs/linux/kfuncs/cubictcp_cong_avoid.md b/docs/linux/kfuncs/cubictcp_cong_avoid.md index 2e277c7..5a65c77 100644 --- a/docs/linux/kfuncs/cubictcp_cong_avoid.md +++ b/docs/linux/kfuncs/cubictcp_cong_avoid.md @@ -12,6 +12,8 @@ Do new `cwnd` calculation ## Definition +**Signature** + `#!c void cubictcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)` diff --git a/docs/linux/kfuncs/cubictcp_cwnd_event.md b/docs/linux/kfuncs/cubictcp_cwnd_event.md index 24b3f5d..c0cdc12 100644 --- a/docs/linux/kfuncs/cubictcp_cwnd_event.md +++ b/docs/linux/kfuncs/cubictcp_cwnd_event.md @@ -12,6 +12,8 @@ Call when congestion window event occurs. ## Definition +**Signature** + `#!c void cubictcp_cwnd_event(struct sock *sk, tcp_ca_event event)` diff --git a/docs/linux/kfuncs/cubictcp_init.md b/docs/linux/kfuncs/cubictcp_init.md index 2f81e91..651988a 100644 --- a/docs/linux/kfuncs/cubictcp_init.md +++ b/docs/linux/kfuncs/cubictcp_init.md @@ -12,6 +12,8 @@ Initialise TCP Cubic congestion control algorithm on a socket. ## Definition +**Signature** + `#!c void cubictcp_init(struct sock *sk)` diff --git a/docs/linux/kfuncs/cubictcp_recalc_ssthresh.md b/docs/linux/kfuncs/cubictcp_recalc_ssthresh.md index 1d76db7..5cbfa60 100644 --- a/docs/linux/kfuncs/cubictcp_recalc_ssthresh.md +++ b/docs/linux/kfuncs/cubictcp_recalc_ssthresh.md @@ -12,6 +12,8 @@ Returns slow start threshold ## Definition +**Signature** + `#!c u32 cubictcp_recalc_ssthresh(struct sock *sk)` diff --git a/docs/linux/kfuncs/cubictcp_state.md b/docs/linux/kfuncs/cubictcp_state.md index 720dce6..4422c5f 100644 --- a/docs/linux/kfuncs/cubictcp_state.md +++ b/docs/linux/kfuncs/cubictcp_state.md @@ -12,6 +12,8 @@ Call before changing ca_state ## Definition +**Signature** + `#!c void cubictcp_state(struct sock *sk, u8 new_state)` diff --git a/docs/linux/kfuncs/dctcp_cwnd_event.md b/docs/linux/kfuncs/dctcp_cwnd_event.md index 64e1c6f..d32b9e8 100644 --- a/docs/linux/kfuncs/dctcp_cwnd_event.md +++ b/docs/linux/kfuncs/dctcp_cwnd_event.md @@ -12,6 +12,8 @@ Call when congestion window event occurs. ## Definition +**Signature** + `#!c void dctcp_cwnd_event(struct sock *sk, tcp_ca_event ev)` diff --git a/docs/linux/kfuncs/dctcp_cwnd_undo.md b/docs/linux/kfuncs/dctcp_cwnd_undo.md index 8dcbda5..2a8500b 100644 --- a/docs/linux/kfuncs/dctcp_cwnd_undo.md +++ b/docs/linux/kfuncs/dctcp_cwnd_undo.md @@ -12,6 +12,8 @@ Return new value of congestion window after loss. ## Definition +**Signature** + `#!c u32 dctcp_cwnd_undo(struct sock *sk)` diff --git a/docs/linux/kfuncs/dctcp_init.md b/docs/linux/kfuncs/dctcp_init.md index b8e7ac9..e768fb6 100644 --- a/docs/linux/kfuncs/dctcp_init.md +++ b/docs/linux/kfuncs/dctcp_init.md @@ -12,6 +12,8 @@ Initialise DC TCP congestion control algorithm on a socket. ## Definition +**Signature** + `#!c void dctcp_init(struct sock *sk)` diff --git a/docs/linux/kfuncs/dctcp_ssthresh.md b/docs/linux/kfuncs/dctcp_ssthresh.md index e915b9d..d4b852d 100644 --- a/docs/linux/kfuncs/dctcp_ssthresh.md +++ b/docs/linux/kfuncs/dctcp_ssthresh.md @@ -12,6 +12,8 @@ Returns slow start threshold ## Definition +**Signature** + `#!c u32 dctcp_ssthresh(struct sock *sk)` diff --git a/docs/linux/kfuncs/dctcp_state.md b/docs/linux/kfuncs/dctcp_state.md index feb230b..2db33be 100644 --- a/docs/linux/kfuncs/dctcp_state.md +++ b/docs/linux/kfuncs/dctcp_state.md @@ -12,6 +12,8 @@ Call before changing ca_state ## Definition +**Signature** + `#!c void dctcp_state(struct sock *sk, u8 new_state)` diff --git a/docs/linux/kfuncs/dctcp_update_alpha.md b/docs/linux/kfuncs/dctcp_update_alpha.md index 1615d0a..6a34479 100644 --- a/docs/linux/kfuncs/dctcp_update_alpha.md +++ b/docs/linux/kfuncs/dctcp_update_alpha.md @@ -12,6 +12,8 @@ Call when ack arrives ## Definition +**Signature** + `#!c void dctcp_update_alpha(struct sock *sk, u32 flags)` diff --git a/docs/linux/kfuncs/hid_bpf_attach_prog.md b/docs/linux/kfuncs/hid_bpf_attach_prog.md index 6565d67..da6eb9a 100644 --- a/docs/linux/kfuncs/hid_bpf_attach_prog.md +++ b/docs/linux/kfuncs/hid_bpf_attach_prog.md @@ -25,6 +25,8 @@ Attach the given `prog_fd` to the given HID device A file descriptor of a `bpf_link` object on success (> %0), an error code otherwise. Closing this file descriptor will detach the program from the HID device (unless the `bpf_link` is pinned to the BPF file system). +**Signature** + `#!c int hid_bpf_attach_prog(unsigned int hid_id, int prog_fd, __u32 flags)` @@ -38,7 +40,7 @@ This kfunc is used to attach a BPF program to the jump-table in the BPF-HID subs The following program types can make use of this kfunc: -- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) [:octicons-tag-24: v6.3](https://github.com/torvalds/linux/commit/f5c27da4e3c8a2e42fb4f41a0c685debcb9af294) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/4a86220e046da009bef0948e9f51d1d26d68f93c) ### Example diff --git a/docs/linux/kfuncs/index.md b/docs/linux/kfuncs/index.md index 1080ef8..a4d8a3e 100644 --- a/docs/linux/kfuncs/index.md +++ b/docs/linux/kfuncs/index.md @@ -33,6 +33,10 @@ These KFuncs are used to verify PKCS#7 signed data against ke ## File related kfuncs - [`bpf_get_file_xattr`](bpf_get_file_xattr.md) +- [`bpf_get_task_exe_file`](bpf_get_task_exe_file.md) +- [`bpf_put_file`](bpf_put_file.md) +- [`bpf_path_d_path`](bpf_path_d_path.md) +- [`bpf_get_dentry_xattr`](bpf_get_dentry_xattr.md) ## CPU mask KFuncs @@ -94,6 +98,7 @@ Kfuncs used to acquire and release task reference. - [`bpf_task_acquire`](bpf_task_acquire.md) - [`bpf_task_release`](bpf_task_release.md) +- [`bpf_send_signal_task`](bpf_send_signal_task.md) ## BPF cGroup KFuncs @@ -117,6 +122,11 @@ These kfuncs allow you to take a reference to a cGroup and store them as kptrs i - [`bpf_task_under_cgroup`](bpf_task_under_cgroup.md) - [`bpf_task_get_cgroup1`](bpf_task_get_cgroup1.md) - [`bpf_task_from_pid`](bpf_task_from_pid.md) +- [`bpf_task_from_vpid`](bpf_task_from_vpid.md) + +## KFuncs for memory allocator inspection + +- [`bpf_get_kmem_cache`](bpf_get_kmem_cache.md) ## Kfuncs for casting pointers @@ -169,6 +179,18 @@ These kfuncs allow you to take a reference to a cGroup and store them as kptrs i - [`bpf_iter_bits_next`](bpf_iter_bits_next.md) - [`bpf_iter_bits_destroy`](bpf_iter_bits_destroy.md) +## Kfuncs for slab memory allocation iterators + +- [`bpf_iter_kmem_cache_new`](bpf_iter_kmem_cache_new.md) +- [`bpf_iter_kmem_cache_next`](bpf_iter_kmem_cache_next.md) +- [`bpf_iter_kmem_cache_destroy`](bpf_iter_kmem_cache_destroy.md) + +## Kfuncs for sched_ext dispatch queue iterators + +- [`bpf_iter_scx_dsq_new`](bpf_iter_scx_dsq_new.md) +- [`bpf_iter_scx_dsq_next`](bpf_iter_scx_dsq_next.md) +- [`bpf_iter_scx_dsq_destroy`](bpf_iter_scx_dsq_destroy.md) + ## Kfuncs for dynamic pointers - [`bpf_dynptr_adjust`](bpf_dynptr_adjust.md) @@ -301,5 +323,75 @@ These kfuncs allow you to take a reference to a cGroup and store them as kptrs i - [`hid_bpf_try_input_report`](hid_bpf_try_input_report.md) ## KProbe session Kfuncs + - [`bpf_session_cookie`](bpf_session_cookie.md) - [`bpf_session_is_return`](bpf_session_is_return.md) + +## Memory probe Kfuncs + +- [`bpf_copy_from_user_str`](bpf_copy_from_user_str.md) + +## IRQ Kfuncs + +- [`bpf_local_irq_save`](bpf_local_irq_save.md) +- [`bpf_local_irq_restore`](bpf_local_irq_restore.md) + +## sched_ext Kfuncs + +- [`scx_bpf_kick_cpu`](scx_bpf_kick_cpu.md) +- [`scx_bpf_select_cpu_dfl`](scx_bpf_select_cpu_dfl.md) +- [`scx_bpf_cpu_rq`](scx_bpf_cpu_rq.md) +- [`scx_bpf_now`](scx_bpf_now.md) + +### Dispatch Queue Kfuncs + +- [`scx_bpf_create_dsq`](scx_bpf_create_dsq.md) +- [`scx_bpf_destroy_dsq`](scx_bpf_destroy_dsq.md) +- [`scx_bpf_dsq_nr_queued`](scx_bpf_dsq_nr_queued.md) +- [`scx_bpf_dsq_insert`](scx_bpf_dsq_insert.md) ([`scx_bpf_dispatch`](scx_bpf_dispatch.md)) +- [`scx_bpf_dsq_insert_vtime`](scx_bpf_dsq_insert_vtime.md) ([`scx_bpf_dispatch_vtime`](scx_bpf_dispatch_vtime.md)) +- [`scx_bpf_dsq_move_to_local`](scx_bpf_dsq_move_to_local.md) ([`scx_bpf_consume`](scx_bpf_consume.md)) +- [`scx_bpf_dsq_move_set_slice`](scx_bpf_dsq_move_set_slice.md) ([`scx_bpf_dispatch_from_dsq_set_slice`](scx_bpf_dispatch_from_dsq_set_slice.md)) +- [`scx_bpf_dsq_move_set_vtime`](scx_bpf_dsq_move_set_vtime.md) ([`scx_bpf_dispatch_from_dsq_set_vtime`](scx_bpf_dispatch_from_dsq_set_vtime.md)) +- [`scx_bpf_dsq_move`](scx_bpf_dsq_move.md) ([`scx_bpf_dispatch_from_dsq`](scx_bpf_dispatch_from_dsq.md)) +- [`scx_bpf_dsq_move_vtime`](scx_bpf_dsq_move_vtime.md) ([`scx_bpf_dispatch_vtime_from_dsq`](scx_bpf_dispatch_vtime_from_dsq.md)) +- [`scx_bpf_reenqueue_local`](scx_bpf_reenqueue_local.md) + +### Dispatch Kfuncs + +- [`scx_bpf_dispatch_nr_slots`](scx_bpf_dispatch_nr_slots.md) +- [`scx_bpf_dispatch_cancel`](scx_bpf_dispatch_cancel.md) + +### Error and debug Kfuncs + +- [`scx_bpf_exit_bstr`](scx_bpf_exit_bstr.md) +- [`scx_bpf_error_bstr`](scx_bpf_error_bstr.md) +- [`scx_bpf_dump_bstr`](scx_bpf_dump_bstr.md) + +### CPU performance Kfuncs + +- [`scx_bpf_cpuperf_cap`](scx_bpf_cpuperf_cap.md) +- [`scx_bpf_cpuperf_cur`](scx_bpf_cpuperf_cur.md) +- [`scx_bpf_cpuperf_set`](scx_bpf_cpuperf_set.md) +- [`scx_bpf_nr_cpu_ids`](scx_bpf_nr_cpu_ids.md) + +### CPU mask Kfuncs + +- [`scx_bpf_get_possible_cpumask`](scx_bpf_get_possible_cpumask.md) +- [`scx_bpf_get_online_cpumask`](scx_bpf_get_online_cpumask.md) +- [`scx_bpf_put_cpumask`](scx_bpf_put_cpumask.md) + +### Idle CPU mask Kfuncs + +- [`scx_bpf_get_idle_cpumask`](scx_bpf_get_idle_cpumask.md) +- [`scx_bpf_get_idle_smtmask`](scx_bpf_get_idle_smtmask.md) +- [`scx_bpf_put_idle_cpumask`](scx_bpf_put_idle_cpumask.md) +- [`scx_bpf_test_and_clear_cpu_idle`](scx_bpf_test_and_clear_cpu_idle.md) +- [`scx_bpf_pick_idle_cpu`](scx_bpf_pick_idle_cpu.md) +- [`scx_bpf_pick_any_cpu`](scx_bpf_pick_any_cpu.md) + +### Task Kfuncs + +- [`scx_bpf_task_running`](scx_bpf_task_running.md) +- [`scx_bpf_task_cpu`](scx_bpf_task_cpu.md) +- [`scx_bpf_task_cgroup`](scx_bpf_task_cgroup.md) diff --git a/docs/linux/kfuncs/scx_bpf_consume.md b/docs/linux/kfuncs/scx_bpf_consume.md new file mode 100644 index 0000000..b96c96a --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_consume.md @@ -0,0 +1,38 @@ +--- +title: "KFunc 'scx_bpf_consume'" +description: "This page documents the 'scx_bpf_consume' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_consume` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function was renamed to [`scx_bpf_dsq_move_to_local`](scx_bpf_dsq_move_to_local.md) in [:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5209c03c8ed215357a4827496a71fd32167d83ef). But will be aliased until v6.15. + +## Definition + +**Signature** + + +`#!c bool scx_bpf_consume(u64 dsq_id)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_cpu_rq.md b/docs/linux/kfuncs/scx_bpf_cpu_rq.md new file mode 100644 index 0000000..234408c --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_cpu_rq.md @@ -0,0 +1,44 @@ +--- +title: "KFunc 'scx_bpf_cpu_rq'" +description: "This page documents the 'scx_bpf_cpu_rq' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_cpu_rq` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/6203ef73fa5c0358f7960b038628259be1448724) + + +This function fetches the rq (run queue) of a CPU. + +## Definition + +**Parameters** + +`cpu`: CPU of the rq + +**Signature** + + +`#!c struct rq *scx_bpf_cpu_rq(s32 cpu)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_cpuperf_cap.md b/docs/linux/kfuncs/scx_bpf_cpuperf_cap.md new file mode 100644 index 0000000..a106277 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_cpuperf_cap.md @@ -0,0 +1,48 @@ +--- +title: "KFunc 'scx_bpf_cpuperf_cap'" +description: "This page documents the 'scx_bpf_cpuperf_cap' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_cpuperf_cap` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/d86adb4fc0655a0867da811d000df75d2a325ef6) + + +This function queries the maximum relative capacity of a CPU. + +## Definition + +**Parameters**: + +`cpu`: CPU of interest + +**Returns** + +The maximum relative capacity of `cpu` in relation to the most performant CPU in the system. The return value is in the range [`1`, `SCX_CPUPERF_ONE`]. See [`scx_bpf_cpuperf_cur`](scx_bpf_cpuperf_cur.md). + +**Signature** + + +`#!c u32 scx_bpf_cpuperf_cap(s32 cpu)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_cpuperf_cur.md b/docs/linux/kfuncs/scx_bpf_cpuperf_cur.md new file mode 100644 index 0000000..7fe53c7 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_cpuperf_cur.md @@ -0,0 +1,52 @@ +--- +title: "KFunc 'scx_bpf_cpuperf_cur'" +description: "This page documents the 'scx_bpf_cpuperf_cur' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_cpuperf_cur` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/d86adb4fc0655a0867da811d000df75d2a325ef6) + + +This function queries the current relative performance of a CPU. + +## Definition + +The current performance level of a CPU in relation to the maximum performance available in the system can be calculated as follows: + +[`scx_bpf_cpuperf_cap()`](scx_bpf_cpuperf_cap.md) * [`scx_bpf_cpuperf_cur()`](scx_bpf_cpuperf_cur.md) / `SCX_CPUPERF_ONE` + +The result is in the range [1, `SCX_CPUPERF_ONE`]. + +`cpu`: CPU of interest + +**Returns** + +The current relative performance of `cpu` in relation to its maximum. The return value is in the range [`1`, `SCX_CPUPERF_ONE`]. + +**Signature** + + +`#!c u32 scx_bpf_cpuperf_cur(s32 cpu)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_cpuperf_set.md b/docs/linux/kfuncs/scx_bpf_cpuperf_set.md new file mode 100644 index 0000000..006e399 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_cpuperf_set.md @@ -0,0 +1,49 @@ +--- +title: "KFunc 'scx_bpf_cpuperf_set'" +description: "This page documents the 'scx_bpf_cpuperf_set' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_cpuperf_set` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/d86adb4fc0655a0867da811d000df75d2a325ef6) + + +This function set the relative performance target of a CPU. + +## Definition + +Set the target performance level of `cpu` to `perf`. `perf` is in linear relative scale between `0` and `SCX_CPUPERF_ONE`. This determines how the schedutil cpufreq governor chooses the target frequency. + +The actual performance level chosen, CPU grouping, and the overhead and latency of the operations are dependent on the hardware and cpufreq driver in use. Consult hardware and cpufreq documentation for more information. The current performance level can be monitored using [`scx_bpf_cpuperf_cur`](scx_bpf_cpuperf_cur.md). + +**Returns** + +`cpu`: CPU of interest +`perf`: target performance level [`0`, `SCX_CPUPERF_ONE`] + +**Signature** + + +`#!c void scx_bpf_cpuperf_set(s32 cpu, u32 perf)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_create_dsq.md b/docs/linux/kfuncs/scx_bpf_create_dsq.md new file mode 100644 index 0000000..669ff19 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_create_dsq.md @@ -0,0 +1,54 @@ +--- +title: "KFunc 'scx_bpf_create_dsq'" +description: "This page documents the 'scx_bpf_create_dsq' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_create_dsq` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function creates a custom DSQ. + +## Definition + +Create a custom DSQ identified by `dsq_id`. Can be called from any sleepable scx callback, and any [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) prog. + +**Parameters** + +`dsq_id`: DSQ to create + +`node`: NUMA node to allocate from + +**Returns** + +`0` on success, negative error code on failure + +**Signature** + + +`#!c s32 scx_bpf_create_dsq(u64 dsq_id, s32 node)` + +!!! note + This function may sleep, and therefore can only be used from [sleepable programs](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable). + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_destroy_dsq.md b/docs/linux/kfuncs/scx_bpf_destroy_dsq.md new file mode 100644 index 0000000..d3082ae --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_destroy_dsq.md @@ -0,0 +1,46 @@ +--- +title: "KFunc 'scx_bpf_destroy_dsq'" +description: "This page documents the 'scx_bpf_destroy_dsq' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_destroy_dsq` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function destroys a custom DSQ. + +## Definition + +Destroy the custom DSQ identified by `dsq_id`. Only DSQs created with [`scx_bpf_create_dsq`](scx_bpf_create_dsq.md) can be destroyed. The caller must ensure that the DSQ is empty and no further tasks are dispatched to it. Ignored if called on a DSQ which doesn't exist. Can be called from any online `scx_ops` operations. + +**Parameters** + +`dsq_id`: DSQ to destroy + +**Signature** + + +`#!c void scx_bpf_destroy_dsq(u64 dsq_id)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dispatch.md b/docs/linux/kfuncs/scx_bpf_dispatch.md new file mode 100644 index 0000000..d729bae --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dispatch.md @@ -0,0 +1,38 @@ +--- +title: "KFunc 'scx_bpf_dispatch'" +description: "This page documents the 'scx_bpf_dispatch' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dispatch` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function was renamed to [`scx_bpf_dsq_insert`](scx_bpf_dsq_insert.md) in [:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/cc26abb1a19adbb91b79d25a2e74976633ece429). But will be aliased until v6.15. + +## Definition + +**Signature** + + +`#!c void scx_bpf_dispatch(struct task_struct *p, u64 dsq_id, u64 slice, u64 enq_flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dispatch_cancel.md b/docs/linux/kfuncs/scx_bpf_dispatch_cancel.md new file mode 100644 index 0000000..98be09b --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dispatch_cancel.md @@ -0,0 +1,40 @@ +--- +title: "KFunc 'scx_bpf_dispatch_cancel'" +description: "This page documents the 'scx_bpf_dispatch_cancel' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dispatch_cancel` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function cancels the latest dispatch. + +## Definition + +Cancel the latest dispatch. Can be called multiple times to cancel further dispatches. Can only be called from `ops.dispatch()`. + +**Signature** + + +`#!c void scx_bpf_dispatch_cancel()` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dispatch_from_dsq.md b/docs/linux/kfuncs/scx_bpf_dispatch_from_dsq.md new file mode 100644 index 0000000..131a648 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dispatch_from_dsq.md @@ -0,0 +1,39 @@ +--- +title: "KFunc 'scx_bpf_dispatch_from_dsq'" +description: "This page documents the 'scx_bpf_dispatch_from_dsq' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dispatch_from_dsq` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) + + +This function was renamed to [`scx_bpf_dsq_move`](scx_bpf_dsq_move.md) in [:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11). But will be aliased until v6.15. + +## Definition + +**Signature** + + +`#!c bool scx_bpf_dispatch_from_dsq(struct bpf_iter_scx_dsq *it__iter, struct task_struct *p, u64 dsq_id, u64 enq_flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dispatch_from_dsq_set_slice.md b/docs/linux/kfuncs/scx_bpf_dispatch_from_dsq_set_slice.md new file mode 100644 index 0000000..d4be323 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dispatch_from_dsq_set_slice.md @@ -0,0 +1,39 @@ +--- +title: "KFunc 'scx_bpf_dispatch_from_dsq_set_slice'" +description: "This page documents the 'scx_bpf_dispatch_from_dsq_set_slice' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dispatch_from_dsq_set_slice` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) + + +This function was renamed to [`scx_bpf_dsq_move_set_slice`](scx_bpf_dsq_move_set_slice.md) in [:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11). But will be aliased until v6.15. + +## Definition + +**Signature** + + +`#!c void scx_bpf_dispatch_from_dsq_set_slice(struct bpf_iter_scx_dsq *it__iter, u64 slice)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dispatch_from_dsq_set_vtime.md b/docs/linux/kfuncs/scx_bpf_dispatch_from_dsq_set_vtime.md new file mode 100644 index 0000000..37f412c --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dispatch_from_dsq_set_vtime.md @@ -0,0 +1,39 @@ +--- +title: "KFunc 'scx_bpf_dispatch_from_dsq_set_vtime'" +description: "This page documents the 'scx_bpf_dispatch_from_dsq_set_vtime' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dispatch_from_dsq_set_vtime` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) + + +This function was renamed to [`scx_bpf_dsq_move_set_vtime`](scx_bpf_dsq_move_set_vtime.md) in [:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11). But will be aliased until v6.15. + +## Definition + +**Signature** + + +`#!c void scx_bpf_dispatch_from_dsq_set_vtime(struct bpf_iter_scx_dsq *it__iter, u64 vtime)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dispatch_nr_slots.md b/docs/linux/kfuncs/scx_bpf_dispatch_nr_slots.md new file mode 100644 index 0000000..ede2031 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dispatch_nr_slots.md @@ -0,0 +1,44 @@ +--- +title: "KFunc 'scx_bpf_dispatch_nr_slots'" +description: "This page documents the 'scx_bpf_dispatch_nr_slots' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dispatch_nr_slots` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function returns the number of remaining dispatch slots. + +## Definition + +Can only be called from `ops.dispatch()`. + +**Returns** + +The number of remaining dispatch slots + +**Signature** + + +`#!c u32 scx_bpf_dispatch_nr_slots()` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dispatch_vtime.md b/docs/linux/kfuncs/scx_bpf_dispatch_vtime.md new file mode 100644 index 0000000..00cc599 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dispatch_vtime.md @@ -0,0 +1,38 @@ +--- +title: "KFunc 'scx_bpf_dispatch_vtime'" +description: "This page documents the 'scx_bpf_dispatch_vtime' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dispatch_vtime` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/06e51be3d5e7a07aea5c9012773df8d5de01db6c) + + +This function was renamed to [`scx_bpf_dsq_insert_vtime`](scx_bpf_dsq_insert_vtime.md) in [:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/cc26abb1a19adbb91b79d25a2e74976633ece429). But will be aliased until v6.15. + +## Definition + +**Signature** + + +`#!c void scx_bpf_dispatch_vtime(struct task_struct *p, u64 dsq_id, u64 slice, u64 vtime, u64 enq_flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dispatch_vtime_from_dsq.md b/docs/linux/kfuncs/scx_bpf_dispatch_vtime_from_dsq.md new file mode 100644 index 0000000..10498eb --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dispatch_vtime_from_dsq.md @@ -0,0 +1,39 @@ +--- +title: "KFunc 'scx_bpf_dispatch_vtime_from_dsq'" +description: "This page documents the 'scx_bpf_dispatch_vtime_from_dsq' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dispatch_vtime_from_dsq` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) + + +This function was renamed to [`scx_bpf_dsq_move_vtime`](scx_bpf_dsq_move_vtime.md) in [:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11). But will be aliased until v6.15. + +## Definition + +**Signature** + + +`#!c bool scx_bpf_dispatch_vtime_from_dsq(struct bpf_iter_scx_dsq *it__iter, struct task_struct *p, u64 dsq_id, u64 enq_flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dsq_insert.md b/docs/linux/kfuncs/scx_bpf_dsq_insert.md new file mode 100644 index 0000000..e3a5dcc --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dsq_insert.md @@ -0,0 +1,74 @@ +--- +title: "KFunc 'scx_bpf_dsq_insert'" +description: "This page documents the 'scx_bpf_dsq_insert' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dsq_insert` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/cc26abb1a19adbb91b79d25a2e74976633ece429) + + +This function inserts a task into the First In First Out(FIFO) queue of a Dispatch Queue(DSQ) + +## Definition + +Insert `p` into the FIFO queue of the DSQ identified by `dsq_id`. It is safe to call this function spuriously. Can be called from `ops.enqueue()`, `ops.select_cpu()`, and `ops.dispatch()`. + +When called from `ops.select_cpu()` or `ops.enqueue()`, it's for direct dispatch and `p` must match the task being enqueued. + +When called from `ops.select_cpu()`, `enq_flags` and `dsp_id` are stored, and `p` will be directly inserted into the corresponding dispatch queue after `ops.select_cpu()` returns. If `p` is inserted into `SCX_DSQ_LOCAL`, it will be inserted into the local DSQ of the CPU returned by `ops.select_cpu()`. `enq_flags` are OR'd with the enqueue flags on the enqueue path before the task is inserted. + +When called from `ops.dispatch()`, there are no restrictions on `p` or `dsq_id` and this function can be called up to `ops.dispatch_max_batch` times to insert multiple tasks. [`scx_bpf_dispatch_nr_slots`](scx_bpf_dispatch_nr_slots.md) returns the number of the remaining slots. [`scx_bpf_consume`](scx_bpf_consume.md) flushes the batch and resets the counter. + +This function doesn't have any locking restrictions and may be called under BPF locks (in the future when BPF introduces more flexible locking). + +`p` is allowed to run for `slice`. The scheduling path is triggered on slice exhaustion. If zero, the current residual slice is maintained. If `SCX_SLICE_INF`, `p` never expires and the BPF scheduler must kick the CPU with [`scx_bpf_kick_cpu`](scx_bpf_kick_cpu.md) to trigger scheduling. + +**Parameters** + +`p`: task_struct to insert + +`dsq_id`: DSQ to insert into + +`slice`: duration `p` can run for in nanoseconds, 0 to keep the current value + +`enq_flags`: `SCX_ENQ_*` + +**Flags** + +`SCX_ENQ_WAKEUP`: Task just became runnable + +`SCX_ENQ_HEAD`: Place at front of queue (tail if not specified) + +`SCX_ENQ_CPU_SELECTED`: `->select_task_rq()` was called + +`SCX_ENQ_PREEMPT`: Set the following to trigger preemption when calling `scx_bpf_dsq_insert` with a local dsq as the target. The slice of the current task is cleared to zero and the CPU is kicked into the scheduling path. Implies `SCX_ENQ_HEAD`. + +`SCX_ENQ_REENQ`: The task being enqueued was previously enqueued on the current CPU's `SCX_DSQ_LOCAL`, but was removed from it in a call to the [`scx_bpf_reenqueue_local`](scx_bpf_reenqueue_local.md) kfunc. If [`scx_bpf_reenqueue_local`](scx_bpf_reenqueue_local.md) was invoked in a `->cpu_release()` callback, and the task is again dispatched back to `SCX_LOCAL_DSQ` by this current `->enqueue()`, the task will not be scheduled on the CPU until at least the next invocation of the `->cpu_acquire()` callback. + +`SCX_ENQ_LAST`: The task being enqueued is the only task available for the cpu. By default, ext core keeps executing such tasks but when `SCX_OPS_ENQ_LAST` is specified, they are `ops.enqueue()`'d with the `SCX_ENQ_LAST` flag set. The BPF scheduler is responsible for triggering a follow-up scheduling event. Otherwise, Execution may stall. + +**Signature** + + +`#!c void scx_bpf_dsq_insert(struct task_struct *p, u64 dsq_id, u64 slice, u64 enq_flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dsq_insert_vtime.md b/docs/linux/kfuncs/scx_bpf_dsq_insert_vtime.md new file mode 100644 index 0000000..ce9a67b --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dsq_insert_vtime.md @@ -0,0 +1,70 @@ +--- +title: "KFunc 'scx_bpf_dsq_insert_vtime'" +description: "This page documents the 'scx_bpf_dsq_insert_vtime' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dsq_insert_vtime` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/cc26abb1a19adbb91b79d25a2e74976633ece429) + + +This function inserts a task into the `vtime` priority queue of a DSQ. + +## Definition + +Insert `p` into the `vtime` priority queue of the DSQ identified by `dsq_id`. Tasks queued into the priority queue are ordered by `vtime`. All other aspects are identical to [`scx_bpf_dsq_insert`](scx_bpf_dsq_insert.md). + +`vtime` ordering is according to [`time_before64()`](https://elixir.bootlin.com/linux/v6.13/source/include/linux/jiffies.h#L212) which considers wrapping. A numerically larger vtime may indicate an earlier position in the ordering and vice-versa. + +A DSQ can only be used as a FIFO or priority queue at any given time and this function must not be called on a DSQ which already has one or more FIFO tasks queued and vice-versa. Also, the built-in DSQs (`SCX_DSQ_LOCAL` and `SCX_DSQ_GLOBAL`) cannot be used as priority queues. + +**Parameters** + +`p`: task_struct to insert + +`dsq_id`: DSQ to insert into + +`slice`: duration `p` can run for in nanoseconds, 0 to keep the current value + +`vtime`: `p`'s ordering inside the vtime-sorted queue of the target DSQ + +`enq_flags`: `SCX_ENQ_*` + +**Flags** + +`SCX_ENQ_WAKEUP`: Task just became runnable + +`SCX_ENQ_HEAD`: Place at front of queue (tail if not specified) + +`SCX_ENQ_CPU_SELECTED`: `->select_task_rq()` was called + +`SCX_ENQ_PREEMPT`: Set the following to trigger preemption when calling `scx_bpf_dsq_insert` with a local dsq as the target. The slice of the current task is cleared to zero and the CPU is kicked into the scheduling path. Implies `SCX_ENQ_HEAD`. + +`SCX_ENQ_REENQ`: The task being enqueued was previously enqueued on the current CPU's `SCX_DSQ_LOCAL`, but was removed from it in a call to the [`scx_bpf_reenqueue_local`](scx_bpf_reenqueue_local.md) kfunc. If [`scx_bpf_reenqueue_local`](scx_bpf_reenqueue_local.md) was invoked in a `->cpu_release()` callback, and the task is again dispatched back to `SCX_LOCAL_DSQ` by this current `->enqueue()`, the task will not be scheduled on the CPU until at least the next invocation of the `->cpu_acquire()` callback. + +`SCX_ENQ_LAST`: The task being enqueued is the only task available for the cpu. By default, ext core keeps executing such tasks but when `SCX_OPS_ENQ_LAST` is specified, they are `ops.enqueue()`'d with the `SCX_ENQ_LAST` flag set. The BPF scheduler is responsible for triggering a follow-up scheduling event. Otherwise, Execution may stall. + +**Signature** + + +`#!c void scx_bpf_dsq_insert_vtime(struct task_struct *p, u64 dsq_id, u64 slice, u64 vtime, u64 enq_flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dsq_move.md b/docs/linux/kfuncs/scx_bpf_dsq_move.md new file mode 100644 index 0000000..cc8eadc --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dsq_move.md @@ -0,0 +1,75 @@ +--- +title: "KFunc 'scx_bpf_dsq_move'" +description: "This page documents the 'scx_bpf_dsq_move' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dsq_move` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) + + +This function moves a task from DSQ iteration to a DSQ. + +## Definition + +Transfer `p` which is on the DSQ currently iterated by `it__iter` to the DSQ specified by `dsq_id`. All DSQs - local DSQs, global DSQ and user DSQs - can be the destination. + +For the transfer to be successful, `p` must still be on the DSQ and have been queued before the DSQ iteration started. This function doesn't care whether `p` was obtained from the DSQ iteration. `p` just has to be on the DSQ and have been queued before the iteration started. + +`p`'s slice is kept by default. Use [`scx_bpf_dsq_move_set_slice`](scx_bpf_dsq_move_set_slice.md) to update. + +Can be called from `ops.dispatch()` or any BPF context which doesn't hold a rq lock (e.g. [BPF timers](../concepts/timers.md) or [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) programs). + +**Parameters** + +`it__iter`: DSQ iterator in progress + +`p:` task to transfer + +`dsq_id`: DSQ to move `p` to + +`enq_flags`: `SCX_ENQ_*` + +**Flags** + +`SCX_ENQ_WAKEUP`: Task just became runnable + +`SCX_ENQ_HEAD`: Place at front of queue (tail if not specified) + +`SCX_ENQ_CPU_SELECTED`: `->select_task_rq()` was called + +`SCX_ENQ_PREEMPT`: Set the following to trigger preemption when calling `scx_bpf_dsq_insert` with a local dsq as the target. The slice of the current task is cleared to zero and the CPU is kicked into the scheduling path. Implies `SCX_ENQ_HEAD`. + +`SCX_ENQ_REENQ`: The task being enqueued was previously enqueued on the current CPU's `SCX_DSQ_LOCAL`, but was removed from it in a call to the [`scx_bpf_reenqueue_local`](scx_bpf_reenqueue_local.md) kfunc. If [`scx_bpf_reenqueue_local`](scx_bpf_reenqueue_local.md) was invoked in a `->cpu_release()` callback, and the task is again dispatched back to `SCX_LOCAL_DSQ` by this current `->enqueue()`, the task will not be scheduled on the CPU until at least the next invocation of the `->cpu_acquire()` callback. + +`SCX_ENQ_LAST`: The task being enqueued is the only task available for the cpu. By default, ext core keeps executing such tasks but when `SCX_OPS_ENQ_LAST` is specified, they are `ops.enqueue()`'d with the `SCX_ENQ_LAST` flag set. The BPF scheduler is responsible for triggering a follow-up scheduling event. Otherwise, Execution may stall. + +**Return** + +Returns `true` if `p` has been consumed, `false` if `p` had already been consumed or dequeued. + +**Signature** + + +`#!c bool scx_bpf_dsq_move(struct bpf_iter_scx_dsq *it__iter, struct task_struct *p, u64 dsq_id, u64 enq_flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dsq_move_set_slice.md b/docs/linux/kfuncs/scx_bpf_dsq_move_set_slice.md new file mode 100644 index 0000000..ae097d6 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dsq_move_set_slice.md @@ -0,0 +1,48 @@ +--- +title: "KFunc 'scx_bpf_dsq_move_set_slice'" +description: "This page documents the 'scx_bpf_dsq_move_set_slice' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dsq_move_set_slice` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) + + +This function overrides slice when moving between DSQs. + +## Definition + +Override the slice of the next task that will be moved from `it__iter` using [`scx_bpf_dsq_move`](scx_bpf_dsq_move.md) or [`scx_bpf_dsq_move_vtime`](scx_bpf_dsq_move_vtime.md). If this function is not called, the previous slice duration is kept. + +**Parameters** + +`it__iter`: DSQ iterator in progress + +`slice`: duration the moved task can run for in nanoseconds + + +**Signature** + + +`#!c void scx_bpf_dsq_move_set_slice(struct bpf_iter_scx_dsq *it__iter, u64 slice)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dsq_move_set_vtime.md b/docs/linux/kfuncs/scx_bpf_dsq_move_set_vtime.md new file mode 100644 index 0000000..e2d123a --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dsq_move_set_vtime.md @@ -0,0 +1,48 @@ +--- +title: "KFunc 'scx_bpf_dsq_move_set_vtime'" +description: "This page documents the 'scx_bpf_dsq_move_set_vtime' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dsq_move_set_vtime` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) + + +This function overrides `vtime` when moving between DSQs. + +## Definition + +Override the `vtime` of the next task that will be moved from `it__iter` using [`scx_bpf_dsq_move_vtime`](scx_bpf_dsq_move_vtime.md). If this function is not called, the previous slice vtime is kept. If [`scx_bpf_dsq_move`](scx_bpf_dsq_move.md) is used to dispatch the next task, the override is ignored and cleared. + +**Parameters** + +`it__iter`: DSQ iterator in progress + +`vtime`: task's ordering inside the vtime-sorted queue of the target DSQ + + +**Signature** + + +`#!c void scx_bpf_dsq_move_set_vtime(struct bpf_iter_scx_dsq *it__iter, u64 vtime)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dsq_move_to_local.md b/docs/linux/kfuncs/scx_bpf_dsq_move_to_local.md new file mode 100644 index 0000000..7c2d4b7 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dsq_move_to_local.md @@ -0,0 +1,50 @@ +--- +title: "KFunc 'scx_bpf_dsq_move_to_local'" +description: "This page documents the 'scx_bpf_dsq_move_to_local' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dsq_move_to_local` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5209c03c8ed215357a4827496a71fd32167d83ef) + + +This function moves a task from a DSQ to the current CPU's local DSQ. + +## Definition + +Move a task from the non-local DSQ identified by `dsq_id` to the current CPU's local DSQ for execution. Can only be called from `ops.dispatch()`. + +This function flushes the in-flight dispatches from [`scx_bpf_dsq_insert`](scx_bpf_dsq_insert.md) before trying to move from the specified DSQ. It may also grab rq locks and thus can't be called under any BPF locks. + +**Parameters** + +`dsq_id`: DSQ to move task from + +**Returns** + +Returns `true` if a task has been moved, `false` if there isn't any task to move. + +**Signature** + + +`#!c bool scx_bpf_dsq_move_to_local(u64 dsq_id)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dsq_move_vtime.md b/docs/linux/kfuncs/scx_bpf_dsq_move_vtime.md new file mode 100644 index 0000000..413ed4d --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dsq_move_vtime.md @@ -0,0 +1,74 @@ +--- +title: "KFunc 'scx_bpf_dsq_move_vtime'" +description: "This page documents the 'scx_bpf_dsq_move_vtime' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dsq_move_vtime` + + +[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) + + +This function moves a task from DSQ iteration to a PRIQ DSQ. + +## Definition + +Transfer `p` which is on the DSQ currently iterated by `it__iter` to the priority queue of the DSQ specified by `dsq_id`. The destination must be a user DSQ as only user DSQs support priority queue. + +`p`'s slice and vtime are kept by default. Use [`scx_bpf_dsq_move_set_slice`](scx_bpf_dsq_move_set_slice.md) and [`scx_bpf_dsq_move_set_vtime`](scx_bpf_dsq_move_set_vtime.md) to update. + +All other aspects are identical to [`scx_bpf_dsq_move`](scx_bpf_dsq_move.md). See [`scx_bpf_dsq_insert_vtime`](scx_bpf_dsq_insert_vtime.md) for more information on `vtime`. + +**Parameters** + +`it__iter`: DSQ iterator in progress + +`p:` task to transfer + +`dsq_id`: DSQ to move `p` to + +`enq_flags`: `SCX_ENQ_*` + + +**Flags** + +`SCX_ENQ_WAKEUP`: Task just became runnable + +`SCX_ENQ_HEAD`: Place at front of queue (tail if not specified) + +`SCX_ENQ_CPU_SELECTED`: `->select_task_rq()` was called + +`SCX_ENQ_PREEMPT`: Set the following to trigger preemption when calling `scx_bpf_dsq_insert` with a local dsq as the target. The slice of the current task is cleared to zero and the CPU is kicked into the scheduling path. Implies `SCX_ENQ_HEAD`. + +`SCX_ENQ_REENQ`: The task being enqueued was previously enqueued on the current CPU's `SCX_DSQ_LOCAL`, but was removed from it in a call to the [`scx_bpf_reenqueue_local`](scx_bpf_reenqueue_local.md) kfunc. If [`scx_bpf_reenqueue_local`](scx_bpf_reenqueue_local.md) was invoked in a `->cpu_release()` callback, and the task is again dispatched back to `SCX_LOCAL_DSQ` by this current `->enqueue()`, the task will not be scheduled on the CPU until at least the next invocation of the `->cpu_acquire()` callback. + +`SCX_ENQ_LAST`: The task being enqueued is the only task available for the cpu. By default, ext core keeps executing such tasks but when `SCX_OPS_ENQ_LAST` is specified, they are `ops.enqueue()`'d with the `SCX_ENQ_LAST` flag set. The BPF scheduler is responsible for triggering a follow-up scheduling event. Otherwise, Execution may stall. + +**Return** + +Returns `true` if `p` has been consumed, `false` if `p` had already been consumed or dequeued. + +**Signature** + + +`#!c bool scx_bpf_dsq_move_vtime(struct bpf_iter_scx_dsq *it__iter, struct task_struct *p, u64 dsq_id, u64 enq_flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dsq_nr_queued.md b/docs/linux/kfuncs/scx_bpf_dsq_nr_queued.md new file mode 100644 index 0000000..65aa852 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dsq_nr_queued.md @@ -0,0 +1,48 @@ +--- +title: "KFunc 'scx_bpf_dsq_nr_queued'" +description: "This page documents the 'scx_bpf_dsq_nr_queued' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dsq_nr_queued` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function returns the number of queued tasks. + +## Definition + +**Parameters** + +`dsq_id`: id of the DSQ + +**Returns** + +The number of tasks in the DSQ matching `dsq_id`. If not found, `-ENOENT` is returned. + +**Signature** + + +`#!c s32 scx_bpf_dsq_nr_queued(u64 dsq_id)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_dump_bstr.md b/docs/linux/kfuncs/scx_bpf_dump_bstr.md new file mode 100644 index 0000000..71b98af --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_dump_bstr.md @@ -0,0 +1,54 @@ +--- +title: "KFunc 'scx_bpf_dump_bstr'" +description: "This page documents the 'scx_bpf_dump_bstr' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_dump_bstr` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/07814a9439a3b03d79a1001614b5bc1cab69bcec) + + +This function generates extra debug dump specific to the BPF scheduler. + +## Definition + +To be called through [`scx_bpf_dump()`](https://github.com/torvalds/linux/blob/07814a9439a3b03d79a1001614b5bc1cab69bcec/tools/sched_ext/include/scx/common.bpf.h#L105) helper from `ops.dump()`, `dump_cpu()` and `dump_task()` to generate extra debug dump specific to the BPF scheduler. + +The extra dump may be multiple lines. A single line may be split over multiple calls. The last line is automatically terminated. + +**Parameters** + +`fmt`: format string + +`data`: format string parameters packaged using [`___bpf_fill`](../../ebpf-library/libbpf/ebpf/___bpf_fill.md) macro + +`data__sz`: `data` len, [must end in '__sz' for the verifier](../concepts/kfuncs.md#__sz-annotation) + + + +**Signature** + + +`#!c void scx_bpf_dump_bstr(char *fmt, long long unsigned int *data, u32 data__sz)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_error_bstr.md b/docs/linux/kfuncs/scx_bpf_error_bstr.md new file mode 100644 index 0000000..7a4984b --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_error_bstr.md @@ -0,0 +1,48 @@ +--- +title: "KFunc 'scx_bpf_error_bstr'" +description: "This page documents the 'scx_bpf_error_bstr' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_error_bstr` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function indicates a fatal error. + +## Definition + +Indicate that the BPF scheduler encountered a fatal error and initiate ops disabling. Intended to be called through the [`scx_bpf_error()`](https://github.com/torvalds/linux/blob/2a52ca7c98960aafb0eca9ef96b2d0c932171357/tools/sched_ext/include/scx/common.bpf.h#L93) helper macro. + +`fmt`: error message format string + +`data`: format string parameters packaged using [`___bpf_fill`](../../ebpf-library/libbpf/ebpf/___bpf_fill.md) macro + +`data__sz`: `data` len, [must end in '__sz' for the verifier](../concepts/kfuncs.md#__sz-annotation) + +**Signature** + + +`#!c void scx_bpf_error_bstr(char *fmt, long long unsigned int *data, u32 data__sz)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_exit_bstr.md b/docs/linux/kfuncs/scx_bpf_exit_bstr.md new file mode 100644 index 0000000..5d1cc6f --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_exit_bstr.md @@ -0,0 +1,50 @@ +--- +title: "KFunc 'scx_bpf_exit_bstr'" +description: "This page documents the 'scx_bpf_exit_bstr' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_exit_bstr` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function gracefully exits the BPF scheduler. + +## Definition + +Indicate that the BPF scheduler wants to exit gracefully, and initiate ops disabling. Intended to be called through the [`scx_bpf_exit`](https://github.com/torvalds/linux/blob/2a52ca7c98960aafb0eca9ef96b2d0c932171357/tools/sched_ext/include/scx/common.bpf.h#L80) helper macro. + +`exit_code`: Exit value to pass to user space via struct `scx_exit_info`. + +`fmt`: error message format string + +`data`: format string parameters packaged using [`___bpf_fill`](../../ebpf-library/libbpf/ebpf/___bpf_fill.md) macro + +`data__sz`: `data` len, [must end in '__sz' for the verifier](../concepts/kfuncs.md#__sz-annotation) + +**Signature** + + +`#!c void scx_bpf_exit_bstr(s64 exit_code, char *fmt, long long unsigned int *data, u32 data__sz)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_get_idle_cpumask.md b/docs/linux/kfuncs/scx_bpf_get_idle_cpumask.md new file mode 100644 index 0000000..6f87894 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_get_idle_cpumask.md @@ -0,0 +1,50 @@ +--- +title: "KFunc 'scx_bpf_get_idle_cpumask'" +description: "This page documents the 'scx_bpf_get_idle_cpumask' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_get_idle_cpumask` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function gets a referenced kptr to the idle-tracking per-CPU cpumask. + +## Definition + +**Returns** + +`NULL` if idle tracking is not enabled, or running on a UP kernel. + +**Signature** + + +`#!c const struct cpumask *scx_bpf_get_idle_cpumask()` + +!!! 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`](../helper-function/bpf_kptr_xchg.md)). If not, the verifier fails the + loading of the BPF program until no lingering references remain in all possible explored states of the program. + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_get_idle_smtmask.md b/docs/linux/kfuncs/scx_bpf_get_idle_smtmask.md new file mode 100644 index 0000000..bc59a1e --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_get_idle_smtmask.md @@ -0,0 +1,52 @@ +--- +title: "KFunc 'scx_bpf_get_idle_smtmask'" +description: "This page documents the 'scx_bpf_get_idle_smtmask' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_get_idle_smtmask` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function gets a referenced kptr to the idle-tracking, per-physical-core cpumask. + +## Definition + +Can be used to determine if an entire physical core is free. + +**Returns** + +`NULL` if idle tracking is not enabled, or running on a UP kernel. + +**Signature** + + +`#!c const struct cpumask *scx_bpf_get_idle_smtmask()` + +!!! 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`](../helper-function/bpf_kptr_xchg.md)). If not, the verifier fails the + loading of the BPF program until no lingering references remain in all possible explored states of the program. + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_get_online_cpumask.md b/docs/linux/kfuncs/scx_bpf_get_online_cpumask.md new file mode 100644 index 0000000..795d35d --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_get_online_cpumask.md @@ -0,0 +1,46 @@ +--- +title: "KFunc 'scx_bpf_get_online_cpumask'" +description: "This page documents the 'scx_bpf_get_online_cpumask' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_get_online_cpumask` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function gets a referenced kptr to `cpu_online_mask`. + +## Definition + +**Signature** + + +`#!c const struct cpumask *scx_bpf_get_online_cpumask()` + +!!! 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`](../helper-function/bpf_kptr_xchg.md)). If not, the verifier fails the + loading of the BPF program until no lingering references remain in all possible explored states of the program. + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_get_possible_cpumask.md b/docs/linux/kfuncs/scx_bpf_get_possible_cpumask.md new file mode 100644 index 0000000..d0a2318 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_get_possible_cpumask.md @@ -0,0 +1,46 @@ +--- +title: "KFunc 'scx_bpf_get_possible_cpumask'" +description: "This page documents the 'scx_bpf_get_possible_cpumask' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_get_possible_cpumask` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function gets a referenced kptr to `cpu_possible_mask`. + +## Definition + +**Signature** + + +`#!c const struct cpumask *scx_bpf_get_possible_cpumask()` + +!!! 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`](../helper-function/bpf_kptr_xchg.md)). If not, the verifier fails the + loading of the BPF program until no lingering references remain in all possible explored states of the program. + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_kick_cpu.md b/docs/linux/kfuncs/scx_bpf_kick_cpu.md new file mode 100644 index 0000000..1411352 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_kick_cpu.md @@ -0,0 +1,54 @@ +--- +title: "KFunc 'scx_bpf_kick_cpu'" +description: "This page documents the 'scx_bpf_kick_cpu' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_kick_cpu` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function triggers reschedule on a CPU. + +## Definition + +Kick `cpu` into rescheduling. This can be used to wake up an idle CPU or trigger rescheduling on a busy CPU. This can be called from any online `scx_ops` operation and the actual kicking is performed asynchronously through an irq work. + +`cpu`: cpu to kick + +`flags`: `SCX_KICK_*` flags + +**Flags** + +`SCX_KICK_IDLE`: Kick the target CPU if idle. Guarantees that the target CPU goes through at least one full scheduling cycle before going idle. If the target CPU can be determined to be currently not idle and going to go through a scheduling cycle before going idle, noop. + +`SCX_KICK_PREEMPT`: Preempt the current task and execute the dispatch path. If the current task of the target CPU is an SCX task, its `->scx.slice` is cleared to zero before the scheduling path is invoked so that the task expires and the dispatch path is invoked. + +`SCX_KICK_WAIT`: Wait for the CPU to be rescheduled. The `scx_bpf_kick_cpu` call will return after the target CPU finishes picking the next task. + +**Signature** + + +`#!c void scx_bpf_kick_cpu(s32 cpu, u64 flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_now.md b/docs/linux/kfuncs/scx_bpf_now.md new file mode 100644 index 0000000..2064d24 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_now.md @@ -0,0 +1,52 @@ +--- +title: "KFunc 'scx_bpf_now'" +description: "This page documents the 'scx_bpf_now' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_now` + + +[:octicons-tag-24: v6.14](https://github.com/torvalds/linux/commit/3a9910b5904d29c566e3ff9290990b519827ba75) + + +This function returns a high-performance monotonically non-decreasing clock for the current CPU. The clock returned is in nanoseconds. + +## Definition + +It provides the following properties: + +1) High performance: Many BPF schedulers call [`bpf_ktime_get_ns`](../helper-function/bpf_ktime_get_ns.md) frequently to account for execution time and track tasks' runtime properties. Unfortunately, in some hardware platforms, [`bpf_ktime_get_ns`](../helper-function/bpf_ktime_get_ns.md) -- which eventually reads a hardware timestamp counter -- is neither performant nor scalable. `scx_bpf_now` aims to provide a high-performance clock by using the rq clock in the scheduler core whenever possible. + +2) High enough resolution for the BPF scheduler use cases: In most BPF scheduler use cases, the required clock resolution is lower than the most accurate hardware clock (e.g., rdtsc in x86). `scx_bpf_now` basically uses the rq clock in the scheduler core whenever it is valid. It considers that the rq clock is valid from the time the rq clock is updated (`update_rq_clock`) until the rq is unlocked (`rq_unpin_lock`). + +3) Monotonically non-decreasing clock for the same CPU: `scx_bpf_now` guarantees the clock never goes backward when comparing them in the same CPU. On the other hand, when comparing clocks in different CPUs, there is no such guarantee -- the clock can go backward. It provides a monotonically *non-decreasing* clock so that it would provide the same clock values in two different `scx_bpf_now` calls in the same CPU during the same period of when the rq clock is valid. + +**Returns** + +A high-performance monotonically non-decreasing clock for the current CPU. The clock returned is in nanoseconds. + +**Signature** + + +`#!c u64 scx_bpf_now()` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_nr_cpu_ids.md b/docs/linux/kfuncs/scx_bpf_nr_cpu_ids.md new file mode 100644 index 0000000..2665189 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_nr_cpu_ids.md @@ -0,0 +1,42 @@ +--- +title: "KFunc 'scx_bpf_nr_cpu_ids'" +description: "This page documents the 'scx_bpf_nr_cpu_ids' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_nr_cpu_ids` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function returns the number of possible CPU IDs + +## Definition + +All valid CPU IDs in the system are smaller than the returned value. + +**Signature** + + +`#!c u32 scx_bpf_nr_cpu_ids()` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_pick_any_cpu.md b/docs/linux/kfuncs/scx_bpf_pick_any_cpu.md new file mode 100644 index 0000000..ce8d82a --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_pick_any_cpu.md @@ -0,0 +1,58 @@ +--- +title: "KFunc 'scx_bpf_pick_any_cpu'" +description: "This page documents the 'scx_bpf_pick_any_cpu' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_pick_any_cpu` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +Pick and claim an idle CPU if available or pick any CPU + +## Definition + +Pick and claim an idle CPU in `cpus_allowed`. If none is available, pick any CPU in `cpus_allowed`. Guaranteed to succeed. + +If `ops.update_idle()` is implemented and `SCX_OPS_KEEP_BUILTIN_IDLE` is not set, this function can't tell which CPUs are idle and will always pick any CPU. + +**Parameters** + +`cpus_allowed`: Allowed cpumask + +`flags`: `SCX_PICK_IDLE_*` flags + +**Flags** + +* `SCX_PICK_IDLE_CORE` - pick a CPU whose SMT siblings are also idle + +**Returns** + +The picked idle CPU number if `cpus_allowed` is not empty. `-EBUSY` is returned if `cpus_allowed` is empty. + +**Signature** + + +`#!c s32 scx_bpf_pick_any_cpu(const struct cpumask *cpus_allowed, u64 flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_pick_idle_cpu.md b/docs/linux/kfuncs/scx_bpf_pick_idle_cpu.md new file mode 100644 index 0000000..b74f25c --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_pick_idle_cpu.md @@ -0,0 +1,60 @@ +--- +title: "KFunc 'scx_bpf_pick_idle_cpu'" +description: "This page documents the 'scx_bpf_pick_idle_cpu' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_pick_idle_cpu` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function picks and claims an idle CPU. + +## Definition + +Pick and claim an idle CPU in `cpus_allowed`. + +Idle CPU tracking may race against CPU scheduling state transitions. For example, this function may return `-EBUSY` as CPUs are transitioning into the idle state. If the caller then assumes that there will be dispatch events on the CPUs as they were all busy, the scheduler may end up stalling with CPUs idling while there are pending tasks. Use [`scx_bpf_pick_any_cpu`](scx_bpf_pick_any_cpu.md) and [`scx_bpf_kick_cpu`](scx_bpf_kick_cpu.md) to guarantee that there will be at least one dispatch event in the near future. + +Unavailable if `ops.update_idle()` is implemented and `SCX_OPS_KEEP_BUILTIN_IDLE` is not set. + +**Parameters** + +`cpus_allowed`: Allowed cpumask + +`flags`: `SCX_PICK_IDLE_*` flags + +**Flags** + +* `SCX_PICK_IDLE_CORE` - pick a CPU whose SMT siblings are also idle + +**Returns** + +The picked idle CPU number on success. `-EBUSY` if no matching cpu was found. + +**Signature** + + +`#!c s32 scx_bpf_pick_idle_cpu(const struct cpumask *cpus_allowed, u64 flags)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_put_cpumask.md b/docs/linux/kfuncs/scx_bpf_put_cpumask.md new file mode 100644 index 0000000..bf6f340 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_put_cpumask.md @@ -0,0 +1,48 @@ +--- +title: "KFunc 'scx_bpf_put_cpumask'" +description: "This page documents the 'scx_bpf_put_cpumask' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_put_cpumask` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function releases a possible/online cpumask. + +## Definition + +**Parameters** + +`cpumask`: cpumask to release + +**Signature** + + +`#!c void scx_bpf_put_cpumask(const struct cpumask *cpumask)` + +!!! note + This kfunc releases the pointer passed in to it. There can be only one referenced pointer that can be passed in. + All copies of the pointer being released are invalidated as a result of invoking this kfunc. + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_put_idle_cpumask.md b/docs/linux/kfuncs/scx_bpf_put_idle_cpumask.md new file mode 100644 index 0000000..cb789fa --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_put_idle_cpumask.md @@ -0,0 +1,48 @@ +--- +title: "KFunc 'scx_bpf_put_idle_cpumask'" +description: "This page documents the 'scx_bpf_put_idle_cpumask' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_put_idle_cpumask` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function releases a previously acquired referenced kptr to either the per-CPU, or SMT idle-tracking cpumask. + +## Definition + +**Parameters** + +`idle_mask`: `&cpumask` to use + +**Signature** + + +`#!c void scx_bpf_put_idle_cpumask(const struct cpumask *idle_mask)` + +!!! note + This kfunc releases the pointer passed in to it. There can be only one referenced pointer that can be passed in. + All copies of the pointer being released are invalidated as a result of invoking this kfunc. + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_reenqueue_local.md b/docs/linux/kfuncs/scx_bpf_reenqueue_local.md new file mode 100644 index 0000000..d485a03 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_reenqueue_local.md @@ -0,0 +1,44 @@ +--- +title: "KFunc 'scx_bpf_reenqueue_local'" +description: "This page documents the 'scx_bpf_reenqueue_local' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_reenqueue_local` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/245254f7081dbe1c8da54675d0e4ddbe74cee61b) + + +This function re-enqueues tasks on a local DSQ. + +## Definition + +Iterate over all of the tasks currently enqueued on the local DSQ of the caller's CPU, and re-enqueue them in the BPF scheduler. + +**Returns** + +The number of processed tasks. Can only be called from `ops.cpu_release()`. + +**Signature** + + +`#!c u32 scx_bpf_reenqueue_local()` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_select_cpu_dfl.md b/docs/linux/kfuncs/scx_bpf_select_cpu_dfl.md new file mode 100644 index 0000000..e5dd3d3 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_select_cpu_dfl.md @@ -0,0 +1,54 @@ +--- +title: "KFunc 'scx_bpf_select_cpu_dfl'" +description: "This page documents the 'scx_bpf_select_cpu_dfl' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_select_cpu_dfl` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function is the default implementation of `ops.select_cpu()` + +## Definition + +Can only be called from `ops.select_cpu()` if the built-in CPU selection is enabled, `ops.update_idle()` is missing, or `SCX_OPS_KEEP_BUILTIN_IDLE` is set. `p`, `prev_cpu` and `wake_flags` match `ops.select_cpu()`. + +**Parameters** + +`p:` task_struct to select a CPU for + +`prev_cpu`: CPU `p` was on previously + +`wake_flags`: `SCX_WAKE_*` flags + +`is_idle`: out parameter indicating whether the returned CPU is idle + +**Returns** + +The picked CPU with `is_idle` indicating whether the picked CPU is currently idle and thus a good candidate for direct dispatching. + +**Signature** + + +`#!c s32 scx_bpf_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags, bool *is_idle)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_task_cgroup.md b/docs/linux/kfuncs/scx_bpf_task_cgroup.md new file mode 100644 index 0000000..ee06616 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_task_cgroup.md @@ -0,0 +1,56 @@ +--- +title: "KFunc 'scx_bpf_task_cgroup'" +description: "This page documents the 'scx_bpf_task_cgroup' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_task_cgroup` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/8195136669661fdfe54e9a8923c33b31c92fc1da) + + +This function returns the sched cGroup of a task. + +## Definition + +`p->sched_task_group->css.cgroup` represents the cgroup `p` is associated with from the scheduler's POV. SCX operations should use this function to determine `p`'s current cgroup as, unlike following `p->cgroups`, `p->sched_task_group` is protected by `p`'s rq lock and thus atomic w.r.t. all rq-locked operations. Can be called on the parameter tasks of rq-locked operations. The restriction guarantees that `p`'s rq is locked by the caller. + +**Parameters** + +`p`: task of interest + +**Returns** + +The sched cGroup of a task + +**Signature** + + +`#!c struct cgroup *scx_bpf_task_cgroup(struct task_struct *p)` + +!!! 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`](../helper-function/bpf_kptr_xchg.md)). If not, the verifier fails the + loading of the BPF program until no lingering references remain in all possible explored states of the program. + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_task_cpu.md b/docs/linux/kfuncs/scx_bpf_task_cpu.md new file mode 100644 index 0000000..33af905 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_task_cpu.md @@ -0,0 +1,44 @@ +--- +title: "KFunc 'scx_bpf_task_cpu'" +description: "This page documents the 'scx_bpf_task_cpu' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_task_cpu` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This functions returns the CPU a task is currently associated with. + +## Definition + +**Parameters** + +`p`: task of interest + +**Signature** + + +`#!c s32 scx_bpf_task_cpu(const struct task_struct *p)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_task_running.md b/docs/linux/kfuncs/scx_bpf_task_running.md new file mode 100644 index 0000000..dadac94 --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_task_running.md @@ -0,0 +1,44 @@ +--- +title: "KFunc 'scx_bpf_task_running'" +description: "This page documents the 'scx_bpf_task_running' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_task_running` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function checks if a task is currently running? + +## Definition + +**Parameters** + +`p`: task of interest + +**Signature** + + +`#!c bool scx_bpf_task_running(const struct task_struct *p)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/scx_bpf_test_and_clear_cpu_idle.md b/docs/linux/kfuncs/scx_bpf_test_and_clear_cpu_idle.md new file mode 100644 index 0000000..1d3d3ed --- /dev/null +++ b/docs/linux/kfuncs/scx_bpf_test_and_clear_cpu_idle.md @@ -0,0 +1,50 @@ +--- +title: "KFunc 'scx_bpf_test_and_clear_cpu_idle'" +description: "This page documents the 'scx_bpf_test_and_clear_cpu_idle' eBPF kfunc, including its definition, usage, program types that can use it, and examples." +--- +# KFunc `scx_bpf_test_and_clear_cpu_idle` + + +[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) + + +This function tests and clears `cpu`'s idle state. + +## Definition + +Unavailable if `ops.update_idle()` is implemented and `SCX_OPS_KEEP_BUILTIN_IDLE` is not set. + +**Parameters** + +`cpu`: cpu to test and clear idle for + +**Returns** + +`true` if `cpu` was idle and its idle state was successfully cleared. `false` otherwise. + +**Signature** + + +`#!c bool scx_bpf_test_and_clear_cpu_idle(s32 cpu)` + + +## Usage + +!!! example "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_STRUCT_OPS`](../program-type/BPF_PROG_TYPE_STRUCT_OPS.md) +- [`BPF_PROG_TYPE_SYSCALL`](../program-type/BPF_PROG_TYPE_SYSCALL.md) +- [`BPF_PROG_TYPE_TRACING`](../program-type/BPF_PROG_TYPE_TRACING.md) + + +### Example + +!!! example "Docs could be improved" + This part of the docs is incomplete, contributions are very welcome + diff --git a/docs/linux/kfuncs/tcp_cong_avoid_ai.md b/docs/linux/kfuncs/tcp_cong_avoid_ai.md index dd1cfc0..8b09359 100644 --- a/docs/linux/kfuncs/tcp_cong_avoid_ai.md +++ b/docs/linux/kfuncs/tcp_cong_avoid_ai.md @@ -12,6 +12,8 @@ description: "This page documents the 'tcp_cong_avoid_ai' eBPF kfunc, including In theory this is `tp->snd_cwnd += 1 / tp->snd_cwnd` (or alternative w), for every packet that was ACK-ed. +**Signature** + `#!c void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w, u32 acked)` diff --git a/docs/linux/kfuncs/tcp_reno_cong_avoid.md b/docs/linux/kfuncs/tcp_reno_cong_avoid.md index d9dbbed..aaef3bd 100644 --- a/docs/linux/kfuncs/tcp_reno_cong_avoid.md +++ b/docs/linux/kfuncs/tcp_reno_cong_avoid.md @@ -14,6 +14,8 @@ Do new congestion window calculation This is Jacobson's slow start and congestion avoidance. SIGCOMM '88, p. 328. +**Signature** + `#!c void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked)` diff --git a/docs/linux/kfuncs/tcp_reno_ssthresh.md b/docs/linux/kfuncs/tcp_reno_ssthresh.md index 43f276d..cb3ece0 100644 --- a/docs/linux/kfuncs/tcp_reno_ssthresh.md +++ b/docs/linux/kfuncs/tcp_reno_ssthresh.md @@ -14,6 +14,8 @@ Returns slow start threshold Slow start threshold is half the congestion window (min 2) +**Signature** + `#!c u32 tcp_reno_ssthresh(struct sock *sk)` diff --git a/docs/linux/kfuncs/tcp_reno_undo_cwnd.md b/docs/linux/kfuncs/tcp_reno_undo_cwnd.md index a2e5587..ee12233 100644 --- a/docs/linux/kfuncs/tcp_reno_undo_cwnd.md +++ b/docs/linux/kfuncs/tcp_reno_undo_cwnd.md @@ -12,6 +12,8 @@ Return new value of congestion window after loss. ## Definition +**Signature** + `#!c u32 tcp_reno_undo_cwnd(struct sock *sk)` diff --git a/docs/linux/kfuncs/tcp_slow_start.md b/docs/linux/kfuncs/tcp_slow_start.md index 719d4d9..49fde97 100644 --- a/docs/linux/kfuncs/tcp_slow_start.md +++ b/docs/linux/kfuncs/tcp_slow_start.md @@ -14,6 +14,8 @@ Slow start is used when congestion window is no greater than the slow start thre Slow start is used when congestion window is no greater than the slow start threshold. We base on RFC2581 and also handle stretch ACKs properly. We do not implement RFC3465 Appropriate Byte Counting (ABC) per se but something better;) a packet is only considered (s)acked in its entirety to defend the ACK attacks described in the RFC. Slow start processes a stretch ACK of degree N as if N ACKs of degree 1 are received back to back except ABC caps N to 2. Slow start exits when `cwnd` grows over `ssthresh` and returns the leftover ACKs to adjust `cwnd` in congestion avoidance mode. +**Signature** + `#!c u32 tcp_slow_start(struct tcp_sock *tp, u32 acked)` diff --git a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md index 001ee11..044b0a9 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_DEVICE.md @@ -179,5 +179,51 @@ char _license[] SEC("license") = "GPL"; ## KFuncs -There are currently no kfuncs supported for this program type +??? abstract "Supported kfuncs" + - [`bpf_arena_alloc_pages`](../kfuncs/bpf_arena_alloc_pages.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_arena_free_pages`](../kfuncs/bpf_arena_free_pages.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_cast_to_kern_ctx`](../kfuncs/bpf_cast_to_kern_ctx.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_adjust`](../kfuncs/bpf_dynptr_adjust.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_clone`](../kfuncs/bpf_dynptr_clone.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_from_skb`](../kfuncs/bpf_dynptr_from_skb.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_is_null`](../kfuncs/bpf_dynptr_is_null.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_is_rdonly`](../kfuncs/bpf_dynptr_is_rdonly.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_size`](../kfuncs/bpf_dynptr_size.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_slice`](../kfuncs/bpf_dynptr_slice.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_slice_rdwr`](../kfuncs/bpf_dynptr_slice_rdwr.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_destroy`](../kfuncs/bpf_iter_bits_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_new`](../kfuncs/bpf_iter_bits_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_next`](../kfuncs/bpf_iter_bits_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_destroy`](../kfuncs/bpf_iter_css_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_new`](../kfuncs/bpf_iter_css_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_next`](../kfuncs/bpf_iter_css_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_destroy`](../kfuncs/bpf_iter_css_task_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_new`](../kfuncs/bpf_iter_css_task_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_next`](../kfuncs/bpf_iter_css_task_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_destroy`](../kfuncs/bpf_iter_num_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_new`](../kfuncs/bpf_iter_num_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_next`](../kfuncs/bpf_iter_num_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_destroy`](../kfuncs/bpf_iter_task_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_new`](../kfuncs/bpf_iter_task_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_next`](../kfuncs/bpf_iter_task_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_destroy`](../kfuncs/bpf_iter_task_vma_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_new`](../kfuncs/bpf_iter_task_vma_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_next`](../kfuncs/bpf_iter_task_vma_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_preempt_disable`](../kfuncs/bpf_preempt_disable.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_preempt_enable`](../kfuncs/bpf_preempt_enable.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rcu_read_lock`](../kfuncs/bpf_rcu_read_lock.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_sock_addr_set_sun_path`](../kfuncs/bpf_sock_addr_set_sun_path.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_init`](../kfuncs/bpf_wq_init.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_set_callback_impl`](../kfuncs/bpf_wq_set_callback_impl.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_start`](../kfuncs/bpf_wq_start.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - diff --git a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SKB.md b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SKB.md index 6aa91e0..441b7bc 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SKB.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SKB.md @@ -334,6 +334,7 @@ char _license[] SEC("license") = "GPL"; - [`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_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.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) @@ -342,6 +343,7 @@ char _license[] SEC("license") = "GPL"; - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -351,6 +353,9 @@ char _license[] SEC("license") = "GPL"; - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -360,6 +365,8 @@ char _license[] SEC("license") = "GPL"; - [`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_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.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) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCK.md b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCK.md index 766e461..0633d9e 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCK.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCK.md @@ -303,5 +303,51 @@ int sock_release(struct bpf_sock *ctx) ## KFuncs -There are currently no kfuncs supported for this program type +??? abstract "Supported kfuncs" + - [`bpf_arena_alloc_pages`](../kfuncs/bpf_arena_alloc_pages.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_arena_free_pages`](../kfuncs/bpf_arena_free_pages.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_cast_to_kern_ctx`](../kfuncs/bpf_cast_to_kern_ctx.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_adjust`](../kfuncs/bpf_dynptr_adjust.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_clone`](../kfuncs/bpf_dynptr_clone.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_from_skb`](../kfuncs/bpf_dynptr_from_skb.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_is_null`](../kfuncs/bpf_dynptr_is_null.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_is_rdonly`](../kfuncs/bpf_dynptr_is_rdonly.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_size`](../kfuncs/bpf_dynptr_size.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_slice`](../kfuncs/bpf_dynptr_slice.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_slice_rdwr`](../kfuncs/bpf_dynptr_slice_rdwr.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_destroy`](../kfuncs/bpf_iter_bits_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_new`](../kfuncs/bpf_iter_bits_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_next`](../kfuncs/bpf_iter_bits_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_destroy`](../kfuncs/bpf_iter_css_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_new`](../kfuncs/bpf_iter_css_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_next`](../kfuncs/bpf_iter_css_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_destroy`](../kfuncs/bpf_iter_css_task_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_new`](../kfuncs/bpf_iter_css_task_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_next`](../kfuncs/bpf_iter_css_task_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_destroy`](../kfuncs/bpf_iter_num_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_new`](../kfuncs/bpf_iter_num_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_next`](../kfuncs/bpf_iter_num_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_destroy`](../kfuncs/bpf_iter_task_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_new`](../kfuncs/bpf_iter_task_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_next`](../kfuncs/bpf_iter_task_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_destroy`](../kfuncs/bpf_iter_task_vma_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_new`](../kfuncs/bpf_iter_task_vma_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_next`](../kfuncs/bpf_iter_task_vma_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_preempt_disable`](../kfuncs/bpf_preempt_disable.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_preempt_enable`](../kfuncs/bpf_preempt_enable.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rcu_read_lock`](../kfuncs/bpf_rcu_read_lock.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_sock_addr_set_sun_path`](../kfuncs/bpf_sock_addr_set_sun_path.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_init`](../kfuncs/bpf_wq_init.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_set_callback_impl`](../kfuncs/bpf_wq_set_callback_impl.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_start`](../kfuncs/bpf_wq_start.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - diff --git a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md index 83de553..4800918 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCKOPT.md @@ -248,5 +248,51 @@ int setsockopt(struct bpf_sockopt *ctx) ## KFuncs -There are currently no kfuncs supported for this program type +??? abstract "Supported kfuncs" + - [`bpf_arena_alloc_pages`](../kfuncs/bpf_arena_alloc_pages.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_arena_free_pages`](../kfuncs/bpf_arena_free_pages.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_cast_to_kern_ctx`](../kfuncs/bpf_cast_to_kern_ctx.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_adjust`](../kfuncs/bpf_dynptr_adjust.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_clone`](../kfuncs/bpf_dynptr_clone.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_from_skb`](../kfuncs/bpf_dynptr_from_skb.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_is_null`](../kfuncs/bpf_dynptr_is_null.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_is_rdonly`](../kfuncs/bpf_dynptr_is_rdonly.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_size`](../kfuncs/bpf_dynptr_size.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_slice`](../kfuncs/bpf_dynptr_slice.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_slice_rdwr`](../kfuncs/bpf_dynptr_slice_rdwr.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_destroy`](../kfuncs/bpf_iter_bits_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_new`](../kfuncs/bpf_iter_bits_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_next`](../kfuncs/bpf_iter_bits_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_destroy`](../kfuncs/bpf_iter_css_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_new`](../kfuncs/bpf_iter_css_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_next`](../kfuncs/bpf_iter_css_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_destroy`](../kfuncs/bpf_iter_css_task_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_new`](../kfuncs/bpf_iter_css_task_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_next`](../kfuncs/bpf_iter_css_task_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_destroy`](../kfuncs/bpf_iter_num_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_new`](../kfuncs/bpf_iter_num_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_next`](../kfuncs/bpf_iter_num_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_destroy`](../kfuncs/bpf_iter_task_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_new`](../kfuncs/bpf_iter_task_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_next`](../kfuncs/bpf_iter_task_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_destroy`](../kfuncs/bpf_iter_task_vma_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_new`](../kfuncs/bpf_iter_task_vma_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_next`](../kfuncs/bpf_iter_task_vma_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_preempt_disable`](../kfuncs/bpf_preempt_disable.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_preempt_enable`](../kfuncs/bpf_preempt_enable.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rcu_read_lock`](../kfuncs/bpf_rcu_read_lock.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_sock_addr_set_sun_path`](../kfuncs/bpf_sock_addr_set_sun_path.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_init`](../kfuncs/bpf_wq_init.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_set_callback_impl`](../kfuncs/bpf_wq_set_callback_impl.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_start`](../kfuncs/bpf_wq_start.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - diff --git a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md index f8fc261..544011c 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SOCK_ADDR.md @@ -415,42 +415,50 @@ cGroup socket buffer programs are attached to cGroups via the [`BPF_PROG_ATTACH` ??? 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_dynptr_adjust`](../kfuncs/bpf_dynptr_adjust.md) - - [`bpf_dynptr_clone`](../kfuncs/bpf_dynptr_clone.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_sock_addr_set_sun_path`](../kfuncs/bpf_sock_addr_set_sun_path.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) + - [`bpf_arena_alloc_pages`](../kfuncs/bpf_arena_alloc_pages.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_arena_free_pages`](../kfuncs/bpf_arena_free_pages.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_cast_to_kern_ctx`](../kfuncs/bpf_cast_to_kern_ctx.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_dynptr_adjust`](../kfuncs/bpf_dynptr_adjust.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_dynptr_clone`](../kfuncs/bpf_dynptr_clone.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_dynptr_from_skb`](../kfuncs/bpf_dynptr_from_skb.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_dynptr_is_null`](../kfuncs/bpf_dynptr_is_null.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_dynptr_is_rdonly`](../kfuncs/bpf_dynptr_is_rdonly.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_dynptr_size`](../kfuncs/bpf_dynptr_size.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_dynptr_slice`](../kfuncs/bpf_dynptr_slice.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_dynptr_slice_rdwr`](../kfuncs/bpf_dynptr_slice_rdwr.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_bits_destroy`](../kfuncs/bpf_iter_bits_destroy.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_bits_new`](../kfuncs/bpf_iter_bits_new.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_bits_next`](../kfuncs/bpf_iter_bits_next.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_css_destroy`](../kfuncs/bpf_iter_css_destroy.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_css_new`](../kfuncs/bpf_iter_css_new.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_css_next`](../kfuncs/bpf_iter_css_next.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_css_task_destroy`](../kfuncs/bpf_iter_css_task_destroy.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_css_task_new`](../kfuncs/bpf_iter_css_task_new.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_css_task_next`](../kfuncs/bpf_iter_css_task_next.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_next.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_num_destroy`](../kfuncs/bpf_iter_num_destroy.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_num_new`](../kfuncs/bpf_iter_num_new.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_num_next`](../kfuncs/bpf_iter_num_next.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_task_destroy`](../kfuncs/bpf_iter_task_destroy.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_task_new`](../kfuncs/bpf_iter_task_new.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_task_next`](../kfuncs/bpf_iter_task_next.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_task_vma_destroy`](../kfuncs/bpf_iter_task_vma_destroy.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_task_vma_new`](../kfuncs/bpf_iter_task_vma_new.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_iter_task_vma_next`](../kfuncs/bpf_iter_task_vma_next.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_preempt_disable`](../kfuncs/bpf_preempt_disable.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_preempt_enable`](../kfuncs/bpf_preempt_enable.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_rcu_read_lock`](../kfuncs/bpf_rcu_read_lock.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_sock_addr_set_sun_path`](../kfuncs/bpf_sock_addr_set_sun_path.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_wq_init`](../kfuncs/bpf_wq_init.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_wq_set_callback_impl`](../kfuncs/bpf_wq_set_callback_impl.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - + - [`bpf_wq_start`](../kfuncs/bpf_wq_start.md) [:octicons-tag-24: v6.7](https://github.com/torvalds/linux/commit/53e380d21441909b12b6e0782b77187ae4b971c4) - diff --git a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md index bfbf313..e4928de 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_CGROUP_SYSCTL.md @@ -232,5 +232,51 @@ char _license[] SEC("license") = "GPL"; ## KFuncs -There are currently no kfuncs supported for this program type +??? abstract "Supported kfuncs" + - [`bpf_arena_alloc_pages`](../kfuncs/bpf_arena_alloc_pages.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_arena_free_pages`](../kfuncs/bpf_arena_free_pages.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_cast_to_kern_ctx`](../kfuncs/bpf_cast_to_kern_ctx.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_adjust`](../kfuncs/bpf_dynptr_adjust.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_clone`](../kfuncs/bpf_dynptr_clone.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_from_skb`](../kfuncs/bpf_dynptr_from_skb.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_is_null`](../kfuncs/bpf_dynptr_is_null.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_is_rdonly`](../kfuncs/bpf_dynptr_is_rdonly.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_size`](../kfuncs/bpf_dynptr_size.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_slice`](../kfuncs/bpf_dynptr_slice.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_dynptr_slice_rdwr`](../kfuncs/bpf_dynptr_slice_rdwr.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_destroy`](../kfuncs/bpf_iter_bits_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_new`](../kfuncs/bpf_iter_bits_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_bits_next`](../kfuncs/bpf_iter_bits_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_destroy`](../kfuncs/bpf_iter_css_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_new`](../kfuncs/bpf_iter_css_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_next`](../kfuncs/bpf_iter_css_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_destroy`](../kfuncs/bpf_iter_css_task_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_new`](../kfuncs/bpf_iter_css_task_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_css_task_next`](../kfuncs/bpf_iter_css_task_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_destroy`](../kfuncs/bpf_iter_num_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_new`](../kfuncs/bpf_iter_num_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_num_next`](../kfuncs/bpf_iter_num_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_destroy`](../kfuncs/bpf_iter_task_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_new`](../kfuncs/bpf_iter_task_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_next`](../kfuncs/bpf_iter_task_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_destroy`](../kfuncs/bpf_iter_task_vma_destroy.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_new`](../kfuncs/bpf_iter_task_vma_new.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_iter_task_vma_next`](../kfuncs/bpf_iter_task_vma_next.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_preempt_disable`](../kfuncs/bpf_preempt_disable.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_preempt_enable`](../kfuncs/bpf_preempt_enable.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rcu_read_lock`](../kfuncs/bpf_rcu_read_lock.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_sock_addr_set_sun_path`](../kfuncs/bpf_sock_addr_set_sun_path.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_init`](../kfuncs/bpf_wq_init.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_set_callback_impl`](../kfuncs/bpf_wq_set_callback_impl.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - + - [`bpf_wq_start`](../kfuncs/bpf_wq_start.md) [:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/67666479edf1e2b732f4d0ac797885e859a78de4) - diff --git a/docs/linux/program-type/BPF_PROG_TYPE_LSM.md b/docs/linux/program-type/BPF_PROG_TYPE_LSM.md index 62e39b8..1d4f832 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_LSM.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_LSM.md @@ -158,6 +158,7 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_cgroup_ancestor`](../kfuncs/bpf_cgroup_ancestor.md) - [`bpf_cgroup_from_id`](../kfuncs/bpf_cgroup_from_id.md) - [`bpf_cgroup_release`](../kfuncs/bpf_cgroup_release.md) + - [`bpf_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) - [`bpf_cpumask_acquire`](../kfuncs/bpf_cpumask_acquire.md) - [`bpf_cpumask_and`](../kfuncs/bpf_cpumask_and.md) - [`bpf_cpumask_any_and_distribute`](../kfuncs/bpf_cpumask_any_and_distribute.md) @@ -190,8 +191,11 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_dentry_xattr`](../kfuncs/bpf_get_dentry_xattr.md) - [`bpf_get_file_xattr`](../kfuncs/bpf_get_file_xattr.md) - [`bpf_get_fsverity_digest`](../kfuncs/bpf_get_fsverity_digest.md) + - [`bpf_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.md) + - [`bpf_get_task_exe_file`](../kfuncs/bpf_get_task_exe_file.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) @@ -201,6 +205,9 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -214,13 +221,17 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_list_pop_front`](../kfuncs/bpf_list_pop_front.md) - [`bpf_list_push_back_impl`](../kfuncs/bpf_list_push_back_impl.md) - [`bpf_list_push_front_impl`](../kfuncs/bpf_list_push_front_impl.md) + - [`bpf_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.md) - [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md) - [`bpf_obj_drop_impl`](../kfuncs/bpf_obj_drop_impl.md) - [`bpf_obj_new_impl`](../kfuncs/bpf_obj_new_impl.md) + - [`bpf_path_d_path`](../kfuncs/bpf_path_d_path.md) - [`bpf_percpu_obj_drop_impl`](../kfuncs/bpf_percpu_obj_drop_impl.md) - [`bpf_percpu_obj_new_impl`](../kfuncs/bpf_percpu_obj_new_impl.md) - [`bpf_preempt_disable`](../kfuncs/bpf_preempt_disable.md) - [`bpf_preempt_enable`](../kfuncs/bpf_preempt_enable.md) + - [`bpf_put_file`](../kfuncs/bpf_put_file.md) - [`bpf_rbtree_add_impl`](../kfuncs/bpf_rbtree_add_impl.md) - [`bpf_rbtree_first`](../kfuncs/bpf_rbtree_first.md) - [`bpf_rbtree_remove`](../kfuncs/bpf_rbtree_remove.md) @@ -228,8 +239,10 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) - [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md) - [`bpf_refcount_acquire_impl`](../kfuncs/bpf_refcount_acquire_impl.md) + - [`bpf_send_signal_task`](../kfuncs/bpf_send_signal_task.md) - [`bpf_task_acquire`](../kfuncs/bpf_task_acquire.md) - [`bpf_task_from_pid`](../kfuncs/bpf_task_from_pid.md) + - [`bpf_task_from_vpid`](../kfuncs/bpf_task_from_vpid.md) - [`bpf_task_get_cgroup1`](../kfuncs/bpf_task_get_cgroup1.md) - [`bpf_task_release`](../kfuncs/bpf_task_release.md) - [`bpf_task_under_cgroup`](../kfuncs/bpf_task_under_cgroup.md) @@ -240,12 +253,12 @@ Not all helper functions are available in all program types. These are the helpe - [`cgroup_rstat_flush`](../kfuncs/cgroup_rstat_flush.md) - [`cgroup_rstat_updated`](../kfuncs/cgroup_rstat_updated.md) - [`crash_kexec`](../kfuncs/crash_kexec.md) - - [`hid_bpf_allocate_context`](../kfuncs/hid_bpf_allocate_context.md) - - [`hid_bpf_get_data`](../kfuncs/hid_bpf_get_data.md) - - [`hid_bpf_hw_output_report`](../kfuncs/hid_bpf_hw_output_report.md) - - [`hid_bpf_hw_request`](../kfuncs/hid_bpf_hw_request.md) - - [`hid_bpf_input_report`](../kfuncs/hid_bpf_input_report.md) - - [`hid_bpf_release_context`](../kfuncs/hid_bpf_release_context.md) - - [`hid_bpf_try_input_report`](../kfuncs/hid_bpf_try_input_report.md) + - [`hid_bpf_allocate_context`](../kfuncs/hid_bpf_allocate_context.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_get_data`](../kfuncs/hid_bpf_get_data.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_hw_output_report`](../kfuncs/hid_bpf_hw_output_report.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_hw_request`](../kfuncs/hid_bpf_hw_request.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_input_report`](../kfuncs/hid_bpf_input_report.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_release_context`](../kfuncs/hid_bpf_release_context.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_try_input_report`](../kfuncs/hid_bpf_try_input_report.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_LWT_IN.md b/docs/linux/program-type/BPF_PROG_TYPE_LWT_IN.md index bfa0a92..b747c35 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_LWT_IN.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_LWT_IN.md @@ -226,6 +226,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.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) @@ -234,6 +235,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -243,6 +245,9 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -252,6 +257,8 @@ Not all helper functions are available in all program types. These are the helpe - [`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_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.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) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_LWT_OUT.md b/docs/linux/program-type/BPF_PROG_TYPE_LWT_OUT.md index 45e70a6..80efecf 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_LWT_OUT.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_LWT_OUT.md @@ -223,6 +223,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.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) @@ -231,6 +232,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -240,6 +242,9 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -249,6 +254,8 @@ Not all helper functions are available in all program types. These are the helpe - [`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_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.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) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_LWT_XMIT.md b/docs/linux/program-type/BPF_PROG_TYPE_LWT_XMIT.md index 9400100..c48dabe 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_LWT_XMIT.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_LWT_XMIT.md @@ -176,6 +176,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.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) @@ -184,6 +185,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -193,6 +195,9 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -202,6 +207,8 @@ Not all helper functions are available in all program types. These are the helpe - [`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_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.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) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_NETFILTER.md b/docs/linux/program-type/BPF_PROG_TYPE_NETFILTER.md index b3a03b5..00d91e9 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_NETFILTER.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_NETFILTER.md @@ -246,6 +246,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.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) @@ -254,6 +255,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -263,6 +265,9 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -272,6 +277,8 @@ Not all helper functions are available in all program types. These are the helpe - [`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_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.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) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_SCHED_ACT.md b/docs/linux/program-type/BPF_PROG_TYPE_SCHED_ACT.md index 9297182..1e98802 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_SCHED_ACT.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_SCHED_ACT.md @@ -212,6 +212,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.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) @@ -222,6 +223,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -231,6 +233,9 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -240,6 +245,8 @@ Not all helper functions are available in all program types. These are the helpe - [`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_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.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) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_SCHED_CLS.md b/docs/linux/program-type/BPF_PROG_TYPE_SCHED_CLS.md index c3f2513..41d67d7 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_SCHED_CLS.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_SCHED_CLS.md @@ -274,6 +274,7 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_cgroup_ancestor`](../kfuncs/bpf_cgroup_ancestor.md) - [`bpf_cgroup_from_id`](../kfuncs/bpf_cgroup_from_id.md) - [`bpf_cgroup_release`](../kfuncs/bpf_cgroup_release.md) + - [`bpf_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) - [`bpf_crypto_decrypt`](../kfuncs/bpf_crypto_decrypt.md) - [`bpf_crypto_encrypt`](../kfuncs/bpf_crypto_encrypt.md) - [`bpf_ct_change_status`](../kfuncs/bpf_ct_change_status.md) @@ -291,6 +292,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -300,6 +302,9 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -313,6 +318,8 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_list_pop_front`](../kfuncs/bpf_list_pop_front.md) - [`bpf_list_push_back_impl`](../kfuncs/bpf_list_push_back_impl.md) - [`bpf_list_push_front_impl`](../kfuncs/bpf_list_push_front_impl.md) + - [`bpf_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.md) - [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md) - [`bpf_obj_drop_impl`](../kfuncs/bpf_obj_drop_impl.md) - [`bpf_obj_new_impl`](../kfuncs/bpf_obj_new_impl.md) @@ -327,6 +334,7 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) - [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md) - [`bpf_refcount_acquire_impl`](../kfuncs/bpf_refcount_acquire_impl.md) + - [`bpf_send_signal_task`](../kfuncs/bpf_send_signal_task.md) - [`bpf_sk_assign_tcp_reqsk`](../kfuncs/bpf_sk_assign_tcp_reqsk.md) - [`bpf_skb_ct_alloc`](../kfuncs/bpf_skb_ct_alloc.md) - [`bpf_skb_ct_lookup`](../kfuncs/bpf_skb_ct_lookup.md) @@ -336,6 +344,7 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_skb_set_xfrm_info`](../kfuncs/bpf_skb_set_xfrm_info.md) - [`bpf_task_acquire`](../kfuncs/bpf_task_acquire.md) - [`bpf_task_from_pid`](../kfuncs/bpf_task_from_pid.md) + - [`bpf_task_from_vpid`](../kfuncs/bpf_task_from_vpid.md) - [`bpf_task_get_cgroup1`](../kfuncs/bpf_task_get_cgroup1.md) - [`bpf_task_release`](../kfuncs/bpf_task_release.md) - [`bpf_task_under_cgroup`](../kfuncs/bpf_task_under_cgroup.md) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_SK_SKB.md b/docs/linux/program-type/BPF_PROG_TYPE_SK_SKB.md index b784b6e..85c1d69 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_SK_SKB.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_SK_SKB.md @@ -264,6 +264,7 @@ out: - [`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_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.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) @@ -272,6 +273,7 @@ out: - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -281,6 +283,9 @@ out: - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -290,6 +295,8 @@ out: - [`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_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.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) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_SOCKET_FILTER.md b/docs/linux/program-type/BPF_PROG_TYPE_SOCKET_FILTER.md index 981d73a..304299e 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_SOCKET_FILTER.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_SOCKET_FILTER.md @@ -143,6 +143,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.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) @@ -151,6 +152,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -160,6 +162,9 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -169,6 +174,8 @@ Not all helper functions are available in all program types. These are the helpe - [`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_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.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) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_STRUCT_OPS.md b/docs/linux/program-type/BPF_PROG_TYPE_STRUCT_OPS.md index 48ff8b6..2dca2c5 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_STRUCT_OPS.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_STRUCT_OPS.md @@ -364,6 +364,7 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_cgroup_ancestor`](../kfuncs/bpf_cgroup_ancestor.md) - [`bpf_cgroup_from_id`](../kfuncs/bpf_cgroup_from_id.md) - [`bpf_cgroup_release`](../kfuncs/bpf_cgroup_release.md) + - [`bpf_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) - [`bpf_cpumask_acquire`](../kfuncs/bpf_cpumask_acquire.md) - [`bpf_cpumask_and`](../kfuncs/bpf_cpumask_and.md) - [`bpf_cpumask_any_and_distribute`](../kfuncs/bpf_cpumask_any_and_distribute.md) @@ -396,6 +397,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -405,9 +407,15 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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_scx_dsq_destroy`](../kfuncs/bpf_iter_scx_dsq_destroy.md) + - [`bpf_iter_scx_dsq_new`](../kfuncs/bpf_iter_scx_dsq_new.md) + - [`bpf_iter_scx_dsq_next`](../kfuncs/bpf_iter_scx_dsq_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) @@ -418,6 +426,8 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_list_pop_front`](../kfuncs/bpf_list_pop_front.md) - [`bpf_list_push_back_impl`](../kfuncs/bpf_list_push_back_impl.md) - [`bpf_list_push_front_impl`](../kfuncs/bpf_list_push_front_impl.md) + - [`bpf_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.md) - [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md) - [`bpf_obj_drop_impl`](../kfuncs/bpf_obj_drop_impl.md) - [`bpf_obj_new_impl`](../kfuncs/bpf_obj_new_impl.md) @@ -432,8 +442,10 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) - [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md) - [`bpf_refcount_acquire_impl`](../kfuncs/bpf_refcount_acquire_impl.md) + - [`bpf_send_signal_task`](../kfuncs/bpf_send_signal_task.md) - [`bpf_task_acquire`](../kfuncs/bpf_task_acquire.md) - [`bpf_task_from_pid`](../kfuncs/bpf_task_from_pid.md) + - [`bpf_task_from_vpid`](../kfuncs/bpf_task_from_vpid.md) - [`bpf_task_get_cgroup1`](../kfuncs/bpf_task_get_cgroup1.md) - [`bpf_task_release`](../kfuncs/bpf_task_release.md) - [`bpf_task_under_cgroup`](../kfuncs/bpf_task_under_cgroup.md) @@ -454,13 +466,56 @@ Not all helper functions are available in all program types. These are the helpe - [`dctcp_ssthresh`](../kfuncs/dctcp_ssthresh.md) - [`dctcp_state`](../kfuncs/dctcp_state.md) - [`dctcp_update_alpha`](../kfuncs/dctcp_update_alpha.md) - - [`hid_bpf_allocate_context`](../kfuncs/hid_bpf_allocate_context.md) - - [`hid_bpf_get_data`](../kfuncs/hid_bpf_get_data.md) - - [`hid_bpf_hw_output_report`](../kfuncs/hid_bpf_hw_output_report.md) - - [`hid_bpf_hw_request`](../kfuncs/hid_bpf_hw_request.md) - - [`hid_bpf_input_report`](../kfuncs/hid_bpf_input_report.md) - - [`hid_bpf_release_context`](../kfuncs/hid_bpf_release_context.md) - - [`hid_bpf_try_input_report`](../kfuncs/hid_bpf_try_input_report.md) + - [`hid_bpf_allocate_context`](../kfuncs/hid_bpf_allocate_context.md) [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) - + - [`hid_bpf_get_data`](../kfuncs/hid_bpf_get_data.md) [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) - + - [`hid_bpf_hw_output_report`](../kfuncs/hid_bpf_hw_output_report.md) [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) - + - [`hid_bpf_hw_request`](../kfuncs/hid_bpf_hw_request.md) [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) - + - [`hid_bpf_input_report`](../kfuncs/hid_bpf_input_report.md) [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) - + - [`hid_bpf_release_context`](../kfuncs/hid_bpf_release_context.md) [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) - + - [`hid_bpf_try_input_report`](../kfuncs/hid_bpf_try_input_report.md) [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) - + - [`scx_bpf_consume`](../kfuncs/scx_bpf_consume.md) + - [`scx_bpf_cpu_rq`](../kfuncs/scx_bpf_cpu_rq.md) + - [`scx_bpf_cpuperf_cap`](../kfuncs/scx_bpf_cpuperf_cap.md) + - [`scx_bpf_cpuperf_cur`](../kfuncs/scx_bpf_cpuperf_cur.md) + - [`scx_bpf_cpuperf_set`](../kfuncs/scx_bpf_cpuperf_set.md) + - [`scx_bpf_create_dsq`](../kfuncs/scx_bpf_create_dsq.md) + - [`scx_bpf_destroy_dsq`](../kfuncs/scx_bpf_destroy_dsq.md) + - [`scx_bpf_dispatch`](../kfuncs/scx_bpf_dispatch.md) + - [`scx_bpf_dispatch_cancel`](../kfuncs/scx_bpf_dispatch_cancel.md) + - [`scx_bpf_dispatch_from_dsq`](../kfuncs/scx_bpf_dispatch_from_dsq.md) + - [`scx_bpf_dispatch_from_dsq_set_slice`](../kfuncs/scx_bpf_dispatch_from_dsq_set_slice.md) + - [`scx_bpf_dispatch_from_dsq_set_vtime`](../kfuncs/scx_bpf_dispatch_from_dsq_set_vtime.md) + - [`scx_bpf_dispatch_nr_slots`](../kfuncs/scx_bpf_dispatch_nr_slots.md) + - [`scx_bpf_dispatch_vtime`](../kfuncs/scx_bpf_dispatch_vtime.md) + - [`scx_bpf_dispatch_vtime_from_dsq`](../kfuncs/scx_bpf_dispatch_vtime_from_dsq.md) + - [`scx_bpf_dsq_insert`](../kfuncs/scx_bpf_dsq_insert.md) + - [`scx_bpf_dsq_insert_vtime`](../kfuncs/scx_bpf_dsq_insert_vtime.md) + - [`scx_bpf_dsq_move`](../kfuncs/scx_bpf_dsq_move.md) + - [`scx_bpf_dsq_move_set_slice`](../kfuncs/scx_bpf_dsq_move_set_slice.md) + - [`scx_bpf_dsq_move_set_vtime`](../kfuncs/scx_bpf_dsq_move_set_vtime.md) + - [`scx_bpf_dsq_move_to_local`](../kfuncs/scx_bpf_dsq_move_to_local.md) + - [`scx_bpf_dsq_move_vtime`](../kfuncs/scx_bpf_dsq_move_vtime.md) + - [`scx_bpf_dsq_nr_queued`](../kfuncs/scx_bpf_dsq_nr_queued.md) + - [`scx_bpf_dump_bstr`](../kfuncs/scx_bpf_dump_bstr.md) + - [`scx_bpf_error_bstr`](../kfuncs/scx_bpf_error_bstr.md) + - [`scx_bpf_exit_bstr`](../kfuncs/scx_bpf_exit_bstr.md) + - [`scx_bpf_get_idle_cpumask`](../kfuncs/scx_bpf_get_idle_cpumask.md) + - [`scx_bpf_get_idle_smtmask`](../kfuncs/scx_bpf_get_idle_smtmask.md) + - [`scx_bpf_get_online_cpumask`](../kfuncs/scx_bpf_get_online_cpumask.md) + - [`scx_bpf_get_possible_cpumask`](../kfuncs/scx_bpf_get_possible_cpumask.md) + - [`scx_bpf_kick_cpu`](../kfuncs/scx_bpf_kick_cpu.md) + - [`scx_bpf_now`](../kfuncs/scx_bpf_now.md) + - [`scx_bpf_nr_cpu_ids`](../kfuncs/scx_bpf_nr_cpu_ids.md) + - [`scx_bpf_pick_any_cpu`](../kfuncs/scx_bpf_pick_any_cpu.md) + - [`scx_bpf_pick_idle_cpu`](../kfuncs/scx_bpf_pick_idle_cpu.md) + - [`scx_bpf_put_cpumask`](../kfuncs/scx_bpf_put_cpumask.md) + - [`scx_bpf_put_idle_cpumask`](../kfuncs/scx_bpf_put_idle_cpumask.md) + - [`scx_bpf_reenqueue_local`](../kfuncs/scx_bpf_reenqueue_local.md) + - [`scx_bpf_select_cpu_dfl`](../kfuncs/scx_bpf_select_cpu_dfl.md) + - [`scx_bpf_task_cgroup`](../kfuncs/scx_bpf_task_cgroup.md) + - [`scx_bpf_task_cpu`](../kfuncs/scx_bpf_task_cpu.md) + - [`scx_bpf_task_running`](../kfuncs/scx_bpf_task_running.md) + - [`scx_bpf_test_and_clear_cpu_idle`](../kfuncs/scx_bpf_test_and_clear_cpu_idle.md) - [`tcp_cong_avoid_ai`](../kfuncs/tcp_cong_avoid_ai.md) - [`tcp_reno_cong_avoid`](../kfuncs/tcp_reno_cong_avoid.md) - [`tcp_reno_ssthresh`](../kfuncs/tcp_reno_ssthresh.md) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_SYSCALL.md b/docs/linux/program-type/BPF_PROG_TYPE_SYSCALL.md index 1733b92..ef55491 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_SYSCALL.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_SYSCALL.md @@ -158,6 +158,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) - [`bpf_crypto_ctx_acquire`](../kfuncs/bpf_crypto_ctx_acquire.md) - [`bpf_crypto_ctx_create`](../kfuncs/bpf_crypto_ctx_create.md) - [`bpf_crypto_ctx_release`](../kfuncs/bpf_crypto_ctx_release.md) @@ -168,6 +169,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -177,15 +179,23 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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_scx_dsq_destroy`](../kfuncs/bpf_iter_scx_dsq_destroy.md) + - [`bpf_iter_scx_dsq_new`](../kfuncs/bpf_iter_scx_dsq_new.md) + - [`bpf_iter_scx_dsq_next`](../kfuncs/bpf_iter_scx_dsq_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_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.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) @@ -196,9 +206,41 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_wq_set_callback_impl`](../kfuncs/bpf_wq_set_callback_impl.md) - [`bpf_wq_start`](../kfuncs/bpf_wq_start.md) - [`hid_bpf_allocate_context`](../kfuncs/hid_bpf_allocate_context.md) - - [`hid_bpf_attach_prog`](../kfuncs/hid_bpf_attach_prog.md) - [`hid_bpf_hw_output_report`](../kfuncs/hid_bpf_hw_output_report.md) - [`hid_bpf_hw_request`](../kfuncs/hid_bpf_hw_request.md) - [`hid_bpf_input_report`](../kfuncs/hid_bpf_input_report.md) - [`hid_bpf_release_context`](../kfuncs/hid_bpf_release_context.md) + - [`scx_bpf_cpu_rq`](../kfuncs/scx_bpf_cpu_rq.md) + - [`scx_bpf_cpuperf_cap`](../kfuncs/scx_bpf_cpuperf_cap.md) + - [`scx_bpf_cpuperf_cur`](../kfuncs/scx_bpf_cpuperf_cur.md) + - [`scx_bpf_cpuperf_set`](../kfuncs/scx_bpf_cpuperf_set.md) + - [`scx_bpf_create_dsq`](../kfuncs/scx_bpf_create_dsq.md) + - [`scx_bpf_destroy_dsq`](../kfuncs/scx_bpf_destroy_dsq.md) + - [`scx_bpf_dispatch_from_dsq`](../kfuncs/scx_bpf_dispatch_from_dsq.md) + - [`scx_bpf_dispatch_from_dsq_set_slice`](../kfuncs/scx_bpf_dispatch_from_dsq_set_slice.md) + - [`scx_bpf_dispatch_from_dsq_set_vtime`](../kfuncs/scx_bpf_dispatch_from_dsq_set_vtime.md) + - [`scx_bpf_dispatch_vtime_from_dsq`](../kfuncs/scx_bpf_dispatch_vtime_from_dsq.md) + - [`scx_bpf_dsq_move`](../kfuncs/scx_bpf_dsq_move.md) + - [`scx_bpf_dsq_move_set_slice`](../kfuncs/scx_bpf_dsq_move_set_slice.md) + - [`scx_bpf_dsq_move_set_vtime`](../kfuncs/scx_bpf_dsq_move_set_vtime.md) + - [`scx_bpf_dsq_move_vtime`](../kfuncs/scx_bpf_dsq_move_vtime.md) + - [`scx_bpf_dsq_nr_queued`](../kfuncs/scx_bpf_dsq_nr_queued.md) + - [`scx_bpf_dump_bstr`](../kfuncs/scx_bpf_dump_bstr.md) + - [`scx_bpf_error_bstr`](../kfuncs/scx_bpf_error_bstr.md) + - [`scx_bpf_exit_bstr`](../kfuncs/scx_bpf_exit_bstr.md) + - [`scx_bpf_get_idle_cpumask`](../kfuncs/scx_bpf_get_idle_cpumask.md) + - [`scx_bpf_get_idle_smtmask`](../kfuncs/scx_bpf_get_idle_smtmask.md) + - [`scx_bpf_get_online_cpumask`](../kfuncs/scx_bpf_get_online_cpumask.md) + - [`scx_bpf_get_possible_cpumask`](../kfuncs/scx_bpf_get_possible_cpumask.md) + - [`scx_bpf_kick_cpu`](../kfuncs/scx_bpf_kick_cpu.md) + - [`scx_bpf_now`](../kfuncs/scx_bpf_now.md) + - [`scx_bpf_nr_cpu_ids`](../kfuncs/scx_bpf_nr_cpu_ids.md) + - [`scx_bpf_pick_any_cpu`](../kfuncs/scx_bpf_pick_any_cpu.md) + - [`scx_bpf_pick_idle_cpu`](../kfuncs/scx_bpf_pick_idle_cpu.md) + - [`scx_bpf_put_cpumask`](../kfuncs/scx_bpf_put_cpumask.md) + - [`scx_bpf_put_idle_cpumask`](../kfuncs/scx_bpf_put_idle_cpumask.md) + - [`scx_bpf_task_cgroup`](../kfuncs/scx_bpf_task_cgroup.md) + - [`scx_bpf_task_cpu`](../kfuncs/scx_bpf_task_cpu.md) + - [`scx_bpf_task_running`](../kfuncs/scx_bpf_task_running.md) + - [`scx_bpf_test_and_clear_cpu_idle`](../kfuncs/scx_bpf_test_and_clear_cpu_idle.md) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_TRACING.md b/docs/linux/program-type/BPF_PROG_TYPE_TRACING.md index c82d23b..9bf089e 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_TRACING.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_TRACING.md @@ -467,6 +467,7 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_cgroup_ancestor`](../kfuncs/bpf_cgroup_ancestor.md) - [`bpf_cgroup_from_id`](../kfuncs/bpf_cgroup_from_id.md) - [`bpf_cgroup_release`](../kfuncs/bpf_cgroup_release.md) + - [`bpf_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) - [`bpf_cpumask_acquire`](../kfuncs/bpf_cpumask_acquire.md) - [`bpf_cpumask_and`](../kfuncs/bpf_cpumask_and.md) - [`bpf_cpumask_any_and_distribute`](../kfuncs/bpf_cpumask_any_and_distribute.md) @@ -494,11 +495,13 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_cpumask_xor`](../kfuncs/bpf_cpumask_xor.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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -508,9 +511,15 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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_scx_dsq_destroy`](../kfuncs/bpf_iter_scx_dsq_destroy.md) + - [`bpf_iter_scx_dsq_new`](../kfuncs/bpf_iter_scx_dsq_new.md) + - [`bpf_iter_scx_dsq_next`](../kfuncs/bpf_iter_scx_dsq_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) @@ -522,6 +531,8 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_list_pop_front`](../kfuncs/bpf_list_pop_front.md) - [`bpf_list_push_back_impl`](../kfuncs/bpf_list_push_back_impl.md) - [`bpf_list_push_front_impl`](../kfuncs/bpf_list_push_front_impl.md) + - [`bpf_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.md) - [`bpf_lookup_system_key`](../kfuncs/bpf_lookup_system_key.md) - [`bpf_lookup_user_key`](../kfuncs/bpf_lookup_user_key.md) - [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md) @@ -538,9 +549,11 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) - [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md) - [`bpf_refcount_acquire_impl`](../kfuncs/bpf_refcount_acquire_impl.md) + - [`bpf_send_signal_task`](../kfuncs/bpf_send_signal_task.md) - [`bpf_sock_destroy`](../kfuncs/bpf_sock_destroy.md) - [`bpf_task_acquire`](../kfuncs/bpf_task_acquire.md) - [`bpf_task_from_pid`](../kfuncs/bpf_task_from_pid.md) + - [`bpf_task_from_vpid`](../kfuncs/bpf_task_from_vpid.md) - [`bpf_task_get_cgroup1`](../kfuncs/bpf_task_get_cgroup1.md) - [`bpf_task_release`](../kfuncs/bpf_task_release.md) - [`bpf_task_under_cgroup`](../kfuncs/bpf_task_under_cgroup.md) @@ -552,11 +565,35 @@ Not all helper functions are available in all program types. These are the helpe - [`cgroup_rstat_flush`](../kfuncs/cgroup_rstat_flush.md) - [`cgroup_rstat_updated`](../kfuncs/cgroup_rstat_updated.md) - [`crash_kexec`](../kfuncs/crash_kexec.md) - - [`hid_bpf_allocate_context`](../kfuncs/hid_bpf_allocate_context.md) - - [`hid_bpf_get_data`](../kfuncs/hid_bpf_get_data.md) - - [`hid_bpf_hw_output_report`](../kfuncs/hid_bpf_hw_output_report.md) - - [`hid_bpf_hw_request`](../kfuncs/hid_bpf_hw_request.md) - - [`hid_bpf_input_report`](../kfuncs/hid_bpf_input_report.md) - - [`hid_bpf_release_context`](../kfuncs/hid_bpf_release_context.md) - - [`hid_bpf_try_input_report`](../kfuncs/hid_bpf_try_input_report.md) + - [`hid_bpf_allocate_context`](../kfuncs/hid_bpf_allocate_context.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_get_data`](../kfuncs/hid_bpf_get_data.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_hw_output_report`](../kfuncs/hid_bpf_hw_output_report.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_hw_request`](../kfuncs/hid_bpf_hw_request.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_input_report`](../kfuncs/hid_bpf_input_report.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_release_context`](../kfuncs/hid_bpf_release_context.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`hid_bpf_try_input_report`](../kfuncs/hid_bpf_try_input_report.md) - [:octicons-tag-24: v6.11](https://github.com/torvalds/linux/commit/ebc0d8093e8c97de459615438edefad1a4ac352c) + - [`scx_bpf_cpu_rq`](../kfuncs/scx_bpf_cpu_rq.md) + - [`scx_bpf_cpuperf_cap`](../kfuncs/scx_bpf_cpuperf_cap.md) + - [`scx_bpf_cpuperf_cur`](../kfuncs/scx_bpf_cpuperf_cur.md) + - [`scx_bpf_cpuperf_set`](../kfuncs/scx_bpf_cpuperf_set.md) + - [`scx_bpf_destroy_dsq`](../kfuncs/scx_bpf_destroy_dsq.md) + - [`scx_bpf_dsq_nr_queued`](../kfuncs/scx_bpf_dsq_nr_queued.md) + - [`scx_bpf_dump_bstr`](../kfuncs/scx_bpf_dump_bstr.md) + - [`scx_bpf_error_bstr`](../kfuncs/scx_bpf_error_bstr.md) + - [`scx_bpf_exit_bstr`](../kfuncs/scx_bpf_exit_bstr.md) + - [`scx_bpf_get_idle_cpumask`](../kfuncs/scx_bpf_get_idle_cpumask.md) + - [`scx_bpf_get_idle_smtmask`](../kfuncs/scx_bpf_get_idle_smtmask.md) + - [`scx_bpf_get_online_cpumask`](../kfuncs/scx_bpf_get_online_cpumask.md) + - [`scx_bpf_get_possible_cpumask`](../kfuncs/scx_bpf_get_possible_cpumask.md) + - [`scx_bpf_kick_cpu`](../kfuncs/scx_bpf_kick_cpu.md) + - [`scx_bpf_now`](../kfuncs/scx_bpf_now.md) + - [`scx_bpf_nr_cpu_ids`](../kfuncs/scx_bpf_nr_cpu_ids.md) + - [`scx_bpf_pick_any_cpu`](../kfuncs/scx_bpf_pick_any_cpu.md) + - [`scx_bpf_pick_idle_cpu`](../kfuncs/scx_bpf_pick_idle_cpu.md) + - [`scx_bpf_put_cpumask`](../kfuncs/scx_bpf_put_cpumask.md) + - [`scx_bpf_put_idle_cpumask`](../kfuncs/scx_bpf_put_idle_cpumask.md) + - [`scx_bpf_task_cgroup`](../kfuncs/scx_bpf_task_cgroup.md) + - [`scx_bpf_task_cpu`](../kfuncs/scx_bpf_task_cpu.md) + - [`scx_bpf_task_running`](../kfuncs/scx_bpf_task_running.md) + - [`scx_bpf_test_and_clear_cpu_idle`](../kfuncs/scx_bpf_test_and_clear_cpu_idle.md) diff --git a/docs/linux/program-type/BPF_PROG_TYPE_XDP.md b/docs/linux/program-type/BPF_PROG_TYPE_XDP.md index c38fe23..f6bce82 100644 --- a/docs/linux/program-type/BPF_PROG_TYPE_XDP.md +++ b/docs/linux/program-type/BPF_PROG_TYPE_XDP.md @@ -424,6 +424,7 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_cgroup_ancestor`](../kfuncs/bpf_cgroup_ancestor.md) - [`bpf_cgroup_from_id`](../kfuncs/bpf_cgroup_from_id.md) - [`bpf_cgroup_release`](../kfuncs/bpf_cgroup_release.md) + - [`bpf_copy_from_user_str`](../kfuncs/bpf_copy_from_user_str.md) - [`bpf_crypto_decrypt`](../kfuncs/bpf_crypto_decrypt.md) - [`bpf_crypto_encrypt`](../kfuncs/bpf_crypto_encrypt.md) - [`bpf_ct_change_status`](../kfuncs/bpf_ct_change_status.md) @@ -441,6 +442,7 @@ Not all helper functions are available in all program types. These are the helpe - [`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_get_kmem_cache`](../kfuncs/bpf_get_kmem_cache.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) @@ -450,6 +452,9 @@ Not all helper functions are available in all program types. These are the helpe - [`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_kmem_cache_destroy`](../kfuncs/bpf_iter_kmem_cache_destroy.md) + - [`bpf_iter_kmem_cache_new`](../kfuncs/bpf_iter_kmem_cache_new.md) + - [`bpf_iter_kmem_cache_next`](../kfuncs/bpf_iter_kmem_cache_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) @@ -463,6 +468,8 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_list_pop_front`](../kfuncs/bpf_list_pop_front.md) - [`bpf_list_push_back_impl`](../kfuncs/bpf_list_push_back_impl.md) - [`bpf_list_push_front_impl`](../kfuncs/bpf_list_push_front_impl.md) + - [`bpf_local_irq_restore`](../kfuncs/bpf_local_irq_restore.md) + - [`bpf_local_irq_save`](../kfuncs/bpf_local_irq_save.md) - [`bpf_map_sum_elem_count`](../kfuncs/bpf_map_sum_elem_count.md) - [`bpf_obj_drop_impl`](../kfuncs/bpf_obj_drop_impl.md) - [`bpf_obj_new_impl`](../kfuncs/bpf_obj_new_impl.md) @@ -477,10 +484,12 @@ Not all helper functions are available in all program types. These are the helpe - [`bpf_rcu_read_unlock`](../kfuncs/bpf_rcu_read_unlock.md) - [`bpf_rdonly_cast`](../kfuncs/bpf_rdonly_cast.md) - [`bpf_refcount_acquire_impl`](../kfuncs/bpf_refcount_acquire_impl.md) + - [`bpf_send_signal_task`](../kfuncs/bpf_send_signal_task.md) - [`bpf_skb_ct_alloc`](../kfuncs/bpf_skb_ct_alloc.md) - [`bpf_skb_ct_lookup`](../kfuncs/bpf_skb_ct_lookup.md) - [`bpf_task_acquire`](../kfuncs/bpf_task_acquire.md) - [`bpf_task_from_pid`](../kfuncs/bpf_task_from_pid.md) + - [`bpf_task_from_vpid`](../kfuncs/bpf_task_from_vpid.md) - [`bpf_task_get_cgroup1`](../kfuncs/bpf_task_get_cgroup1.md) - [`bpf_task_release`](../kfuncs/bpf_task_release.md) - [`bpf_task_under_cgroup`](../kfuncs/bpf_task_under_cgroup.md) diff --git a/docs/linux/timeline/index.md b/docs/linux/timeline/index.md index d3782ef..512a455 100644 --- a/docs/linux/timeline/index.md +++ b/docs/linux/timeline/index.md @@ -853,3 +853,79 @@ hide: toc * `bpf_xdp_flow_lookup` [391bb65](https://github.com/torvalds/linux/commit/391bb6594fd3a567efb1cd3efc8136c78c4c9e31) (kfuncs) * `hid_bpf_try_input_report` [9acbb7b](https://github.com/torvalds/linux/commit/9acbb7ba4589d4715141d4e14230a828ddc95f3d) (kfuncs) * `bpf_sk_assign_tcp_reqsk` [e472f88](https://github.com/torvalds/linux/commit/e472f88891abbc535a5e16a68a104073985f6061) (kfuncs) + +## :octicons-tag-24: v6.12 + +* `bpf_copy_from_user_str` [65ab5ac](https://github.com/torvalds/linux/commit/65ab5ac4df012388481d0414fcac1d5ac1721fb3) (kfuncs) +* `scx_bpf_select_cpu_dfl` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_dispatch` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_dispatch_vtime` [06e51be](https://github.com/torvalds/linux/commit/06e51be3d5e7a07aea5c9012773df8d5de01db6c) (kfuncs) +* `scx_bpf_dispatch_nr_slots` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_dispatch_cancel` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_consume` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_dispatch_from_dsq_set_slice` [4c30f5c](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) (kfuncs) +* `scx_bpf_dispatch_from_dsq_set_vtime` [4c30f5c](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) (kfuncs) +* `scx_bpf_dispatch_from_dsq` [4c30f5c](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) (kfuncs) +* `scx_bpf_dispatch_vtime_from_dsq` [4c30f5c](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) (kfuncs) +* `scx_bpf_reenqueue_local` [245254f](https://github.com/torvalds/linux/commit/245254f7081dbe1c8da54675d0e4ddbe74cee61b) (kfuncs) +* `scx_bpf_dispatch_from_dsq_set_slice` [4c30f5c](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) (kfuncs) +* `scx_bpf_dispatch_from_dsq_set_vtime` [4c30f5c](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) (kfuncs) +* `scx_bpf_create_dsq` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_dispatch_from_dsq` [4c30f5c](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) (kfuncs) +* `scx_bpf_dispatch_vtime_from_dsq` [4c30f5c](https://github.com/torvalds/linux/commit/4c30f5ce4f7af4f639af99e0bdeada8b268b7361) (kfuncs) +* `scx_bpf_kick_cpu` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_dsq_nr_queued` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_destroy_dsq` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `bpf_iter_scx_dsq_new` [650ba21](https://github.com/torvalds/linux/commit/650ba21b131ed1f8ee57826b2c6295a3be221132) (kfuncs) +* `bpf_iter_scx_dsq_next` [650ba21](https://github.com/torvalds/linux/commit/650ba21b131ed1f8ee57826b2c6295a3be221132) (kfuncs) +* `bpf_iter_scx_dsq_destroy` [650ba21](https://github.com/torvalds/linux/commit/650ba21b131ed1f8ee57826b2c6295a3be221132) (kfuncs) +* `scx_bpf_exit_bstr` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_error_bstr` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_dump_bstr` [07814a9](https://github.com/torvalds/linux/commit/07814a9439a3b03d79a1001614b5bc1cab69bcec) (kfuncs) +* `scx_bpf_cpuperf_cap` [d86adb4](https://github.com/torvalds/linux/commit/d86adb4fc0655a0867da811d000df75d2a325ef6) (kfuncs) +* `scx_bpf_cpuperf_cur` [d86adb4](https://github.com/torvalds/linux/commit/d86adb4fc0655a0867da811d000df75d2a325ef6) (kfuncs) +* `scx_bpf_cpuperf_set` [d86adb4](https://github.com/torvalds/linux/commit/d86adb4fc0655a0867da811d000df75d2a325ef6) (kfuncs) +* `scx_bpf_nr_cpu_ids` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_get_possible_cpumask` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_get_online_cpumask` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_put_cpumask` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_get_idle_cpumask` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_get_idle_smtmask` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_put_idle_cpumask` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_test_and_clear_cpu_idle` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_pick_idle_cpu` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_pick_any_cpu` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_task_running` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_task_cpu` [f0e1a06](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f) (kfuncs) +* `scx_bpf_cpu_rq` [6203ef7](https://github.com/torvalds/linux/commit/6203ef73fa5c0358f7960b038628259be1448724) (kfuncs) +* `scx_bpf_task_cgroup` [8195136](https://github.com/torvalds/linux/commit/8195136669661fdfe54e9a8923c33b31c92fc1da) (kfuncs) +* `bpf_get_task_exe_file` [d08e204](https://github.com/torvalds/linux/commit/d08e2045ebf0f5f2a97ad22cc7dae398b35354ba) (kfuncs) +* `bpf_put_file` [d08e204](https://github.com/torvalds/linux/commit/d08e2045ebf0f5f2a97ad22cc7dae398b35354ba) (kfuncs) +* `bpf_path_d_path` [d08e204](https://github.com/torvalds/linux/commit/d08e2045ebf0f5f2a97ad22cc7dae398b35354ba) (kfuncs) +* `bpf_get_dentry_xattr` [ac13a42](https://github.com/torvalds/linux/commit/ac13a4261afe81ca423eddd8e6571078fe2a7cea) (kfuncs) + +## :octicons-tag-24: v6.13 + +* `bpf_task_from_vpid` [675c359](https://github.com/torvalds/linux/commit/675c3596ff32c040d1dd2e28dd57e83e634b9f60) (kfuncs) +* `bpf_send_signal_task` [6280cf7](https://github.com/torvalds/linux/commit/6280cf718db0c557b5fe44e2d2e8ad8e832696a7) (kfuncs) +* `bpf_get_kmem_cache` [a992d7a](https://github.com/torvalds/linux/commit/a992d7a3979120fbd7c13435d27b3da8d9ed095a) (kfuncs) +* `bpf_iter_kmem_cache_new` [2e9a548](https://github.com/torvalds/linux/commit/2e9a548009c2d804e55cdd5b0e9903756cf7d9b3) (kfuncs) +* `bpf_iter_kmem_cache_next` [2e9a548](https://github.com/torvalds/linux/commit/2e9a548009c2d804e55cdd5b0e9903756cf7d9b3) (kfuncs) +* `bpf_iter_kmem_cache_destroy` [2e9a548](https://github.com/torvalds/linux/commit/2e9a548009c2d804e55cdd5b0e9903756cf7d9b3) (kfuncs) +* `scx_bpf_dsq_insert` [cc26abb](https://github.com/torvalds/linux/commit/cc26abb1a19adbb91b79d25a2e74976633ece429) (kfuncs) +* `scx_bpf_dsq_insert_vtime` [cc26abb](https://github.com/torvalds/linux/commit/cc26abb1a19adbb91b79d25a2e74976633ece429) (kfuncs) +* `scx_bpf_dsq_move_to_local` [5209c03](https://github.com/torvalds/linux/commit/5209c03c8ed215357a4827496a71fd32167d83ef) (kfuncs) +* `scx_bpf_dsq_move_set_slice` [5cbb302](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) (kfuncs) +* `scx_bpf_dsq_move_set_vtime` [5cbb302](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) (kfuncs) +* `scx_bpf_dsq_move` [5cbb302](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) (kfuncs) +* `scx_bpf_dsq_move_vtime` [5cbb302](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) (kfuncs) +* `scx_bpf_dsq_move_set_slice` [5cbb302](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) (kfuncs) +* `scx_bpf_dsq_move_set_vtime` [5cbb302](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) (kfuncs) +* `scx_bpf_dsq_move` [5cbb302](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) (kfuncs) +* `scx_bpf_dsq_move_vtime` [5cbb302](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11) (kfuncs) + +## :octicons-tag-24: v6.14 + +* `bpf_local_irq_save` [c8e2ee1](https://github.com/torvalds/linux/commit/c8e2ee1f3df05dc4caa746c062c6b5791c745c79) (kfuncs) +* `bpf_local_irq_restore` [c8e2ee1](https://github.com/torvalds/linux/commit/c8e2ee1f3df05dc4caa746c062c6b5791c745c79) (kfuncs) +* `scx_bpf_now` [3a9910b](https://github.com/torvalds/linux/commit/3a9910b5904d29c566e3ff9290990b519827ba75) (kfuncs) diff --git a/tools/kfunc-gen/main.go b/tools/kfunc-gen/main.go index a84a9b5..e49edd6 100644 --- a/tools/kfunc-gen/main.go +++ b/tools/kfunc-gen/main.go @@ -6,7 +6,6 @@ import ( "io" "os" "slices" - "sort" "strings" "github.com/cilium/ebpf/btf" @@ -20,8 +19,19 @@ type kfuncs struct { } type idSet struct { - Funcs []kfunc `yaml:"funcs"` - ProgramTypes []string `yaml:"program_types"` + Funcs []kfunc `yaml:"funcs"` + ProgramTypes []programType `yaml:"program_types"` +} + +type programType struct { + Name string `yaml:"name"` + Since *sinceUntil `yaml:"since"` + Until *sinceUntil `yaml:"until"` +} + +type sinceUntil struct { + Version string `yaml:"version"` + Commit string `yaml:"commit"` } type kfunc struct { @@ -30,7 +40,9 @@ type kfunc struct { } const ( - kfuncDefStart = `` + kfuncDefStart = `**Signature** + +` kfuncDefEnd = `` kfuncProgRefStart = `` kfuncProgRefEnd = `` @@ -120,159 +132,199 @@ func main() { os.Exit(1) } + type mergedKfunc struct { + kfunc + progTypes []programType + } + merged := make(map[string]mergedKfunc) for _, set := range kfuncsConfig.Sets { for _, kfunc := range set.Funcs { if slices.Contains(removeKfuncs, kfunc.Name) { continue } - file, err := os.OpenFile(*projectroot+"/docs/linux/kfuncs/"+kfunc.Name+".md", os.O_RDWR, 0644) - if err != nil { - panic(err) + merged[kfunc.Name] = mergedKfunc{ + kfunc: kfunc, + progTypes: append(merged[kfunc.Name].progTypes, set.ProgramTypes...), } + } + } - fileContents, err := io.ReadAll(file) - if err != nil { - panic(err) - } - fileStr := string(fileContents) + for _, kfunc := range merged { + file, err := os.OpenFile(*projectroot+"/docs/linux/kfuncs/"+kfunc.Name+".md", os.O_RDWR, 0644) + if err != nil { + panic(err) + } - var fn *btf.Func - err = spec.TypeByName(kfunc.Name, &fn) - if err != nil { - fmt.Printf("%s: not found\n", kfunc.Name) - continue - } + fileContents, err := io.ReadAll(file) + if err != nil { + panic(err) + } + fileStr := string(fileContents) - sig := cFuncSignature(fn) + var fn *btf.Func + err = spec.TypeByName(kfunc.Name, &fn) + if err != nil { + fmt.Printf("%s: not found\n", kfunc.Name) + continue + } - startIdx := strings.Index(fileStr, kfuncDefStart) - endIdx := strings.Index(fileStr, kfuncDefEnd) + sig := cFuncSignature(fn) - if startIdx == -1 || endIdx == -1 { - continue - } + startIdx := strings.Index(fileStr, kfuncDefStart) + endIdx := strings.Index(fileStr, kfuncDefEnd) - var newFile strings.Builder - // Write everything before the marker - newFile.WriteString(fileStr[:startIdx]) - newFile.WriteString(kfuncDefStart) - - newFile.WriteString(fmt.Sprintf("\n`#!c %s`\n", sig)) - - for _, flag := range kfunc.Flags { - switch flag { - case "KF_ACQUIRE": - newFile.WriteString(kfAcquireNotice) - case "KF_RELEASE": - newFile.WriteString(kfReleaseNotice) - case "KF_RET_NULL": - newFile.WriteString(kfRetNullNotice) - case "KF_TRUSTED_ARGS": - case "KF_SLEEPABLE": - newFile.WriteString(kfSleepableNotice) - case "KF_DESTRUCTIVE": - newFile.WriteString(kfDestructiveNotice) - case "KF_RCU": - case "KF_ITER_NEW": - case "KF_ITER_NEXT": - case "KF_ITER_DESTROY": - case "KF_RCU_PROTECTED": - newFile.WriteString(kfRCUProtectedNotice) - } + if startIdx == -1 || endIdx == -1 { + continue + } + + var newFile strings.Builder + // Write everything before the marker + newFile.WriteString(fileStr[:startIdx]) + newFile.WriteString(kfuncDefStart) + + newFile.WriteString(fmt.Sprintf("\n`#!c %s`\n", sig)) + + for _, flag := range kfunc.Flags { + switch flag { + case "KF_ACQUIRE": + newFile.WriteString(kfAcquireNotice) + case "KF_RELEASE": + newFile.WriteString(kfReleaseNotice) + case "KF_RET_NULL": + newFile.WriteString(kfRetNullNotice) + case "KF_TRUSTED_ARGS": + case "KF_SLEEPABLE": + newFile.WriteString(kfSleepableNotice) + case "KF_DESTRUCTIVE": + newFile.WriteString(kfDestructiveNotice) + case "KF_RCU": + case "KF_ITER_NEW": + case "KF_ITER_NEXT": + case "KF_ITER_DESTROY": + case "KF_RCU_PROTECTED": + newFile.WriteString(kfRCUProtectedNotice) + case "KF_FASTCALL": } + } - newFile.WriteString(kfuncDefEnd) - newFile.WriteString(fileStr[endIdx+len(kfuncDefEnd):]) + newFile.WriteString(kfuncDefEnd) + newFile.WriteString(fileStr[endIdx+len(kfuncDefEnd):]) - _, err = file.Seek(0, 0) - if err != nil { - panic(err) - } + _, err = file.Seek(0, 0) + if err != nil { + panic(err) + } - err = file.Truncate(0) - if err != nil { - panic(err) - } + err = file.Truncate(0) + if err != nil { + panic(err) + } - _, err = io.Copy(file, strings.NewReader(newFile.String())) - if err != nil { - panic(err) - } - file.Close() + _, err = io.Copy(file, strings.NewReader(newFile.String())) + if err != nil { + panic(err) } + file.Close() } - progToKfunc := make(map[string][]string) + type kfuncMeta struct { + name string + since *sinceUntil + until *sinceUntil + } + progToKfunc := make(map[string][]kfuncMeta) - for _, set := range kfuncsConfig.Sets { - for _, kfunc := range set.Funcs { - file, err := os.OpenFile(*projectroot+"/docs/linux/kfuncs/"+kfunc.Name+".md", os.O_RDWR, 0644) - if err != nil { - panic(err) - } + for _, kfunc := range merged { + file, err := os.OpenFile(*projectroot+"/docs/linux/kfuncs/"+kfunc.Name+".md", os.O_RDWR, 0644) + if err != nil { + panic(err) + } - fileContents, err := io.ReadAll(file) - if err != nil { - panic(err) - } + fileContents, err := io.ReadAll(file) + if err != nil { + panic(err) + } - var progTypes []string - for _, progType := range set.ProgramTypes { - if progType == "BPF_PROG_TYPE_UNSPEC" { - progTypes = append(progTypes, kfuncProgramTypes...) - } else { - progTypes = append(progTypes, progType) - } + var progTypes []programType + for _, progType := range kfunc.progTypes { + if progType.Name == "BPF_PROG_TYPE_UNSPEC" { + progTypes = append(progTypes, kfuncProgramTypes...) + } else { + progTypes = append(progTypes, progType) } + } - sort.Strings(progTypes) - progTypes = slices.Compact(progTypes) - - for _, progType := range progTypes { - progToKfunc[progType] = append(progToKfunc[progType], kfunc.Name) + slices.SortStableFunc(progTypes, func(a, b programType) int { + if a.Name == b.Name { + return 0 } + if a.Name < b.Name { + return -1 + } + return 1 + }) + progTypes = slices.CompactFunc(progTypes, func(a, b programType) bool { + return a.Name == b.Name + }) + + for _, progType := range progTypes { + progToKfunc[progType.Name] = append(progToKfunc[progType.Name], kfuncMeta{ + name: kfunc.Name, + since: progType.Since, + until: progType.Until, + }) + } - fileStr := string(fileContents) + fileStr := string(fileContents) - startIdx := strings.Index(fileStr, kfuncProgRefStart) - endIdx := strings.Index(fileStr, kfuncProgRefEnd) + startIdx := strings.Index(fileStr, kfuncProgRefStart) + endIdx := strings.Index(fileStr, kfuncProgRefEnd) - if startIdx == -1 || endIdx == -1 { - continue - } + if startIdx == -1 || endIdx == -1 { + continue + } - var newFile strings.Builder - // Write everything before the marker - newFile.WriteString(fileStr[:startIdx]) - newFile.WriteString(kfuncProgRefStart) + var newFile strings.Builder + // Write everything before the marker + newFile.WriteString(fileStr[:startIdx]) + newFile.WriteString(kfuncProgRefStart) - newFile.WriteString("\n") + newFile.WriteString("\n") - for _, progType := range progTypes { - newFile.WriteString(fmt.Sprintf("- [`%s`](../program-type/%s.md)\n", progType, progType)) + for _, progType := range progTypes { + newFile.WriteString(fmt.Sprintf("- [`%s`](../program-type/%s.md)", progType.Name, progType.Name)) + if progType.Since != nil { + fmt.Fprintf(&newFile, " [:octicons-tag-24: v%s](https://github.com/torvalds/linux/commit/%s)", progType.Since.Version, progType.Since.Commit) } - - newFile.WriteString(kfuncProgRefEnd) - newFile.WriteString(fileStr[endIdx+len(kfuncProgRefEnd):]) - - _, err = file.Seek(0, 0) - if err != nil { - panic(err) + if progType.Since != nil || progType.Until != nil { + fmt.Fprint(&newFile, " - ") } - - err = file.Truncate(0) - if err != nil { - panic(err) + if progType.Until != nil { + fmt.Fprintf(&newFile, " [:octicons-tag-24: v%s](https://github.com/torvalds/linux/commit/%s)", progType.Until.Version, progType.Until.Commit) } + fmt.Fprint(&newFile, "\n") + } - _, err = io.Copy(file, strings.NewReader(newFile.String())) - if err != nil { - panic(err) - } + newFile.WriteString(kfuncProgRefEnd) + newFile.WriteString(fileStr[endIdx+len(kfuncProgRefEnd):]) - file.Close() + _, err = file.Seek(0, 0) + if err != nil { + panic(err) + } + + err = file.Truncate(0) + if err != nil { + panic(err) } + + _, err = io.Copy(file, strings.NewReader(newFile.String())) + if err != nil { + panic(err) + } + + file.Close() } progDirEntries, err := os.ReadDir(*projectroot + "/docs/linux/program-type") @@ -317,10 +369,28 @@ func main() { if ok { newFile.WriteString("??? abstract \"Supported kfuncs\"\n") - sort.Strings(kfuncs) + slices.SortStableFunc(kfuncs, func(a, b kfuncMeta) int { + if a.name == b.name { + return 0 + } + if a.name < b.name { + return -1 + } + return 1 + }) for _, kfunc := range kfuncs { - newFile.WriteString(fmt.Sprintf(" - [`%s`](../kfuncs/%s.md)\n", kfunc, kfunc)) + fmt.Fprintf(&newFile, " - [`%s`](../kfuncs/%s.md)", kfunc.name, kfunc.name) + if kfunc.since != nil { + fmt.Fprintf(&newFile, " [:octicons-tag-24: v%s](https://github.com/torvalds/linux/commit/%s)", kfunc.since.Version, kfunc.since.Commit) + } + if kfunc.since != nil || kfunc.until != nil { + fmt.Fprint(&newFile, " - ") + } + if kfunc.until != nil { + fmt.Fprintf(&newFile, " [:octicons-tag-24: v%s](https://github.com/torvalds/linux/commit/%s)", kfunc.until.Version, kfunc.until.Commit) + } + fmt.Fprint(&newFile, "\n") } } else { newFile.WriteString("There are currently no kfuncs supported for this program type\n") @@ -348,23 +418,27 @@ func main() { } } -var kfuncProgramTypes = []string{ - "BPF_PROG_TYPE_XDP", - "BPF_PROG_TYPE_SCHED_CLS", - "BPF_PROG_TYPE_STRUCT_OPS", - "BPF_PROG_TYPE_TRACING", - "BPF_PROG_TYPE_LSM", - "BPF_PROG_TYPE_SYSCALL", - "BPF_PROG_TYPE_CGROUP_SKB", - "BPF_PROG_TYPE_CGROUP_SOCK_ADDR", - "BPF_PROG_TYPE_SCHED_ACT", - "BPF_PROG_TYPE_SK_SKB", - "BPF_PROG_TYPE_SOCKET_FILTER", - "BPF_PROG_TYPE_LWT_OUT", - "BPF_PROG_TYPE_LWT_IN", - "BPF_PROG_TYPE_LWT_XMIT", - "BPF_PROG_TYPE_LWT_SEG6LOCAL", - "BPF_PROG_TYPE_NETFILTER", +var kfuncProgramTypes = []programType{ + {Name: "BPF_PROG_TYPE_XDP"}, + {Name: "BPF_PROG_TYPE_SCHED_CLS"}, + {Name: "BPF_PROG_TYPE_STRUCT_OPS"}, + {Name: "BPF_PROG_TYPE_TRACING"}, + {Name: "BPF_PROG_TYPE_LSM"}, + {Name: "BPF_PROG_TYPE_SYSCALL"}, + {Name: "BPF_PROG_TYPE_CGROUP_SKB"}, + {Name: "BPF_PROG_TYPE_CGROUP_SOCK_ADDR", Since: &sinceUntil{Version: "6.7", Commit: "53e380d21441909b12b6e0782b77187ae4b971c4"}}, + {Name: "BPF_PROG_TYPE_CGROUP_SOCK", Since: &sinceUntil{Version: "6.12", Commit: "67666479edf1e2b732f4d0ac797885e859a78de4"}}, + {Name: "BPF_PROG_TYPE_CGROUP_DEVICE", Since: &sinceUntil{Version: "6.12", Commit: "67666479edf1e2b732f4d0ac797885e859a78de4"}}, + {Name: "BPF_PROG_TYPE_CGROUP_SOCKOPT", Since: &sinceUntil{Version: "6.12", Commit: "67666479edf1e2b732f4d0ac797885e859a78de4"}}, + {Name: "BPF_PROG_TYPE_CGROUP_SYSCTL", Since: &sinceUntil{Version: "6.12", Commit: "67666479edf1e2b732f4d0ac797885e859a78de4"}}, + {Name: "BPF_PROG_TYPE_SCHED_ACT"}, + {Name: "BPF_PROG_TYPE_SK_SKB"}, + {Name: "BPF_PROG_TYPE_SOCKET_FILTER"}, + {Name: "BPF_PROG_TYPE_LWT_OUT"}, + {Name: "BPF_PROG_TYPE_LWT_IN"}, + {Name: "BPF_PROG_TYPE_LWT_XMIT"}, + {Name: "BPF_PROG_TYPE_LWT_SEG6LOCAL"}, + {Name: "BPF_PROG_TYPE_NETFILTER"}, } func cFuncSignature(fn *btf.Func) string { diff --git a/tools/kfunc-gen/vmlinux b/tools/kfunc-gen/vmlinux index 14aea8c..a660fd1 100644 Binary files a/tools/kfunc-gen/vmlinux and b/tools/kfunc-gen/vmlinux differ diff --git a/tools/kfunc-gen/vmlinux-update.md b/tools/kfunc-gen/vmlinux-update.md index 3d204e4..6c3d7ca 100644 --- a/tools/kfunc-gen/vmlinux-update.md +++ b/tools/kfunc-gen/vmlinux-update.md @@ -20,6 +20,8 @@ The current VMLinux blob is created from the v6.10-RC2 tag of the Linux kernel. CONFIG_NF_FLOW_TABLE=y CONFIG_MMU=y CONFIG_64BIT=y + CONFIG_CGROUP_SCHED=y + CONFIG_SCHED_CLASS_EXT=y ``` 3. Run `./buildx.sh {latest tag} amd64 vmlinux --tag foo:vmlinux` 4. Run `echo "FROM foo:vmlinux" | "$docker" buildx build --quiet --output="$tmp" - &> /dev/null` diff --git a/tools/version-finder/patterns.yaml b/tools/version-finder/patterns.yaml index df298fb..e0a3d23 100644 --- a/tools/version-finder/patterns.yaml +++ b/tools/version-finder/patterns.yaml @@ -7,8 +7,10 @@ files: - kernel/bpf/* - kernel/trace/* - kernel/events/* + - kernel/sched/* - net/* - security/* + - fs/* # Patterns of tags to check tags: @@ -736,3 +738,66 @@ patterns: - name: hid_bpf_hw_output_report - name: hid_bpf_input_report - name: hid_bpf_try_input_report + - name: bpf_task_from_vpid + - name: bpf_send_signal_task + - name: bpf_copy_from_user_str + - name: bpf_get_kmem_cache + - name: bpf_iter_kmem_cache_new + - name: bpf_iter_kmem_cache_next + - name: bpf_iter_kmem_cache_destroy + - name: bpf_local_irq_save + - name: bpf_local_irq_restore + - name: scx_bpf_select_cpu_dfl + - name: scx_bpf_dsq_insert + - name: scx_bpf_dsq_insert_vtime + - name: scx_bpf_dispatch + - name: scx_bpf_dispatch_vtime + - name: scx_bpf_dispatch_nr_slots + - name: scx_bpf_dispatch_cancel + - name: scx_bpf_dsq_move_to_local + - name: scx_bpf_consume + - name: scx_bpf_dsq_move_set_slice + - name: scx_bpf_dsq_move_set_vtime + - name: scx_bpf_dispatch_from_dsq_set_slice + - name: scx_bpf_dispatch_from_dsq_set_vtime + - name: scx_bpf_dsq_move + - name: scx_bpf_dsq_move_vtime + - name: scx_bpf_dispatch_from_dsq + - name: scx_bpf_dispatch_vtime_from_dsq + - name: scx_bpf_reenqueue_local + - name: scx_bpf_create_dsq + - name: scx_bpf_dsq_move + - name: scx_bpf_dsq_move_vtime + - name: scx_bpf_dispatch_from_dsq + - name: scx_bpf_dispatch_vtime_from_dsq + - name: scx_bpf_kick_cpu + - name: scx_bpf_dsq_nr_queued + - name: scx_bpf_destroy_dsq + - name: bpf_iter_scx_dsq_new + - name: bpf_iter_scx_dsq_next + - name: bpf_iter_scx_dsq_destroy + - name: scx_bpf_exit_bstr + - name: scx_bpf_error_bstr + - name: scx_bpf_dump_bstr + - name: scx_bpf_cpuperf_cap + - name: scx_bpf_cpuperf_cur + - name: scx_bpf_cpuperf_set + - name: scx_bpf_nr_cpu_ids + - name: scx_bpf_get_possible_cpumask + - name: scx_bpf_get_online_cpumask + - name: scx_bpf_put_cpumask + - name: scx_bpf_get_idle_cpumask + - name: scx_bpf_get_idle_smtmask + - name: scx_bpf_put_idle_cpumask + - name: scx_bpf_test_and_clear_cpu_idle + - name: scx_bpf_pick_idle_cpu + - name: scx_bpf_pick_any_cpu + - name: scx_bpf_task_running + - name: scx_bpf_task_cpu + - name: scx_bpf_cpu_rq + - name: scx_bpf_task_cgroup + - name: scx_bpf_now + - name: bpf_get_task_exe_file + - name: bpf_put_file + - name: bpf_path_d_path + - name: bpf_get_dentry_xattr