selftests/bpf: Test skops->skb_hwtstamp
authorMartin KaFai Lau <martin.lau@kernel.org>
Mon, 7 Nov 2022 23:04:20 +0000 (15:04 -0800)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 11 Nov 2022 21:18:36 +0000 (13:18 -0800)
commit8cac7a59b252732d8427ebc29c3fc6c36ff653e1
treecd82bf12012f8d4ed6b33a969a94750ecd1e48f6
parent52929912d7bda040b43538e8d88e8d231b76eb4e
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 <martin.lau@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20221107230420.4192307-4-martin.lau@linux.dev
tools/testing/selftests/bpf/prog_tests/btf_dump.c
tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
tools/testing/selftests/bpf/progs/test_misc_tcp_hdr_options.c