public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
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 10/11] selftests/xsk: display command line options with -h
Date: Fri, 25 Aug 2023 15:06:35 +0200	[thread overview]
Message-ID: <ZOinW9sc0QpO+1I3@boxer> (raw)
In-Reply-To: <CAJ8uoz1tukkS6MACytUyZtNo9WOzbUR_EBXiZBcc7zhXWefccg@mail.gmail.com>

On Fri, Aug 25, 2023 at 02:54:01PM +0200, Magnus Karlsson wrote:
> On Fri, 25 Aug 2023 at 14:50, Maciej Fijalkowski
> <maciej.fijalkowski@intel.com> wrote:
> >
> > On Thu, Aug 24, 2023 at 02:28:52PM +0200, Magnus Karlsson wrote:
> > > From: Magnus Karlsson <magnus.karlsson@intel.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@intel.com>
> > > ---
> > >  tools/testing/selftests/bpf/test_xsk.sh  | 11 ++++++++++-
> > >  tools/testing/selftests/bpf/xskxceiver.c |  5 ++++-
> > >  2 files changed, 14 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/bpf/test_xsk.sh
> > > index b7186ae48497..9ec718043c1a 100755
> > > --- a/tools/testing/selftests/bpf/test_xsk.sh
> > > +++ b/tools/testing/selftests/bpf/test_xsk.sh
> > > @@ -82,12 +82,15 @@
> > >  #
> > >  # Run a specific test from the test suite
> > >  #   sudo ./test_xsk.sh -t TEST_NAME
> > > +#
> > > +# Display the available command line options
> > > +#   ./test_xsk.sh -h
> > >
> > >  . xsk_prereqs.sh
> > >
> > >  ETH=""
> > >
> > > -while getopts "vi:dm:lt:" flag
> > > +while getopts "vi:dm:lt:h" flag
> > >  do
> > >       case "${flag}" in
> > >               v) verbose=1;;
> > > @@ -96,6 +99,7 @@ do
> > >               m) XSKTEST_MODE=${OPTARG};;
> > >               l) list=1;;
> > >               t) XSKTEST_TEST=${OPTARG};;
> > > +             h) help=1;;
> > >       esac
> > >  done
> > >
> > > @@ -148,6 +152,11 @@ if [[ $list -eq 1 ]]; then
> > >          exit
> > >  fi
> > >
> > > +if [[ $help -eq 1 ]]; then
> > > +     ./${XSKOBJ}
> > > +        exit
> > > +fi
> > > +
> > >  if [ ! -z $ETH ]; then
> > >       VETH0=${ETH}
> > >       VETH1=${ETH}
> > > diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
> > > index 19db9a827c30..9feb476d647f 100644
> > > --- a/tools/testing/selftests/bpf/xskxceiver.c
> > > +++ b/tools/testing/selftests/bpf/xskxceiver.c
> > > @@ -318,6 +318,7 @@ static struct option long_options[] = {
> > >       {"mode", required_argument, 0, 'm'},
> > >       {"list", no_argument, 0, 'l'},
> > >       {"test", required_argument, 0, 't'},
> > > +     {"help", no_argument, 0, 'h'},
> > >       {0, 0, 0, 0}
> > >  };
> > >
> > > @@ -331,7 +332,8 @@ static void print_usage(char **argv)
> > >               "  -b, --busy-poll      Enable busy poll\n"
> > >               "  -m, --mode           Run only mode skb, drv, or zc\n"
> > >               "  -l, --list           List all available tests\n"
> > > -             "  -t, --test           Run a specific test. Enter number from -l option.\n";
> > > +             "  -t, --test           Run a specific test. Enter number from -l option.\n"
> > > +             "  -h, --help           Display this help and exit\n";
> > >
> > >       ksft_print_msg(str, basename(argv[0]));
> > >       ksft_exit_xfail();
> > > @@ -406,6 +408,7 @@ static void parse_command_line(struct ifobject *ifobj_tx, struct ifobject *ifobj
> > >                       if (errno)
> > >                               print_usage(argv);
> > >                       break;
> > > +             case 'h':
> >
> > do you need 'fallthrough' here?
> 
> Did not get any complaints from checkpatch, so do not know since it is
> a case without any content on its own. I would say it is obvious that
> it is "falling through" in this case :-). But I do not know what the
> rule is.

Sorry for the noise it's fine i quickly tested that with
-Wimplicit-fallthrough.

> 
> > >               default:
> > >                       print_usage(argv);
> > >               }
> > > --
> > > 2.34.1
> > >

  reply	other threads:[~2023-08-25 13:07 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 [this message]
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
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=ZOinW9sc0QpO+1I3@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox