bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yafang Shao <laoar.shao@gmail.com>
To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	kafai@fb.com, songliubraving@fb.com, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@kernel.org
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	Yafang Shao <laoar.shao@gmail.com>
Subject: [PATCH 0/4] bpf: Add more information into bpffs
Date: Fri, 11 Feb 2022 12:11:41 +0000	[thread overview]
Message-ID: <20220211121145.35237-1-laoar.shao@gmail.com> (raw)

We have a bpf manager (bpfman) running on the host to maintain the
lifecycle of all the bpf progs and maps on this host.

The purpose of the bpfman includes,
- pin and unpin bpf progs and maps
- attach and detach bpf progs
- update running bpf progs and the related bpf maps
- update some running bpf progs only without updating the related bpf
  maps
- check the possible conflict of bpf progs
- etc

In order to safely do these works, we used many tools to get the
required information, like bpftool and some other customized tools. Some
of these works seem a little heavy. After the preloaded progs.debug and
maps.debug are introduced, we decided to improve these two files to get
the full view of progs and maps that required by bpfman.

This patchset includes below features,
- the pinned file of progs and maps are introduced into these two files
- the relateship of progs and maps is introduced into progs.debug

With these features we may also improve how bpftool get the pinned
file[1] in the next step.

[1]. https://github.com/torvalds/linux/blob/master/tools/bpf/bpftool/prog.c#L648

Yafang Shao (4):
  bpf: Add pin_name into struct bpf_prog_aux
  bpf: Add pin_name into struct bpf_map
  bpf: show pinned file name in {progs, maps}.debug
  bpf: Show the used maps of each prog in progs.debug

 include/linux/bpf.h                           |   3 +
 include/uapi/linux/bpf.h                      |   1 +
 kernel/bpf/inode.c                            |  29 +-
 kernel/bpf/preload/iterators/iterators.bpf.c  |  33 +-
 kernel/bpf/preload/iterators/iterators.skel.h | 676 +++++++++++++++-----------
 5 files changed, 460 insertions(+), 282 deletions(-)

-- 
1.8.3.1


             reply	other threads:[~2022-02-11 12:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 12:11 Yafang Shao [this message]
2022-02-11 12:11 ` [PATCH 1/4] bpf: Add pin_name into struct bpf_prog_aux Yafang Shao
2022-02-11 12:43   ` Daniel Borkmann
2022-02-11 12:44     ` Daniel Borkmann
2022-02-13 11:28       ` Yafang Shao
2022-02-13 11:27     ` Yafang Shao
2022-02-11 17:58   ` kernel test robot
2022-02-13 11:29     ` Yafang Shao
2022-02-11 12:11 ` [PATCH 2/4] bpf: Add pin_name into struct bpf_map Yafang Shao
2022-02-11 12:11 ` [PATCH 3/4] bpf: Show pinned file name in {progs, maps}.debug Yafang Shao
2022-02-11 12:11 ` [PATCH 4/4] bpf: Show the used maps of each prog in progs.debug Yafang Shao

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=20220211121145.35237-1-laoar.shao@gmail.com \
    --to=laoar.shao@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --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;
as well as URLs for NNTP newsgroup(s).