[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ8uoz19edB3d=wHhVAbHf-QhNhyNz7gUciXfZ=_f0boXJBoyA@mail.gmail.com>
Date: Thu, 10 Aug 2023 14:41:02 +0200
From: Magnus Karlsson <magnus.karlsson@...il.com>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: "Karlsson, Magnus" <magnus.karlsson@...el.com>, "bjorn@...nel.org" <bjorn@...nel.org>,
"ast@...nel.org" <ast@...nel.org>, "daniel@...earbox.net" <daniel@...earbox.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Fijalkowski, Maciej" <maciej.fijalkowski@...el.com>, "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"yhs@...com" <yhs@...com>, "andrii@...nel.org" <andrii@...nel.org>,
"martin.lau@...ux.dev" <martin.lau@...ux.dev>, "song@...nel.org" <song@...nel.org>,
"john.fastabend@...il.com" <john.fastabend@...il.com>, "kpsingh@...nel.org" <kpsingh@...nel.org>,
"sdf@...gle.com" <sdf@...gle.com>, "haoluo@...gle.com" <haoluo@...gle.com>,
"jolsa@...nel.org" <jolsa@...nel.org>
Subject: Re: [PATCH bpf-next 10/10] selftests/xsk: display command line
options with -h
On Thu, 10 Aug 2023 at 14:19, Przemek Kitszel
<przemyslaw.kitszel@...el.com> wrote:
>
> On 8/9/23 14:43, Magnus Karlsson wrote:
> > From: Magnus Karlsson <magnus.karlsson@...el.com>
> >
> > Add the -h option to display all available command line options
> > available for test_xsk.sh and xskxceiver.
> >
> > Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>
> > ---
> > tools/testing/selftests/bpf/test_xsk.sh | 11 ++++++++++-
> > 1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/bpf/test_xsk.sh
> > index 94b4b86d5239..baaeb016d699 100755
> > --- a/tools/testing/selftests/bpf/test_xsk.sh
> > +++ b/tools/testing/selftests/bpf/test_xsk.sh
> > @@ -79,12 +79,15 @@
> > #
> > # Run a specific test from the test suite
> > # sudo ./test_xsk.sh -t TEST_NAME
> > +#
> > +# Display the available command line options
> > +# sudo ./test_xsk.sh -h
>
> any "help" / "list" commands (that do nothing but print) should be (able
> ot) execute/d without `sudo`.
> Removing `sudo` part from the doc here would make it clear to reader too.
You are correct. Will remove the "sudo" here as it is not needed.
Would be nice if we could execute the list option (-l) without sudo
rights too since it does not involve creating any xsk sockets. Will
fix that in patch 6.
> >
> > . xsk_prereqs.sh
> >
> > ETH=""
> >
> > -while getopts "vi:dm:lt:" flag
> > +while getopts "vi:dm:lt:h" flag
> > do
> > case "${flag}" in
> > v) verbose=1;;
> > @@ -93,6 +96,7 @@ do
> > m) MODE=${OPTARG};;
> > l) list=1;;
> > t) TEST=${OPTARG};;
> > + h) help=1;;
> > esac
> > done
> >
> > @@ -140,6 +144,11 @@ setup_vethPairs() {
> > ip link set ${VETH0} up
> > }
> >
> > +if [[ $help -eq 1 ]]; then
> > + ./${XSKOBJ}
> > + exit
> > +fi
> > +
> > if [ ! -z $ETH ]; then
> > VETH0=${ETH}
> > VETH1=${ETH}
>
Powered by blists - more mailing lists