OpenCloudOS-Kernel/tools/lib/bpf
Joe Stringer d5148d8554 tools lib bpf: Add bpf_object__pin()
Add a new API to pin a BPF object to the filesystem. The user can
specify the path within a BPF filesystem to pin the object.
Programs will be pinned under a subdirectory named the same as the
program, with each instance appearing as a numbered file under that
directory, and maps will be pinned under the path using the name of
the map as the file basename.

For example, with the directory '/sys/fs/bpf/foo' and a BPF object which
contains two instances of a program named 'bar', and a map named 'baz':

/sys/fs/bpf/foo/bar/0
/sys/fs/bpf/foo/bar/1
/sys/fs/bpf/foo/baz

Signed-off-by: Joe Stringer <joe@ovn.org>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-4-joe@ovn.org
[ Check snprintf >= for truncation, as snprintf(bf, size, ...) == size also means truncation ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-01-31 16:20:06 -03:00
..
.gitignore tools lib bpf: Change FEATURE-DUMP to FEATURE-DUMP.libbpf 2015-11-05 12:47:51 -03:00
Build bpf tools: Add bpf.c/h for common bpf operations 2015-08-07 10:16:58 -03:00
Makefile make use of make variable CURDIR instead of calling pwd 2016-12-11 12:12:56 +01:00
bpf.c tools lib bpf: Add bpf_prog_{attach,detach} 2016-12-20 12:00:39 -03:00
bpf.h tools lib bpf: Add bpf_prog_{attach,detach} 2016-12-20 12:00:39 -03:00
libbpf.c tools lib bpf: Add bpf_object__pin() 2017-01-31 16:20:06 -03:00
libbpf.h tools lib bpf: Add bpf_object__pin() 2017-01-31 16:20:06 -03:00