Skip to content

Commit

Permalink
Merge branch 'BTF-map-in-map'
Browse files Browse the repository at this point in the history
Andrii Nakryiko says:

====================
This patch set teaches libbpf how to declare and initialize ARRAY_OF_MAPS and
HASH_OF_MAPS maps. See patch #3 for all the details.

Patch #1 refactors parsing BTF definition of map to re-use it cleanly for
inner map definition parsing.

Patch #2 refactors map creation and destruction logic for reuse. It also fixes
existing bug with not closing successfully created maps when bpf_object map
creation overall fails.

Patch #3 adds support for an extension of BTF-defined map syntax, as well as
parsing, recording, and use of relocations to allow declaratively initialize
outer maps with references to inner maps.

v1->v2:
  - rename __inner to __array (Alexei).
====================

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Alexei Starovoitov committed Apr 29, 2020
2 parents 1f427a8 + 646f02f commit 3271e8f
Show file tree
Hide file tree
Showing 4 changed files with 606 additions and 218 deletions.
1 change: 1 addition & 0 deletions tools/lib/bpf/bpf_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#define __uint(name, val) int (*name)[val]
#define __type(name, val) typeof(val) *name
#define __array(name, val) typeof(val) *name[]

/* Helper macro to print out debug messages */
#define bpf_printk(fmt, ...) \
Expand Down
Loading

0 comments on commit 3271e8f

Please sign in to comment.