summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/libbpf_internal.h
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2022-06-01 16:40:50 -0700
committerAndrii Nakryiko <andrii@kernel.org>2022-06-03 14:53:33 -0700
commite6ff92f41b65fce07365f1066fb13b5e42aca08d (patch)
treef13341d365d697ced4cbcffb3e189505c331317e /tools/lib/bpf/libbpf_internal.h
parent988d0d5899248b758d2f2eae3b57708fe78a8618 (diff)
selftests/bpf: Fix tc_redirect_dtime
tc_redirect_dtime was reported flaky from time to time. It always fails at the udp test and complains about the bpf@tc-ingress got a skb->tstamp when handling udp packet. It is unexpected because the skb->tstamp should have been cleared when crossing different netns. The most likely cause is that the skb is actually a tcp packet from the earlier tcp test. It could be the final TCP_FIN handling. This patch tightens the skb->tstamp check in the bpf prog. It ensures the skb is the current testing traffic. First, it checks that skb matches the IPPROTO of the running test (i.e. tcp vs udp). Second, it checks the server port (dst_ns_port). The server port is unique for each test (50000 + test_enum). Also fixed a typo in test_udp_dtime(): s/P100/P101/ Fixes: c803475fd8dd ("bpf: selftests: test skb->tstamp in redirect_neigh") Reported-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20220601234050.2572671-1-kafai@fb.com
Diffstat (limited to 'tools/lib/bpf/libbpf_internal.h')
0 files changed, 0 insertions, 0 deletions