On 06/17/2019 11:17 PM, Daniel Borkmann wrote: > On 06/17/2019 09:26 PM, Andrii Nakryiko wrote: >> This patch set implements initial version (as discussed at LSF/MM2019 >> conference) of a new way to specify BPF maps, relying on BTF type information, >> which allows for easy extensibility, preserving forward and backward >> compatibility. See details and examples in description for patch #6. >> >> [0] contains an outline of follow up extensions to be added after this basic >> set of features lands. They are useful by itself, but also allows to bring >> libbpf to feature-parity with iproute2 BPF loader. That should open a path >> forward for BPF loaders unification. >> >> Patch #1 centralizes commonly used min/max macro in libbpf_internal.h. >> Patch #2 extracts .BTF and .BTF.ext loading loging from elf_collect(). >> Patch #3 simplifies elf_collect() error-handling logic. >> Patch #4 refactors map initialization logic into user-provided maps and global >> data maps, in preparation to adding another way (BTF-defined maps). >> Patch #5 adds support for map definitions in multiple ELF sections and >> deprecates bpf_object__find_map_by_offset() API which doesn't appear to be >> used anymore and makes assumption that all map definitions reside in single >> ELF section. >> Patch #6 splits BTF intialization from sanitization/loading into kernel to >> preserve original BTF at the time of map initialization. >> Patch #7 adds support for BTF-defined maps. >> Patch #8 adds new test for BTF-defined map definition. >> Patches #9-11 convert test BPF map definitions to use BTF way. LGTM as a base, applied 1-10 as per Stanislav's concern, added Song's Ack to patch 10, and fixed up typos in patch 2 while at it.