aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
diff options
context:
space:
mode:
authorMartin KaFai Lau <[email protected]>2022-11-07 23:04:20 +0000
committerAndrii Nakryiko <[email protected]>2022-11-11 21:18:36 +0000
commit8cac7a59b252732d8427ebc29c3fc6c36ff653e1 (patch)
treecd82bf12012f8d4ed6b33a969a94750ecd1e48f6 /tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
parentselftests/bpf: Fix incorrect ASSERT in the tcp_hdr_options test (diff)
downloadkernel-8cac7a59b252732d8427ebc29c3fc6c36ff653e1.tar.gz
kernel-8cac7a59b252732d8427ebc29c3fc6c36ff653e1.zip
selftests/bpf: Test skops->skb_hwtstamp
This patch tests reading the skops->skb_hwtstamp field. A local test was also done such that the shinfo hwtstamp was temporary set to a non zero value in the kernel bpf_skops_parse_hdr() and the same value can be read by the skops test. An adjustment is needed to the btf_dump selftest because the changes in the 'struct bpf_sock_ops'. Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c b/tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
index 57191773572a..5cf85d0f9827 100644
--- a/tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
+++ b/tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
@@ -505,6 +505,8 @@ static void misc(void)
ASSERT_EQ(misc_skel->bss->nr_fin, 1, "unexpected nr_fin");
+ ASSERT_EQ(misc_skel->bss->nr_hwtstamp, 0, "nr_hwtstamp");
+
check_linum:
ASSERT_FALSE(check_error_linum(&sk_fds), "check_error_linum");
sk_fds_close(&sk_fds);