Re: [PATCH bpf-next v2 1/4] bpf: sockmap, add test for sk_msg prog pop msg helper

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

 



On Wed, Jan 24, 2024 at 10:54 AM -08, John Fastabend wrote:
> For msg_pop sk_msg helpers we only have older tests in test_sockmap, but
> these are showing their age. They don't use any of the newer style BPF
> and also require running test_sockmap. Lets use the prog_test framework
> and add a test for msg_pop.
>
> This is a much nicer test env using newer style BPF. We can
> extend this to support all the other helpers shortly.
>
> The bpf program is a template that lets us run through all the helpers
> so we can cover not just pop, but all the other helpers as well.
>
> Signed-off-by: John Fastabend <john.fastabend@xxxxxxxxx>
> ---
>  .../bpf/prog_tests/sockmap_helpers.h          |  10 +
>  .../bpf/prog_tests/sockmap_msg_helpers.c      | 210 ++++++++++++++++++
>  .../bpf/progs/test_sockmap_msg_helpers.c      |  52 +++++
>  3 files changed, 272 insertions(+)
>  create mode 100644 tools/testing/selftests/bpf/prog_tests/sockmap_msg_helpers.c
>  create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_msg_helpers.c
>

[...]

> diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_msg_helpers.c b/tools/testing/selftests/bpf/prog_tests/sockmap_msg_helpers.c
> new file mode 100644
> index 000000000000..9ffe02f45808
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_msg_helpers.c
> @@ -0,0 +1,210 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (c) 2020 Cloudflare

Thanks, but we can't take the credit for this brand new file ;-)

> +#include <error.h>
> +#include <netinet/tcp.h>
> +#include <sys/epoll.h>
> +
> +#include "test_progs.h"
> +#include "test_sockmap_msg_helpers.skel.h"
> +#include "sockmap_helpers.h"
> +
> +#define TCP_REPAIR		19	/* TCP sock is under repair right now */
> +
> +#define TCP_REPAIR_ON		1
> +#define TCP_REPAIR_OFF_NO_WP	-1	/* Turn off without window probes */

These defines are not unused by this module. Copy-pasted by mistake?

[...]

> diff --git a/tools/testing/selftests/bpf/progs/test_sockmap_msg_helpers.c b/tools/testing/selftests/bpf/progs/test_sockmap_msg_helpers.c
> new file mode 100644
> index 000000000000..c721a00b6001
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/test_sockmap_msg_helpers.c
> @@ -0,0 +1,52 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (c) 2020 Cloudflare

^ :-)

[...]




[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