On Sat, Oct 31, 2020 at 11:52 AM Alexander Duyck
<[email protected]> wrote:
>
> From: Alexander Duyck <[email protected]>
>
> Use global variables instead of global_map and sockopt_results_map to track
> test data. Doing this greatly simplifies the code as there is not need to
> take the extra steps of updating the maps or looking up elements.
>
> Suggested-by: Martin KaFai Lau <[email protected]>
> Signed-off-by: Alexander Duyck <[email protected]>
> ---
> .../testing/selftests/bpf/prog_tests/tcpbpf_user.c | 53 ++++--------
> .../testing/selftests/bpf/progs/test_tcpbpf_kern.c | 86
> +++-----------------
> tools/testing/selftests/bpf/test_tcpbpf.h | 2
> 3 files changed, 31 insertions(+), 110 deletions(-)
[...]
> -}
> -
> +struct tcpbpf_globals global = { 0 };
nit: = {0} notation is misleading, just = {}; is equivalent and IMO better.
But don't bother if it's the only change you need to do for the next version.
> int _version SEC("version") = 1;
>
[...]