From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Magnus Karlsson <magnus.karlsson@gmail.com>
Cc: <magnus.karlsson@intel.com>, <bjorn@kernel.org>, <ast@kernel.org>,
<daniel@iogearbox.net>, <netdev@vger.kernel.org>,
<bpf@vger.kernel.org>, <yhs@fb.com>, <andrii@kernel.org>,
<martin.lau@linux.dev>, <song@kernel.org>,
<john.fastabend@gmail.com>, <kpsingh@kernel.org>,
<sdf@google.com>, <haoluo@google.com>, <jolsa@kernel.org>,
<przemyslaw.kitszel@intel.com>
Subject: Re: [PATCH bpf-next v2 11/11] selftests/xsk: introduce XSKTEST_ETH environment variable
Date: Fri, 25 Aug 2023 15:19:27 +0200 [thread overview]
Message-ID: <ZOiqX6jMIcHwAwgR@boxer> (raw)
In-Reply-To: <CAJ8uoz2pdVG0K62pQXnm6hgJxnp64eaQmQwNUEzSXX8DpPbSJQ@mail.gmail.com>
On Fri, Aug 25, 2023 at 03:03:58PM +0200, Magnus Karlsson wrote:
> On Fri, 25 Aug 2023 at 14:57, Maciej Fijalkowski
> <maciej.fijalkowski@intel.com> wrote:
> >
> > On Thu, Aug 24, 2023 at 02:28:53PM +0200, Magnus Karlsson wrote:
> > > From: Magnus Karlsson <magnus.karlsson@intel.com>
> > >
> > > Introduce the XSKTEST_ETH environment variable to be able to set the
> > > network interface that should be used for testing.
> > >
> > > Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
> > > ---
> > > tools/testing/selftests/bpf/test_xsk.sh | 20 +++++++++-----------
> > > 1 file changed, 9 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/bpf/test_xsk.sh
> > > index 9ec718043c1a..3e0a2302a185 100755
> > > --- a/tools/testing/selftests/bpf/test_xsk.sh
> > > +++ b/tools/testing/selftests/bpf/test_xsk.sh
> > > @@ -88,14 +88,12 @@
> > >
> > > . xsk_prereqs.sh
> > >
> > > -ETH=""
> > > -
> > > while getopts "vi:dm:lt:h" flag
> > > do
> > > case "${flag}" in
> > > v) verbose=1;;
> > > d) debug=1;;
> > > - i) ETH=${OPTARG};;
> > > + i) XSKTEST_ETH=${OPTARG};;
> > > m) XSKTEST_MODE=${OPTARG};;
> > > l) list=1;;
> > > t) XSKTEST_TEST=${OPTARG};;
> > > @@ -157,9 +155,9 @@ if [[ $help -eq 1 ]]; then
> > > exit
> > > fi
> > >
> > > -if [ ! -z $ETH ]; then
> > > - VETH0=${ETH}
> > > - VETH1=${ETH}
> > > +if [ -n "$XSKTEST_ETH" ]; then
> >
> > Sorry - is point of this patch is just to invert the logic and rename the
> > env var?
>
> The purpose was to make it setable from the outside and give it a name
> that is more descriptive and targeted only to xskxceiver.
and this is accomplished by not having ETH initialized here? What will be
'the outside' ?
Currently I don't see much value within this patch, unless you explain the
need for setting this from outside of this script. Maybe I missed some
discussion from v1. I can live with this variable being ETH, what's more
concerning/confusing to me is that for ZC we have to set VETH0 and VETH1
to ETH and then use that later on.
>
> > > + VETH0=${XSKTEST_ETH}
> > > + VETH1=${XSKTEST_ETH}
> > > else
> > > validate_root_exec
> > > validate_veth_support ${VETH0}
> > > @@ -203,10 +201,10 @@ fi
> > >
> > > exec_xskxceiver
> > >
> > > -if [ -z $ETH ]; then
> > > +if [ -z $XSKTEST_ETH ]; then
> > > cleanup_exit ${VETH0} ${VETH1}
> > > else
> > > - cleanup_iface ${ETH} ${MTU}
> > > + cleanup_iface ${XSKTEST_ETH} ${MTU}
> > > fi
> > >
> > > if [[ $list -eq 1 ]]; then
> > > @@ -216,17 +214,17 @@ fi
> > > TEST_NAME="XSK_SELFTESTS_${VETH0}_BUSY_POLL"
> > > busy_poll=1
> > >
> > > -if [ -z $ETH ]; then
> > > +if [ -z $XSKTEST_ETH ]; then
> > > setup_vethPairs
> > > fi
> > > exec_xskxceiver
> > >
> > > ## END TESTS
> > >
> > > -if [ -z $ETH ]; then
> > > +if [ -z $XSKTEST_ETH ]; then
> > > cleanup_exit ${VETH0} ${VETH1}
> > > else
> > > - cleanup_iface ${ETH} ${MTU}
> > > + cleanup_iface ${XSKTEST_ETH} ${MTU}
> > > fi
> > >
> > > failures=0
> > > --
> > > 2.34.1
> > >
next prev parent reply other threads:[~2023-08-25 13:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 12:28 [PATCH bpf-next v2 00/11] seltests/xsk: various improvements to xskxceiver Magnus Karlsson
2023-08-24 12:28 ` [PATCH bpf-next v2 01/11] selftests/xsk: print per packet info in verbose mode Magnus Karlsson
2023-08-24 12:28 ` [PATCH bpf-next v2 02/11] selftests/xsk: add timeout for Tx thread Magnus Karlsson
2023-08-24 12:28 ` [PATCH bpf-next v2 03/11] selftests/xsk: add option to only run tests in a single mode Magnus Karlsson
2023-08-25 12:02 ` Maciej Fijalkowski
2023-08-25 12:30 ` Magnus Karlsson
2023-08-24 12:28 ` [PATCH bpf-next v2 04/11] selftests/xsk: move all tests to separate functions Magnus Karlsson
2023-08-24 12:28 ` [PATCH bpf-next v2 05/11] selftests/xsk: declare test names in struct Magnus Karlsson
2023-08-25 12:06 ` Maciej Fijalkowski
2023-08-24 12:28 ` [PATCH bpf-next v2 06/11] selftests/xsk: add option that lists all tests Magnus Karlsson
2023-08-24 12:28 ` [PATCH bpf-next v2 07/11] selftests/xsk: add option to run single test Magnus Karlsson
2023-08-25 12:44 ` Maciej Fijalkowski
2023-08-25 12:50 ` Magnus Karlsson
2023-08-24 12:28 ` [PATCH bpf-next v2 08/11] selftests/xsk: use ksft_print_msg uniformly Magnus Karlsson
2023-08-24 12:28 ` [PATCH bpf-next v2 09/11] selftests/xsk: fail single test instead of all tests Magnus Karlsson
2023-08-25 12:48 ` Maciej Fijalkowski
2023-08-24 12:28 ` [PATCH bpf-next v2 10/11] selftests/xsk: display command line options with -h Magnus Karlsson
2023-08-25 12:49 ` Maciej Fijalkowski
2023-08-25 12:54 ` Magnus Karlsson
2023-08-25 13:06 ` Maciej Fijalkowski
2023-08-24 12:28 ` [PATCH bpf-next v2 11/11] selftests/xsk: introduce XSKTEST_ETH environment variable Magnus Karlsson
2023-08-25 12:57 ` Maciej Fijalkowski
2023-08-25 13:03 ` Magnus Karlsson
2023-08-25 13:19 ` Maciej Fijalkowski [this message]
2023-08-25 13:34 ` Magnus Karlsson
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=ZOiqX6jMIcHwAwgR@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=magnus.karlsson@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@intel.com \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=yhs@fb.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.