bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>, davem@davemloft.net
Cc: torvalds@linux-foundation.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v4 bpf-next 3/4] bpf: Add kernel module with user mode driver that populates bpffs.
Date: Thu, 30 Jul 2020 01:06:17 +0200	[thread overview]
Message-ID: <cbf754f2-714f-1493-09c9-b01cc4c3f70d@iogearbox.net> (raw)
In-Reply-To: <20200724203830.81531-4-alexei.starovoitov@gmail.com>

On 7/24/20 10:38 PM, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> Add kernel module with user mode driver that populates bpffs with
> BPF iterators.
> 
> $ mount bpffs /my/bpffs/ -t bpf
> $ ls -la /my/bpffs/
> total 4
> drwxrwxrwt  2 root root    0 Jul  2 00:27 .
> drwxr-xr-x 19 root root 4096 Jul  2 00:09 ..
> -rw-------  1 root root    0 Jul  2 00:27 maps.debug
> -rw-------  1 root root    0 Jul  2 00:27 progs.debug
> 
> The user mode driver will load BPF Type Formats, create BPF maps, populate BPF
> maps, load two BPF programs, attach them to BPF iterators, and finally send two
> bpf_link IDs back to the kernel.
> The kernel will pin two bpf_links into newly mounted bpffs instance under
> names "progs.debug" and "maps.debug". These two files become human readable.
> 
> $ cat /my/bpffs/progs.debug
>    id name            attached
>    11 dump_bpf_map    bpf_iter_bpf_map
>    12 dump_bpf_prog   bpf_iter_bpf_prog
>    27 test_pkt_access
>    32 test_main       test_pkt_access test_pkt_access
>    33 test_subprog1   test_pkt_access_subprog1 test_pkt_access
>    34 test_subprog2   test_pkt_access_subprog2 test_pkt_access
>    35 test_subprog3   test_pkt_access_subprog3 test_pkt_access
>    36 new_get_skb_len get_skb_len test_pkt_access
>    37 new_get_skb_ifindex get_skb_ifindex test_pkt_access
>    38 new_get_constant get_constant test_pkt_access
> 
> The BPF program dump_bpf_prog() in iterators.bpf.c is printing this data about
> all BPF programs currently loaded in the system. This information is unstable
> and will change from kernel to kernel as ".debug" suffix conveys.
> 
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Looks like this needs one last respin, but either way the module handling looks much
cleaner now, Ack.

Thanks,
Daniel

  reply	other threads:[~2020-07-29 23:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 20:38 [PATCH v4 bpf-next 0/4] bpf: Populate bpffs with map and prog iterators Alexei Starovoitov
2020-07-24 20:38 ` [PATCH v4 bpf-next 1/4] bpf: Factor out bpf_link_get_by_id() helper Alexei Starovoitov
2020-07-29 22:25   ` Song Liu
2020-07-24 20:38 ` [PATCH v4 bpf-next 2/4] bpf: Add BPF program and map iterators as built-in BPF programs Alexei Starovoitov
2020-07-29 18:21   ` Andrii Nakryiko
2020-07-24 20:38 ` [PATCH v4 bpf-next 3/4] bpf: Add kernel module with user mode driver that populates bpffs Alexei Starovoitov
2020-07-29 23:06   ` Daniel Borkmann [this message]
2020-07-24 20:38 ` [PATCH v4 bpf-next 4/4] selftests/bpf: Add bpffs preload test Alexei Starovoitov

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=cbf754f2-714f-1493-09c9-b01cc4c3f70d@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 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).