summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-03-20 18:41:15 -0700
committerMartin KaFai Lau <martin.lau@kernel.org>2023-03-20 21:57:49 -0700
commitc0ba861117c3e8deb03855d7dc5a7717958bbb18 (patch)
treec9f18cb482cb512e02c7761a53aa7e816cfeb352 /tools
parentb94e032b7ad6318b36615f0e0cc3b0d61a5531e8 (diff)
net: skbuff: move the fields BPF cares about directly next to the offset marker
To avoid more possible BPF dependencies with moving bitfields around keep the fields BPF cares about right next to the offset marker. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20230321014115.997841-4-kuba@kernel.org Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c b/tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c
index ae7b6e50e405..4951aa978f33 100644
--- a/tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c
+++ b/tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c
@@ -69,15 +69,15 @@ static struct test_case test_cases[] = {
{
N(SCHED_CLS, struct __sk_buff, tstamp),
.read = "r11 = *(u8 *)($ctx + sk_buff::__mono_tc_offset);"
- "w11 &= 160;"
- "if w11 != 0xa0 goto pc+2;"
+ "w11 &= 3;"
+ "if w11 != 0x3 goto pc+2;"
"$dst = 0;"
"goto pc+1;"
"$dst = *(u64 *)($ctx + sk_buff::tstamp);",
.write = "r11 = *(u8 *)($ctx + sk_buff::__mono_tc_offset);"
- "if w11 & 0x80 goto pc+1;"
+ "if w11 & 0x2 goto pc+1;"
"goto pc+2;"
- "w11 &= -33;"
+ "w11 &= -2;"
"*(u8 *)($ctx + sk_buff::__mono_tc_offset) = r11;"
"*(u64 *)($ctx + sk_buff::tstamp) = $src;",
},