On Sat, Oct 31, 2020 at 11:52 AM Alexander Duyck
<alexander.du...@gmail.com> wrote:
>
> From: Alexander Duyck <alexanderdu...@fb.com>
>
> 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 <ka...@fb.com>
> Signed-off-by: Alexander Duyck <alexanderdu...@fb.com>
> ---
>  .../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;
>

[...]

Reply via email to