History

tools: Sync {,tools/}include/uapi/linux/bpf.h

The tools version of this header is out of date; update it to the latest version from kernel header. Synchronize with the following commits: * b95a5c4db09b ("bpf: add a longest prefix match trie map implementation") * a5e8c07059d0 ("bpf: add bpf_probe_read_str helper") * d1b662adcdb8 ("bpf: allow option for setting bpf_l4_csum_replace from scratch")

Mickaël Salaün committed 9 years ago

Commit 9a738261 parent e40d5d71 file · +22 −1Browse files

Showing the changes to tools/include/uapi/linux (1 of 1 file). Show all

Unified · Split

tools/include/uapi/linux/bpf.h+22−1
@@ -63,6 +63,12 @@ struct bpf_insn { · 62 unmodified lines
63 __s32 imm; /* signed immediate constant */63 __s32 imm; /* signed immediate constant */
64};64};
65 65
66/* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */
67struct bpf_lpm_trie_key {
68 __u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */
69 __u8 data[0]; /* Arbitrary size */
70};
71
66/* BPF syscall commands, see bpf(2) man-page for details. */72/* BPF syscall commands, see bpf(2) man-page for details. */
67enum bpf_cmd {73enum bpf_cmd {
68 BPF_MAP_CREATE,74 BPF_MAP_CREATE,
@@ -89,6 +95,7 @@ enum bpf_map_type { · 20 unmodified lines
89 BPF_MAP_TYPE_CGROUP_ARRAY,95 BPF_MAP_TYPE_CGROUP_ARRAY,
90 BPF_MAP_TYPE_LRU_HASH,96 BPF_MAP_TYPE_LRU_HASH,
91 BPF_MAP_TYPE_LRU_PERCPU_HASH,97 BPF_MAP_TYPE_LRU_PERCPU_HASH,
98 BPF_MAP_TYPE_LPM_TRIE,
92};99};
93 100
94enum bpf_prog_type {101enum bpf_prog_type {
@@ -430,6 +437,18 @@ union bpf_attr { · 335 unmodified lines
430 * @xdp_md: pointer to xdp_md437 * @xdp_md: pointer to xdp_md
431 * @delta: An positive/negative integer to be added to xdp_md.data438 * @delta: An positive/negative integer to be added to xdp_md.data
432 * Return: 0 on success or negative on error439 * Return: 0 on success or negative on error
440 *
441 * int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
442 * Copy a NUL terminated string from unsafe address. In case the string
443 * length is smaller than size, the target is not padded with further NUL
444 * bytes. In case the string length is larger than size, just count-1
445 * bytes are copied and the last byte is set to NUL.
446 * @dst: destination address
447 * @size: maximum number of bytes to copy, including the trailing NUL
448 * @unsafe_ptr: unsafe address
449 * Return:
450 * > 0 length of the string including the trailing NUL on success
451 * < 0 error
433 */452 */
434#define __BPF_FUNC_MAPPER(FN) \453#define __BPF_FUNC_MAPPER(FN) \
435 FN(unspec), \454 FN(unspec), \
@@ -476,7 +495,8 @@ union bpf_attr { · 40 unmodified lines
476 FN(set_hash_invalid), \495 FN(set_hash_invalid), \
477 FN(get_numa_node_id), \496 FN(get_numa_node_id), \
478 FN(skb_change_head), \497 FN(skb_change_head), \
479 FN(xdp_adjust_head),498 FN(xdp_adjust_head), \
499 FN(probe_read_str),
480 500
481/* integer value in 'imm' field of BPF_CALL instruction selects which helper501/* integer value in 'imm' field of BPF_CALL instruction selects which helper
482 * function eBPF program intends to call502 * function eBPF program intends to call
@@ -502,6 +522,7 @@ enum bpf_func_id { · 19 unmodified lines
502/* BPF_FUNC_l4_csum_replace flags. */522/* BPF_FUNC_l4_csum_replace flags. */
503#define BPF_F_PSEUDO_HDR (1ULL << 4)523#define BPF_F_PSEUDO_HDR (1ULL << 4)
504#define BPF_F_MARK_MANGLED_0 (1ULL << 5)524#define BPF_F_MARK_MANGLED_0 (1ULL << 5)
525#define BPF_F_MARK_ENFORCE (1ULL << 6)
505 526
506/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */527/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
507#define BPF_F_INGRESS (1ULL << 0)528#define BPF_F_INGRESS (1ULL << 0)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t