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)
commit0b592b5a01bef5416472ec610d3191e019c144a5
treed823270ded921a40ce37d54b4bdfbf607c8f402b
parent2f1d774f7d356a7e95ac7c41373d518cf0d716c7
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