No description
Find a file
Maciej Żenczykowski 2464ddb0df implement support for functions which may optionally fail to load
This is useful for critical functions with fallbacks, but
may even be useful for non-critical functions, where a function
in the middle of the file may fail to load, but you still want
other (later) functions to be attempted.

Critical applies to the entire .c file (or to be more correct to
the entire resulting .o).  Optional applies to a specific section
of that .o (ie. a specific individual function).

This new optional attribute is necessary to be able to declare
a .c/.o file critical even if *some* of the individual functions
might fail to load due to missing kernel patches.

(Note: we currently have no way to specify a map as optional)

Critical guarantees that all non-optional programs, and all maps,
have been created, pinned, chowned, and chmoded successfully
(or that they already existed).

For an example of use see:
  system/netd/bpf_progs/offload.c

(while at it also add retrieveProgram() and mapRetrieve{RW,RO,WO}()
 helpers to BpfUtils.h)

Test: builds, atest, see paired netd change for extra details
Bug: 150040815
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1336225
Merged-In: I50b292c061b05fc8f4b4b8574f128345c45c78db
Change-Id: I50b292c061b05fc8f4b4b8574f128345c45c78db
2020-06-18 04:19:15 +00:00
bpfloader Warn loudly and do not set bpf.progs_loaded property on critical bpf load failure. 2020-06-15 10:22:36 +00:00
libbpf_android implement support for functions which may optionally fail to load 2020-06-18 04:19:15 +00:00
progs implement support for functions which may optionally fail to load 2020-06-18 04:19:15 +00:00
.clang-format Replace clang-format with symlink. 2019-01-18 14:26:33 -08:00
Android.bp C++17 is the default now. 2018-12-03 09:36:31 -08:00
MODULE_LICENSE_APACHE2 Fix the build problem with bpf project 2018-10-16 21:17:12 -07:00
NOTICE Fix the build problem with bpf project 2018-10-16 21:17:12 -07:00
OWNERS OWNERS: +smoreland +connoro -fengc -joelaf 2020-01-10 15:42:06 -08:00
PREUPLOAD.cfg Fix the build problem with bpf project 2018-10-16 21:17:12 -07:00