History

Sync uapi/bpf.h to tools/include

Sync both files.

Mauricio Vasquez B committed 8 years ago

Commit da4e1b11 parent bd513cd1 file · +29 −1Browse files

Unified · Split

tools/include/uapi/linux/bpf.h+29−1
@@ -103,6 +103,7 @@ enum bpf_cmd { · 102 unmodified lines
103103 BPF_BTF_LOAD,
104104 BPF_BTF_GET_FD_BY_ID,
105105 BPF_TASK_FD_QUERY,
106+ BPF_MAP_LOOKUP_AND_DELETE_ELEM,
106107 };
107108
108109 enum bpf_map_type {
@@ -128,6 +129,8 @@ enum bpf_map_type { · 19 unmodified lines
128129 BPF_MAP_TYPE_CGROUP_STORAGE,
129130 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,
130131 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE,
132+ BPF_MAP_TYPE_QUEUE,
133+ BPF_MAP_TYPE_STACK,
131134 };
132135
133136 enum bpf_prog_type {
@@ -462,6 +465,28 @@ union bpf_attr { · 328 unmodified lines
462465 * Return
463466 * 0 on success, or a negative error in case of failure.
464467 *
468+ * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
469+ * Description
470+ * Push an element *value* in *map*. *flags* is one of:
471+ *
472+ * **BPF_EXIST**
473+ * If the queue/stack is full, the oldest element is removed to
474+ * make room for this.
475+ * Return
476+ * 0 on success, or a negative error in case of failure.
477+ *
478+ * int bpf_map_pop_elem(struct bpf_map *map, void *value)
479+ * Description
480+ * Pop an element from *map*.
481+ * Return
482+ * 0 on success, or a negative error in case of failure.
483+ *
484+ * int bpf_map_peek_elem(struct bpf_map *map, void *value)
485+ * Description
486+ * Get an element from *map* without removing it.
487+ * Return
488+ * 0 on success, or a negative error in case of failure.
489+ *
465490 * int bpf_probe_read(void *dst, u32 size, const void *src)
466491 * Description
467492 * For tracing programs, safely attempt to read *size* bytes from
@@ -2303,7 +2328,10 @@ union bpf_attr { · 1835 unmodified lines
23032328 FN(skb_ancestor_cgroup_id), \
23042329 FN(sk_lookup_tcp), \
23052330 FN(sk_lookup_udp), \
2306− FN(sk_release),
2331+ FN(sk_release), \
2332+ FN(map_push_elem), \
2333+ FN(map_pop_elem), \
2334+ FN(map_peek_elem),
23072335
23082336 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
23092337 * function eBPF program intends to call