mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 00:48:50 +00:00
ef8c84effc
It looks like BPF program that handles BPF_SOCK_OPS_STATE_CB state can race with the bpf_map_lookup_elem("global_map"); I sometimes see the failures in this test and re-running helps. Since we know that we expect the callback to be called 3 times (one time for listener socket, two times for both ends of the connection), let's export this number and add simple retry logic around that. Also, let's make EXPECT_EQ() not return on failure, but continue evaluating all conditions; that should make potential debugging easier. With this fix in place I don't observe the flakiness anymore. Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Cc: Lawrence Brakmo <brakmo@fb.com> Link: https://lore.kernel.org/bpf/20191204190955.170934-1-sdf@google.com
18 lines
335 B
C
18 lines
335 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef _TEST_TCPBPF_H
|
|
#define _TEST_TCPBPF_H
|
|
|
|
struct tcpbpf_globals {
|
|
__u32 event_map;
|
|
__u32 total_retrans;
|
|
__u32 data_segs_in;
|
|
__u32 data_segs_out;
|
|
__u32 bad_cb_test_rv;
|
|
__u32 good_cb_test_rv;
|
|
__u64 bytes_received;
|
|
__u64 bytes_acked;
|
|
__u32 num_listen;
|
|
__u32 num_close_events;
|
|
};
|
|
#endif
|