From cf36cc7c78a43c574f454451e7b6ed77c80d0465 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 3 Jan 2019 23:36:22 +0000 Subject: [PATCH] xlat: update BPF_F_* constants * xlat/bpf_map_flags.in (BPF_F_ZERO_SEED): New constant introduced by Linux kernel commit v5.0-rc1~129^2~114^2~18^2~3. * xlat/bpf_prog_flags.in (BPF_F_ANY_ALIGNMENT): New constant introduced by Linux kernel commit v5.0-rc1~129^2~209^2~17^2~3. * NEWS: Mention this. * tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks, print_BPF_PROG_LOAD_attr3, print_BPF_PROG_LOAD_attr4): Update. --- NEWS | 3 +++ tests/bpf.c | 12 ++++++------ xlat/bpf_map_flags.in | 7 ++++--- xlat/bpf_prog_flags.in | 3 ++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 616d594e..f4b5b4b6 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ Noteworthy changes in release ?.?? (????-??-??) =============================================== +* Improvements + * Updated the list of BPF_* constants. + * Bug fixes * Fixed strace-k test on alpha. diff --git a/tests/bpf.c b/tests/bpf.c index d1941683..cfed3191 100644 --- a/tests/bpf.c +++ b/tests/bpf.c @@ -282,7 +282,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { .key_size = 0xface1e55, .value_size = 0xbadc0ded, .max_entries = 0xbeefcafe, - .map_flags = 0xffffffc0, + .map_flags = 0xffffff80, .inner_map_fd = 2718281828, .numa_node = -1, .map_name = "", @@ -292,7 +292,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { .str = "map_type=0x18 /* BPF_MAP_TYPE_??? */" ", key_size=4207812181, value_size=3134983661" ", max_entries=3203386110" - ", map_flags=0xffffffc0 /* BPF_F_??? */" + ", map_flags=0xffffff80 /* BPF_F_??? */" ", inner_map_fd=-1576685468" ", map_name=\"\", map_ifindex=3141592653", @@ -531,7 +531,7 @@ print_BPF_PROG_LOAD_attr3(const struct bpf_attr_check *check, unsigned long addr ", insns=" INSNS_FMT ", license=\"%s\", log_level=2718281828" ", log_size=%u, log_buf=%p" ", kern_version=KERNEL_VERSION(51966, 240, 13)" - ", prog_flags=0x2 /* BPF_F_??? */" + ", prog_flags=0x4 /* BPF_F_??? */" ", prog_name=\"0123456789abcde\"..., prog_ifindex=3203399405", (unsigned int) ARRAY_SIZE(insns), INSNS_ARG, license, log_buf_size, get_log_buf_tail()); @@ -557,7 +557,7 @@ print_BPF_PROG_LOAD_attr4(const struct bpf_attr_check *check, unsigned long addr ", license=\"%s\", log_level=2718281828, log_size=4" ", log_buf=\"log \"..." ", kern_version=KERNEL_VERSION(51966, 240, 13)" - ", prog_flags=BPF_F_STRICT_ALIGNMENT|0x2" + ", prog_flags=BPF_F_STRICT_ALIGNMENT|BPF_F_ANY_ALIGNMENT|0x4" ", prog_name=\"0123456789abcde\"..., prog_ifindex=%s" ", expected_attach_type=BPF_CGROUP_INET6_BIND", (unsigned int) ARRAY_SIZE(insns), INSNS_ARG, @@ -621,7 +621,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = { .log_level = 2718281828U, .log_size = log_buf_size, .kern_version = 0xcafef00d, - .prog_flags = 2, + .prog_flags = 4, .prog_name = "0123456789abcdef", .prog_ifindex = 0xbeeffeed, } }, @@ -636,7 +636,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = { .log_level = 2718281828U, .log_size = 4, .kern_version = 0xcafef00d, - .prog_flags = 3, + .prog_flags = 7, .prog_name = "0123456789abcdef", .expected_attach_type = 9, } }, diff --git a/xlat/bpf_map_flags.in b/xlat/bpf_map_flags.in index a8f405b3..a2790db6 100644 --- a/xlat/bpf_map_flags.in +++ b/xlat/bpf_map_flags.in @@ -1,6 +1,7 @@ -BPF_F_NO_PREALLOC 1 -BPF_F_NO_COMMON_LRU 2 -BPF_F_NUMA_NODE 4 +BPF_F_NO_PREALLOC 1U +BPF_F_NO_COMMON_LRU (1U << 1) +BPF_F_NUMA_NODE (1U << 2) BPF_F_RDONLY (1U << 3) BPF_F_WRONLY (1U << 4) BPF_F_STACK_BUILD_ID (1U << 5) +BPF_F_ZERO_SEED (1U << 6) diff --git a/xlat/bpf_prog_flags.in b/xlat/bpf_prog_flags.in index 7fcf3a7a..e9eb42aa 100644 --- a/xlat/bpf_prog_flags.in +++ b/xlat/bpf_prog_flags.in @@ -1 +1,2 @@ -BPF_F_STRICT_ALIGNMENT 1 +BPF_F_STRICT_ALIGNMENT 1U +BPF_F_ANY_ALIGNMENT (1U << 1) -- 2.50.1