All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: "Daniel T. Lee" <danieltimlee@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Networking <netdev@vger.kernel.org>
Subject: Re: [PATCH 0/2] tools: bpftool: add net (un)load command to load XDP
Date: Tue, 30 Jul 2019 13:04:00 -0700	[thread overview]
Message-ID: <CAEf4BzZTNTdiHs1VYzeKSBGka8ayq_9WCf5cJxzW94nR3FOFQQ@mail.gmail.com> (raw)
In-Reply-To: <20190730184821.10833-1-danieltimlee@gmail.com>

On Tue, Jul 30, 2019 at 11:48 AM Daniel T. Lee <danieltimlee@gmail.com> wrote:
>
> Currently, bpftool net only supports dumping progs loaded on the
> interface. To load XDP prog on interface, user must use other tool
> (eg. iproute2). By this patch, with `bpftool net (un)load`, user can
> (un)load XDP prog on interface.
>
>     $ ./bpftool prog
>     ...
>     208: xdp  name xdp_prog1  tag ad822e38b629553f  gpl
>       loaded_at 2019-07-28T18:03:11+0900  uid 0
>     ...
>     $ ./bpftool net load id 208 xdpdrv enp6s0np1
>     $ ./bpftool net
>     xdp:
>     enp6s0np1(5) driver id 208
>     ...
>     $ ./bpftool net unload xdpdrv enp6s0np1
>     $ ./bpftool net
>     xdp:
>     ...
>
> The word 'load' is used instead of 'attach', since XDP program is not

Let's be consistent and "attach" everything. Tracing BPF programs
(kprobe, tracepoints) are also not attached with BPF_PROG_ATTACH, but
it's still a process of attaching BPF program to a BPF hook (a point
in the system which can execute BPF program).

Even better, if you can check what we recently did for tracing APIs
with struct bpf_link and can add similar APIs for XDP programs, it
would be a nice step towards consistency of APIs (and terminology as
well). Please consider doing that. Thanks!

> considered as 'bpf_attach_type' and can't be attached with
> 'BPF_PROG_ATTACH'. In this context, the meaning of 'load' is, prog will
> be loaded on interface.
>
> While this patch only contains support for XDP, through `net (un)load`,
> bpftool can further support other prog attach types.
>
> XDP (un)load tested on Netronome Agilio.
>
> Daniel T. Lee (2):
>   tools: bpftool: add net load command to load XDP on interface
>   tools: bpftool: add net unload command to unload XDP on interface
>
>  tools/bpf/bpftool/net.c | 160 +++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 159 insertions(+), 1 deletion(-)
>
> --
> 2.20.1
>

  parent reply	other threads:[~2019-07-30 20:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 18:48 [PATCH 0/2] tools: bpftool: add net (un)load command to load XDP Daniel T. Lee
2019-07-30 18:48 ` [PATCH 1/2] tools: bpftool: add net load command to load XDP on interface Daniel T. Lee
2019-07-31  9:38   ` Jesper Dangaard Brouer
2019-07-31 10:08   ` Jesper Dangaard Brouer
2019-07-31 18:23     ` Daniel T. Lee
2019-07-30 18:48 ` [PATCH 2/2] tools: bpftool: add net unload command to unload " Daniel T. Lee
2019-07-30 20:04 ` Andrii Nakryiko [this message]
2019-07-30 22:59 ` [PATCH 0/2] tools: bpftool: add net (un)load command to load XDP Jakub Kicinski
2019-07-30 23:17   ` Alexei Starovoitov
2019-07-31  0:07     ` Jakub Kicinski
2019-07-31  0:23       ` Alexei Starovoitov
2019-07-31  1:21         ` Jakub Kicinski
2019-07-31  1:52           ` Alexei Starovoitov
2019-07-31  9:29             ` Jesper Dangaard Brouer
2019-07-31 21:59           ` David Ahern

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=CAEf4BzZTNTdiHs1VYzeKSBGka8ayq_9WCf5cJxzW94nR3FOFQQ@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=danieltimlee@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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.