netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Quentin Monnet <quentin.monnet@netronome.com>,
	Alexei Starovoitov <ast@kernel.org>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org,
	oss-drivers@netronome.com, Yonghong Song <ys114321@gmail.com>
Subject: Re: [PATCH bpf-next v2] tools: bpftool: add "prog run" subcommand to test-run programs
Date: Fri, 5 Jul 2019 23:58:56 +0200	[thread overview]
Message-ID: <41b3c982-2c4b-ccfc-c548-f70c8fd42f73@iogearbox.net> (raw)
In-Reply-To: <20190705175433.22511-1-quentin.monnet@netronome.com>

On 07/05/2019 07:54 PM, Quentin Monnet wrote:
> Add a new "bpftool prog run" subcommand to run a loaded program on input
> data (and possibly with input context) passed by the user.
> 
> Print output data (and output context if relevant) into a file or into
> the console. Print return value and duration for the test run into the
> console.
> 
> A "repeat" argument can be passed to run the program several times in a
> row.
> 
> The command does not perform any kind of verification based on program
> type (Is this program type allowed to use an input context?) or on data
> consistency (Can I work with empty input data?), this is left to the
> kernel.
> 
> Example invocation:
> 
>     # perl -e 'print "\x0" x 14' | ./bpftool prog run \
>             pinned /sys/fs/bpf/sample_ret0 \
>             data_in - data_out - repeat 5
>     0000000 0000 0000 0000 0000 0000 0000 0000      | ........ ......
>     Return value: 0, duration (average): 260ns
> 
> When one of data_in or ctx_in is "-", bpftool reads from standard input,
> in binary format. Other formats (JSON, hexdump) might be supported (via
> an optional command line keyword like "data_fmt_in") in the future if
> relevant, but this would require doing more parsing in bpftool.
> 
> v2:
> - Fix argument names for function check_single_stdin(). (Yonghong)
> 
> Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Looks great, thanks for adding, applied!

      parent reply	other threads:[~2019-07-05 21:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 17:54 [PATCH bpf-next v2] tools: bpftool: add "prog run" subcommand to test-run programs Quentin Monnet
2019-07-05 18:21 ` Y Song
2019-07-05 21:58 ` Daniel Borkmann [this message]

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=41b3c982-2c4b-ccfc-c548-f70c8fd42f73@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=quentin.monnet@netronome.com \
    --cc=ys114321@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).