Re: [bpf-next PATCH v2 5/5] selftest/bpf: Use global variables instead of maps for test_tcpbpf_kern

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 31, 2020 at 11:52 AM Alexander Duyck
<alexander.duyck@xxxxxxxxx> wrote:
>
> From: Alexander Duyck <alexanderduyck@xxxxxx>
>
> 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 <kafai@xxxxxx>
> Signed-off-by: Alexander Duyck <alexanderduyck@xxxxxx>
> ---
>  .../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;
>

[...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux