bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/3] bpftool: match programs and maps by names
@ 2019-12-13 19:09 Paul Chaignon
  2019-12-13 19:10 ` [PATCH bpf-next v2 1/3] bpftool: match several programs with same tag Paul Chaignon
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Paul Chaignon @ 2019-12-13 19:09 UTC (permalink / raw)
  To: bpf
  Cc: Quentin Monnet, paul.chaignon, netdev, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	Andrii Nakryiko

When working with frequently modified BPF programs, both the ID and the
tag may change.  bpftool currently doesn't provide a "stable" way to match
such programs.  This patchset allows bpftool to match programs and maps by
name.

When given a tag that matches several programs, bpftool currently only
considers the first match.  The first patch changes that behavior to
either process all matching programs (for the show and dump commands) or
error out.  The second patch implements program lookup by name, with the
same behavior as for tags in case of ambiguity.  The last patch implements
map lookup by name.

Changelogs:
  Changes in v2:
    - Fix buffer overflow after realloc.
    - Add example output to commit message.
    - Properly close JSON arrays on errors.
    - Fix style errors (line breaks, for loops, exit labels, type for
      tagname).
    - Move do_show code for argc == 2 to do_show_subset functions.
    - Rebase.

Paul Chaignon (3):
  bpftool: match several programs with same tag
  bpftool: match programs by name
  bpftool: match maps by name

 .../bpf/bpftool/Documentation/bpftool-map.rst |  12 +-
 .../bpftool/Documentation/bpftool-prog.rst    |  18 +-
 tools/bpf/bpftool/bash-completion/bpftool     | 145 ++++++-
 tools/bpf/bpftool/main.h                      |   4 +-
 tools/bpf/bpftool/map.c                       | 384 +++++++++++++----
 tools/bpf/bpftool/prog.c                      | 388 ++++++++++++------
 6 files changed, 737 insertions(+), 214 deletions(-)

-- 
2.24.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-18 19:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13 19:09 [PATCH bpf-next v2 0/3] bpftool: match programs and maps by names Paul Chaignon
2019-12-13 19:10 ` [PATCH bpf-next v2 1/3] bpftool: match several programs with same tag Paul Chaignon
2019-12-13 19:10 ` [PATCH bpf-next v2 2/3] bpftool: match programs by name Paul Chaignon
2019-12-13 19:10 ` [PATCH bpf-next v2 3/3] bpftool: match maps " Paul Chaignon
2019-12-15 17:40 ` [PATCH bpf-next v2 0/3] bpftool: match programs and maps by names Alexei Starovoitov
2019-12-18 19:29   ` Paul Chaignon

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).