Browse Source

xlat: add BPF_F_TEST_STATE_FREQ to bpf_prog_flags

* xlat/bpf_prog_flags.in (BPF_F_TEST_STATE_FREQ): New constant,
introduced by Linux commit v5.4-rc1~131^2~62^2~17^2~3.
* tests/bpf.c: Update expected output.
Eugene Syromyatnikov 3 months ago
parent
commit
9eefb5aa01
2 changed files with 5 additions and 4 deletions
  1. 4
    4
      tests/bpf.c
  2. 1
    0
      xlat/bpf_prog_flags.in

+ 4
- 4
tests/bpf.c View File

@@ -564,7 +564,7 @@ print_BPF_PROG_LOAD_attr3(const struct bpf_attr_check *check, unsigned long addr
564 564
 	       ", insns=" INSNS_FMT ", license=\"%s\", log_level=2718281828"
565 565
 	       ", log_size=%u, log_buf=%p"
566 566
 	       ", kern_version=KERNEL_VERSION(51966, 240, 13)"
567
-	       ", prog_flags=0x8 /* BPF_F_??? */"
567
+	       ", prog_flags=0x10 /* BPF_F_??? */"
568 568
 	       ", prog_name=\"0123456789abcde\"..., prog_ifindex=3203399405",
569 569
 	       (unsigned int) ARRAY_SIZE(insns), INSNS_ARG, license,
570 570
 	       log_buf_size, get_log_buf_tail());
@@ -591,7 +591,7 @@ print_BPF_PROG_LOAD_attr4(const struct bpf_attr_check *check, unsigned long addr
591 591
 	       ", log_buf=\"log \"..."
592 592
 	       ", kern_version=KERNEL_VERSION(51966, 240, 13)"
593 593
 	       ", prog_flags=BPF_F_STRICT_ALIGNMENT|BPF_F_ANY_ALIGNMENT"
594
-	       "|BPF_F_TEST_RND_HI32|0x8"
594
+	       "|BPF_F_TEST_RND_HI32|BPF_F_TEST_STATE_FREQ|0x10"
595 595
 	       ", prog_name=\"0123456789abcde\"..., prog_ifindex=%s"
596 596
 	       ", expected_attach_type=BPF_CGROUP_INET6_BIND",
597 597
 	       (unsigned int) ARRAY_SIZE(insns), INSNS_ARG,
@@ -655,7 +655,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = {
655 655
 			.log_level = 2718281828U,
656 656
 			.log_size = log_buf_size,
657 657
 			.kern_version = 0xcafef00d,
658
-			.prog_flags = 8,
658
+			.prog_flags = 16,
659 659
 			.prog_name = "0123456789abcdef",
660 660
 			.prog_ifindex = 0xbeeffeed,
661 661
 		} },
@@ -670,7 +670,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = {
670 670
 			.log_level = 2718281828U,
671 671
 			.log_size = 4,
672 672
 			.kern_version = 0xcafef00d,
673
-			.prog_flags = 0xf,
673
+			.prog_flags = 0x1f,
674 674
 			.prog_name = "0123456789abcdef",
675 675
 			.expected_attach_type = 9,
676 676
 		} },

+ 1
- 0
xlat/bpf_prog_flags.in View File

@@ -1,3 +1,4 @@
1 1
 BPF_F_STRICT_ALIGNMENT	1U
2 2
 BPF_F_ANY_ALIGNMENT	(1U << 1)
3 3
 BPF_F_TEST_RND_HI32	(1U << 2)
4
+BPF_F_TEST_STATE_FREQ	(1U << 3)

Loading…
Cancel
Save