]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: add map create command
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 15 Oct 2018 23:30:36 +0000 (16:30 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 15 Oct 2018 23:39:21 +0000 (16:39 -0700)
commitafbf4682a873fa9298c6d919760d69ebad7a2d7c
treed823270ded921a40ce37d54b4bdfbf607c8f402b
parent0c35c26010653e5302ed2dc24691207d5cfbc89a
tools: bpftool: add map create command

Add a way of creating maps from user space.  The command takes
as parameters most of the attributes of the map creation system
call command.  After map is created its pinned to bpffs.  This makes
it possible to easily and dynamically (without rebuilding programs)
test various corner cases related to map creation.

Map type names are taken from bpftool's array used for printing.
In general these days we try to make use of libbpf type names, but
there are no map type names in libbpf as of today.

As with most features I add the motivation is testing (offloads) :)

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/Documentation/bpftool-map.rst
tools/bpf/bpftool/Documentation/bpftool.rst
tools/bpf/bpftool/bash-completion/bpftool
tools/bpf/bpftool/common.c
tools/bpf/bpftool/main.h
tools/bpf/bpftool/map.c