summaryrefslogtreecommitdiff
path: root/tools/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2018-06-04 01:59:42 +0300
committerAlexei Starovoitov <ast@kernel.org>2018-06-04 04:22:41 +0300
commitc7ddbbaf1e73e2f4e95cfda7b1da1be7fd199a4d (patch)
tree748ad0b4742b384d6ce5a2271608ae871382c431 /tools/include/uapi/linux/bpf.h
parentbf6fa2c893c5237b48569a13fa3c673041430b6c (diff)
downloadlinux-c7ddbbaf1e73e2f4e95cfda7b1da1be7fd199a4d.tar.xz
tools/bpf: sync uapi bpf.h for bpf_get_current_cgroup_id() helper
Sync kernel uapi/linux/bpf.h with tools uapi/linux/bpf.h. Also add the necessary helper define in bpf_helpers.h. Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/include/uapi/linux/bpf.h')
-rw-r--r--tools/include/uapi/linux/bpf.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index f0b6608b1f1c..18712b0dbfe7 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -2070,6 +2070,11 @@ union bpf_attr {
* **CONFIG_SOCK_CGROUP_DATA** configuration option.
* Return
* The id is returned or 0 in case the id could not be retrieved.
+ *
+ * u64 bpf_get_current_cgroup_id(void)
+ * Return
+ * A 64-bit integer containing the current cgroup id based
+ * on the cgroup within which the current task is running.
*/
#define __BPF_FUNC_MAPPER(FN) \
FN(unspec), \
@@ -2151,7 +2156,8 @@ union bpf_attr {
FN(lwt_seg6_action), \
FN(rc_repeat), \
FN(rc_keydown), \
- FN(skb_cgroup_id),
+ FN(skb_cgroup_id), \
+ FN(get_current_cgroup_id),
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
* function eBPF program intends to call