Sync kernel uapi/linux/bpf.h with tools uapi/linux/bpf.h. Also add the necessary helper define in bpf_helpers.h.
Unified · Split
| @@ -2070,6 +2070,11 @@ union bpf_attr { · 2069 unmodified lines | ||
| 2070 | 2070 | * **CONFIG_SOCK_CGROUP_DATA** configuration option. |
| 2071 | 2071 | * Return |
| 2072 | 2072 | * The id is returned or 0 in case the id could not be retrieved. |
| 2073 | + * | |
| 2074 | + * u64 bpf_get_current_cgroup_id(void) | |
| 2075 | + * Return | |
| 2076 | + * A 64-bit integer containing the current cgroup id based | |
| 2077 | + * on the cgroup within which the current task is running. | |
| 2073 | 2078 | */ |
| 2074 | 2079 | #define __BPF_FUNC_MAPPER(FN) \ |
| 2075 | 2080 | FN(unspec), \ |
| @@ -2151,7 +2156,8 @@ union bpf_attr { · 75 unmodified lines | ||
| 2151 | 2156 | FN(lwt_seg6_action), \ |
| 2152 | 2157 | FN(rc_repeat), \ |
| 2153 | 2158 | FN(rc_keydown), \ |
| 2154 | − FN(skb_cgroup_id), | |
| 2159 | + FN(skb_cgroup_id), \ | |
| 2160 | + FN(get_current_cgroup_id), | |
| 2155 | 2161 | |
| 2156 | 2162 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper |
| 2157 | 2163 | * function eBPF program intends to call |
| @@ -131,6 +131,8 @@ static int (*bpf_rc_repeat)(void *ctx) = · 130 unmodified lines | ||
| 131 | 131 | static int (*bpf_rc_keydown)(void *ctx, unsigned int protocol, |
| 132 | 132 | unsigned long long scancode, unsigned int toggle) = |
| 133 | 133 | (void *) BPF_FUNC_rc_keydown; |
| 134 | +static unsigned long long (*bpf_get_current_cgroup_id)(void) = | |
| 135 | + (void *) BPF_FUNC_get_current_cgroup_id; | |
| 134 | 136 | |
| 135 | 137 | /* llvm builtin functions that eBPF C program may use to |
| 136 | 138 | * emit BPF_LD_ABS and BPF_LD_IND instructions |