mbox series

[bpf-next,v3,0/2] bpftool support for sockmap use cases

Message ID 20181015181857.8673.46183.stgit@john-Precision-Tower-5810
Headers show
Series bpftool support for sockmap use cases | expand

Message

John Fastabend Oct. 15, 2018, 6:19 p.m. UTC
The first patch adds support for attaching programs to maps. This is
needed to support sock{map|hash} use from bpftool. Currently, I carry
around custom code to do this so doing it using standard bpftool will
be great.

The second patch adds a compat mode to ignore non-zero entries in
the map def. This allows using bpftool with maps that have a extra
fields that the user knows can be ignored. This is needed to work
correctly with maps being loaded by other tools or directly via
syscalls.

v3: add bash completion and doc updates for --mapcompat

---

John Fastabend (2):
      bpf: bpftool, add support for attaching programs to maps
      bpf: bpftool, add flag to allow non-compat map definitions


 tools/bpf/bpftool/Documentation/bpftool-prog.rst |   11 ++
 tools/bpf/bpftool/Documentation/bpftool.rst      |    6 +
 tools/bpf/bpftool/bash-completion/bpftool        |   21 ++++-
 tools/bpf/bpftool/main.c                         |    7 +-
 tools/bpf/bpftool/main.h                         |    3 -
 tools/bpf/bpftool/prog.c                         |  101 ++++++++++++++++++++++
 6 files changed, 142 insertions(+), 7 deletions(-)

--
Signature

Comments

Alexei Starovoitov Oct. 15, 2018, 11:17 p.m. UTC | #1
On Mon, Oct 15, 2018 at 11:19:44AM -0700, John Fastabend wrote:
> The first patch adds support for attaching programs to maps. This is
> needed to support sock{map|hash} use from bpftool. Currently, I carry
> around custom code to do this so doing it using standard bpftool will
> be great.
> 
> The second patch adds a compat mode to ignore non-zero entries in
> the map def. This allows using bpftool with maps that have a extra
> fields that the user knows can be ignored. This is needed to work
> correctly with maps being loaded by other tools or directly via
> syscalls.
> 
> v3: add bash completion and doc updates for --mapcompat

Applied, Thanks