]> granicus.if.org Git - strace/commitdiff
xlat: update BPF_* constants
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 13 Aug 2019 11:06:57 +0000 (11:06 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 13 Aug 2019 11:06:57 +0000 (11:06 +0000)
* xlat/bpf_attach_type.in (BPF_CGROUP_GETSOCKOPT,
BPF_CGROUP_SETSOCKOPT): New constants introduced by Linux kernel commit
v5.3-rc1~140^2~65^2~8^2~8.
* xlat/bpf_prog_flags.in (BPF_F_TEST_RND_HI32): New constant
introduced by Linux kernel commit v5.3-rc1~140^2~371^2~28^2~12.
* xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_SOCKOPT): New constant
introduced by Linux kernel commit v5.3-rc1~140^2~65^2~8^2~8.
* NEWS: Mention this.
* tests/bpf.c (print_BPF_PROG_LOAD_attr3, print_BPF_PROG_LOAD_attr4,
BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update expected output.
* tests/kernel_version.c (print_bpf_attr, main): Likewise.

NEWS
tests/bpf.c
tests/kernel_version.c
xlat/bpf_attach_type.in
xlat/bpf_prog_flags.in
xlat/bpf_prog_types.in

diff --git a/NEWS b/NEWS
index e651c789ff015455fc701d16f34e19104a8935fc..ce1087dd3801429bd4fc7b913d0e869e7d05664a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 Noteworthy changes in release ?.? (????-??-??)
 ==============================================
 
+* Improvements
+  * Updated lists of BPF_*, ETH_*, MAP_*, SO_*, V4L2_*, and XDP_* constants.
+
 * Bug fixes
   * Fixed tests on alpha with Linux kernel headers 5.1+.
 
index 2643f740bd65040a00817f372bbddd41d2ce12d7..5b5df8f19cf12caef58c1dc6b960e3656e1d6891 100644 (file)
@@ -564,7 +564,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=0x4 /* BPF_F_??? */"
+              ", prog_flags=0x8 /* BPF_F_??? */"
               ", prog_name=\"0123456789abcde\"..., prog_ifindex=3203399405",
               (unsigned int) ARRAY_SIZE(insns), INSNS_ARG, license,
               log_buf_size, get_log_buf_tail());
@@ -590,7 +590,8 @@ 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|BPF_F_ANY_ALIGNMENT|0x4"
+              ", prog_flags=BPF_F_STRICT_ALIGNMENT|BPF_F_ANY_ALIGNMENT"
+              "|BPF_F_TEST_RND_HI32|0x8"
               ", prog_name=\"0123456789abcde\"..., prog_ifindex=%s"
               ", expected_attach_type=BPF_CGROUP_INET6_BIND",
               (unsigned int) ARRAY_SIZE(insns), INSNS_ARG,
@@ -606,7 +607,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = {
        },
        { /* 1 */
                .data = { .BPF_PROG_LOAD_data = {
-                       .prog_type = 24,
+                       .prog_type = 25,
                        .insn_cnt = 0xbadc0ded,
                        .insns = 0,
                        .license = 0,
@@ -617,7 +618,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = {
                        .prog_flags = 0,
                } },
                .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_flags),
-               .str = "prog_type=0x18 /* BPF_PROG_TYPE_??? */"
+               .str = "prog_type=0x19 /* BPF_PROG_TYPE_??? */"
                       ", insn_cnt=3134983661, insns=NULL, license=NULL"
                       ", log_level=42, log_size=3141592653, log_buf=NULL"
                       ", kern_version=KERNEL_VERSION(51966, 240, 13)"
@@ -654,7 +655,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = {
                        .log_level = 2718281828U,
                        .log_size = log_buf_size,
                        .kern_version = 0xcafef00d,
-                       .prog_flags = 4,
+                       .prog_flags = 8,
                        .prog_name = "0123456789abcdef",
                        .prog_ifindex = 0xbeeffeed,
                } },
@@ -669,7 +670,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = {
                        .log_level = 2718281828U,
                        .log_size = 4,
                        .kern_version = 0xcafef00d,
-                       .prog_flags = 7,
+                       .prog_flags = 0xf,
                        .prog_name = "0123456789abcdef",
                        .expected_attach_type = 9,
                } },
@@ -1052,7 +1053,7 @@ static struct bpf_attr_check BPF_PROG_QUERY_checks[] = {
        { /* 2 */
                .data = { .BPF_PROG_QUERY_data = {
                        .target_fd = 3141592653U,
-                       .attach_type = 21,
+                       .attach_type = 23,
                        .query_flags = 0xfffffffe,
                        .attach_flags = 0xfffffffc,
                        .prog_ids = 0xffffffffffffffffULL,
@@ -1060,7 +1061,7 @@ static struct bpf_attr_check BPF_PROG_QUERY_checks[] = {
                } },
                .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt),
                .str = "query={target_fd=-1153374643"
-                      ", attach_type=0x15 /* BPF_??? */"
+                      ", attach_type=0x17 /* BPF_??? */"
                       ", query_flags=0xfffffffe /* BPF_F_QUERY_??? */"
                       ", attach_flags=0xfffffffc /* BPF_F_??? */"
                       ", prog_ids="
index 9f55210cc1d068da389279f15c3a995956622a65..e82095c62f31d0f0a94d8a90c11c4b6d16e1af24 100644 (file)
@@ -34,9 +34,9 @@ static void
 print_bpf_attr(void)
 {
 #if XLAT_RAW
-       printf("{prog_type=0x18"
+       printf("{prog_type=0x19"
 #else
-       printf("{prog_type=0x18 /* BPF_PROG_TYPE_??? */"
+       printf("{prog_type=0x19 /* BPF_PROG_TYPE_??? */"
 #endif
                ", insn_cnt=3134983661"
                ", insns=NULL"
@@ -77,7 +77,7 @@ main(void)
 {
        long ret;
        struct BPF_PROG_LOAD_struct prog = {
-               .prog_type = 24,
+               .prog_type = 25,
                .insn_cnt = 0xbadc0ded,
                .insns = 0,
                .license = 0,
index a753b3c1ab19479a1aa602863c4d1604edec7dba..60505746a129f429eb79b09ffb26ac238a3b2755 100644 (file)
@@ -20,3 +20,5 @@ BPF_FLOW_DISSECTOR 17
 BPF_CGROUP_SYSCTL 18
 BPF_CGROUP_UDP4_RECVMSG 19
 BPF_CGROUP_UDP6_RECVMSG 20
+BPF_CGROUP_GETSOCKOPT 21
+BPF_CGROUP_SETSOCKOPT 22
index e9eb42aa431cd4e5443fe9d520a6bad7843fc1ab..4637f8c0376f17f6e616b98c2aa3787772c8d0df 100644 (file)
@@ -1,2 +1,3 @@
 BPF_F_STRICT_ALIGNMENT 1U
 BPF_F_ANY_ALIGNMENT    (1U << 1)
+BPF_F_TEST_RND_HI32    (1U << 2)
index 452189ff6608f0e202c1bac333148dae6e2c839f..2d81d82d1c0c7a41f8767babdab2a9cdc0c131de 100644 (file)
@@ -23,3 +23,4 @@ BPF_PROG_TYPE_SK_REUSEPORT 20
 BPF_PROG_TYPE_FLOW_DISSECTOR 21
 BPF_PROG_TYPE_CGROUP_SYSCTL 22
 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE 23
+BPF_PROG_TYPE_CGROUP_SOCKOPT 24