All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Weqaar Janjua <weqaar.janjua@gmail.com>, <bpf@vger.kernel.org>,
	<netdev@vger.kernel.org>, <daniel@iogearbox.net>,
	<ast@kernel.org>, <magnus.karlsson@gmail.com>,
	<bjorn.topel@intel.com>
Cc: Weqaar Janjua <weqaar.a.janjua@intel.com>, <shuah@kernel.org>,
	<skhan@linuxfoundation.org>, <linux-kselftest@vger.kernel.org>,
	<anders.roxell@linaro.org>, <jonathan.lemon@gmail.com>
Subject: Re: [PATCH bpf-next v2 2/5] selftests/bpf: xsk selftests - SKB POLL, NOPOLL
Date: Fri, 20 Nov 2020 10:54:09 -0800	[thread overview]
Message-ID: <c73ca08d-4eae-c56f-f5fe-b4dd1440773b@fb.com> (raw)
In-Reply-To: <20201120130026.19029-3-weqaar.a.janjua@intel.com>



On 11/20/20 5:00 AM, Weqaar Janjua wrote:
> Adds following tests:
> 
> 1. AF_XDP SKB mode
>     Generic mode XDP is driver independent, used when the driver does
>     not have support for XDP. Works on any netdevice using sockets and
>     generic XDP path. XDP hook from netif_receive_skb().
>     a. nopoll - soft-irq processing
>     b. poll - using poll() syscall
> 
> Signed-off-by: Weqaar Janjua <weqaar.a.janjua@intel.com>
> ---
>   tools/testing/selftests/bpf/Makefile          |   5 +-
>   .../selftests/bpf/test_xsk_prerequisites.sh   |  15 +-
>   .../selftests/bpf/test_xsk_skb_nopoll.sh      |  20 +
>   ..._xsk_framework.sh => test_xsk_skb_poll.sh} |  12 +-
>   tools/testing/selftests/bpf/xdpxceiver.c      | 961 ++++++++++++++++++
>   tools/testing/selftests/bpf/xdpxceiver.h      | 151 +++
>   tools/testing/selftests/bpf/xsk_env.sh        |  17 +
>   7 files changed, 1174 insertions(+), 7 deletions(-)
>   create mode 100755 tools/testing/selftests/bpf/test_xsk_skb_nopoll.sh
>   rename tools/testing/selftests/bpf/{test_xsk_framework.sh => test_xsk_skb_poll.sh} (61%)
>   create mode 100644 tools/testing/selftests/bpf/xdpxceiver.c
>   create mode 100644 tools/testing/selftests/bpf/xdpxceiver.h
> 
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 51436db24f32..17af570a32d7 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -73,7 +73,8 @@ TEST_PROGS := test_kmod.sh \
>   	test_bpftool.sh \
>   	test_bpftool_metadata.sh \
>   	test_xsk_prerequisites.sh \
> -	test_xsk_framework.sh
> +	test_xsk_skb_nopoll.sh \
> +	test_xsk_skb_poll.sh
>   
>   TEST_PROGS_EXTENDED := with_addr.sh \
>   	with_tunnels.sh \
> @@ -84,7 +85,7 @@ TEST_PROGS_EXTENDED := with_addr.sh \
>   # Compile but not part of 'make run_tests'
>   TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
>   	flow_dissector_load test_flow_dissector test_tcp_check_syncookie_user \
> -	test_lirc_mode2_user xdping test_cpp runqslower bench
> +	test_lirc_mode2_user xdping test_cpp runqslower bench xdpxceiver
>   
>   TEST_CUSTOM_PROGS = urandom_read
>   
> diff --git a/tools/testing/selftests/bpf/test_xsk_prerequisites.sh b/tools/testing/selftests/bpf/test_xsk_prerequisites.sh
> index 00bfcf53127c..a9ce8887dffc 100755
> --- a/tools/testing/selftests/bpf/test_xsk_prerequisites.sh
> +++ b/tools/testing/selftests/bpf/test_xsk_prerequisites.sh
> @@ -8,8 +8,17 @@
>   #
>   # Topology:
>   # ---------
> -#      -----------           -----------
> -#      |  xskX   | --------- |  xskY   |
> +#                 -----------
> +#               _ | Process | _
> +#              /  -----------  \
> +#             /        |        \
> +#            /         |         \
> +#      -----------     |     -----------
> +#      | Thread1 |     |     | Thread2 |
> +#      -----------     |     -----------
> +#           |          |          |
> +#      -----------     |     -----------
> +#      |  xskX   |     |     |  xskY   |
>   #      -----------     |     -----------
>   #           |          |          |
>   #      -----------     |     ----------
> @@ -40,6 +49,8 @@
>   #       conflict with any existing interface
>   #   * tests the veth and xsk layers of the topology
>   #
> +# See the source xdpxceiver.c for information on each test
> +#
>   # Kernel configuration:
>   # ---------------------
>   # See "config" file for recommended kernel config options.
> diff --git a/tools/testing/selftests/bpf/test_xsk_skb_nopoll.sh b/tools/testing/selftests/bpf/test_xsk_skb_nopoll.sh
> new file mode 100755
> index 000000000000..96600b0f5136
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/test_xsk_skb_nopoll.sh
> @@ -0,0 +1,20 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright(c) 2020 Intel Corporation.
> +
> +# See test_xsk_prerequisites.sh for detailed information on tests
> +
> +. xsk_prereqs.sh
> +. xsk_env.sh
> +
> +TEST_NAME="SKB NOPOLL"
> +
> +vethXDPgeneric ${VETH0} ${VETH1} ${NS1}
> +
> +params=("-S")
> +execxdpxceiver params
> +
> +retval=$?
> +test_status $retval "${TEST_NAME}"
> +
> +test_exit $retval 0
> diff --git a/tools/testing/selftests/bpf/test_xsk_framework.sh b/tools/testing/selftests/bpf/test_xsk_skb_poll.sh
> similarity index 61%
> rename from tools/testing/selftests/bpf/test_xsk_framework.sh
> rename to tools/testing/selftests/bpf/test_xsk_skb_poll.sh
> index 2e3f099d001c..d152c8a24251 100755
> --- a/tools/testing/selftests/bpf/test_xsk_framework.sh
> +++ b/tools/testing/selftests/bpf/test_xsk_skb_poll.sh
> @@ -7,11 +7,17 @@
>   . xsk_prereqs.sh
>   . xsk_env.sh

Here both xsk_prereqs.sh and xsk_env.sh are executed.
But xsk_env.sh also calls xsk_prereqs.sh. This double
execution of xsk_prereqs.sh is required or is an
oversight?

>   
> -TEST_NAME="XSK FRAMEWORK"
> +TEST_NAME="SKB POLL"
>   
> -test_status $ksft_pass "${TEST_NAME}"
> +vethXDPgeneric ${VETH0} ${VETH1} ${NS1}
> +
> +params=("-S" "-p")
> +execxdpxceiver params
> +
> +retval=$?
> +test_status $retval "${TEST_NAME}"
>   
>   # Must be called in the last test to execute
>   cleanup_exit ${VETH0} ${VETH1} ${NS1}
>   
> -test_exit $ksft_pass 0
> +test_exit $retval 0
> diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c
[...]

  reply	other threads:[~2020-11-20 18:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 13:00 [PATCH bpf-next v2 0/5] selftests/bpf: xsk selftests Weqaar Janjua
2020-11-20 13:00 ` [PATCH bpf-next v2 1/5] selftests/bpf: xsk selftests framework Weqaar Janjua
2020-11-20 13:00 ` [PATCH bpf-next v2 2/5] selftests/bpf: xsk selftests - SKB POLL, NOPOLL Weqaar Janjua
2020-11-20 18:54   ` Yonghong Song [this message]
2020-11-20 19:34     ` Weqaar Janjua
2020-11-20 13:00 ` [PATCH bpf-next v2 3/5] selftests/bpf: xsk selftests - DRV " Weqaar Janjua
2020-11-20 13:00 ` [PATCH bpf-next v2 4/5] selftests/bpf: xsk selftests - Socket Teardown - SKB, DRV Weqaar Janjua
2020-11-20 13:00 ` [PATCH bpf-next v2 5/5] selftests/bpf: xsk selftests - Bi-directional Sockets " Weqaar Janjua
2020-11-20 20:45   ` Yonghong Song
2020-11-21 20:14     ` Weqaar Janjua
2020-11-24 15:11       ` Weqaar Janjua
2020-11-24 17:09         ` Yonghong Song
2020-11-24 22:28           ` Weqaar Janjua
2020-11-21  0:31 ` [PATCH bpf-next v2 0/5] selftests/bpf: xsk selftests Yonghong Song
2020-11-23 12:20   ` Björn Töpel
2020-11-23 13:15     ` Björn Töpel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c73ca08d-4eae-c56f-f5fe-b4dd1440773b@fb.com \
    --to=yhs@fb.com \
    --cc=anders.roxell@linaro.org \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jonathan.lemon@gmail.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=magnus.karlsson@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=weqaar.a.janjua@intel.com \
    --cc=weqaar.janjua@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.