This will enable testing both with & without BTF enabled once
necessary build changes are merged.
Test: libbpf_load_test passes
Bug: 203823368
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ifd89b6c0701791c216807e913d9a4803d9a4dd20
bpf_create_map and bpf_prog_load have been renamed, so update those
calls. bcc now depends on upstream libbpf and has deleted its
redundant implementations of bpf_obj_pin and bpf_obj_get, so add
upstream libbpf as a dependency.
Test: m libbpf_android
Bug: 203823368
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I324cab44227b0e2f73873f37a28d640ab2373204
BPF headers used by both platform and mainline modules should be in
frameworks/libs/net.
Bug: 202086915
Test: build and boot
Test: cd packages/modules/Connectivity/netd; atest
Change-Id: Id9ac888d5519b2a8663232610d36386cabfe4e94
This is to prevent a name collision with "upstream"
libbpf (external/libbpf) which is built using the same name.
Bug: 203823368
Test: build cuttlefish
Test: m libbpf_load_test
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I9bb798a9b5d832511bed471f01575bba14a1a9d3
Move BPF map definition and utilities to a common place that easy to be
referenced from both mainline module and platform code.
Bug: 202086915
Test: m; flash; boot
Test: cd system/netd/ && atest
Test: cd packages/modules/Connectivity && atest
Test: m gpuservice_unittest libtimeinstate_test bpf_module_test
CtsAppOpsTestCases libbpf_load_test VtsBootconfigTest
vts_test_binary_bpf_module bpf_benchmark libbpf_load_test
libbpf_android_test
Change-Id: Ib15cf78c2da97bff835fb406c866676eec77c013
The test will be moved to frameworks/libs/net along with header files.
Bug: 202086915
Test: m
Merged-In: I1de9c1f443f8bf90ef341e4867866093e62f427d
Change-Id: I1de9c1f443f8bf90ef341e4867866093e62f427d
Move waitForProgsLoaded() from libbpf_android.h to a single header file.
A transitional commit of separating headers, utilities from bfploader.
Bug: 202086915
Test: build; flash; cd system/netd; atest
Change-Id: Ief1bcd09e973f952c29859a7a8fba92c8626e32d
When fuse-bpf lands in the kernel, support reading its bpf program type
from /sys/fs/fuse/bpf_prog_type_fuse and load such programs.
This is to allow development of fuse-bpf to continue, and is needed
until such time as fuse-bpf is upstreamed and this value is fixed.
Bug: 202785178
Test: Along with change to bpfprogs, prog_fuse_media_fuse_media appears
in /sys/fs/bpf
Change-Id: I83636f25b0a0c678b3ee48c6450d9c8dc157387b
Functions in BpfUtils.cpp are trivial, they can be static inlined
in BpfUtils.h.
Bug: 202086915
Test: m; flash; boot; cd system/netd && atest
Test: m gpuservice_unittest libtimeinstate_test bpf_module_test
CtsAppOpsTestCases libmeminfo_test VtsBootconfigTest
vts_test_binary_bpf_module
Change-Id: Ie1ece23b6fc9a4db5fc95930209a10da1e528cb5
... it does prefix matching - and first match wins.
By appending / to the strings this no longer matters.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I54f41fbccd2632334adb9d1ae4fcc44cd1b0141f
This will allow shipping .o's targetting only T and not S devices.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I651b4442625df9011ff7c5ad283943caae579565
The only purpose of this is to break cut-and-paste of examples
that use SEC() causing people to think things through, look
at Android bpf program examples and use a better macro.
In particular programs with SEC("license") / SEC("maps") need to be
changed to use LICENSE("license") and the map helpers or the map
section is wrong and cannot be correctly parsed by the bpfloader.
Generated via:
git grep 'SEC\(' | cut -d: -f1-2 | while read i; do mcedit $i; done
and manually editting found locations
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Idb333967e054e096fe74f910a5f8aaf1d6c5dc81
Since you cannot include yourself we need an extra level of indirection,
to make sure that OWNERS remains current even in historical branches.
Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie3a4903cd4b115eddb60c75b00534e9a4fdcedda
Needed to not have to carry
https://android-review.googlesource.com/c/kernel/common/+/1886896
for 5.16-rc1+ kernels
We set this before the bpfloader even executes so it will always be
ready before anyone has a chance to use it.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I418a534d6550c5b57286e261e6988d2debdf237f
This also bumps the bpfloader version to 0.3 to signify support
for loading schedact (ie. tc scheduler action) programs.
Test: load netd.o
Change-Id: Ic3fdc80d3f6ea2b42a4f1d6829b1ff12dd4d52c0
This is also bpfloader v0.2.
Some newer map types (for example DEVMAP) are unusable
on older kernel versions.
Bug: 190519702
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1756575
Merged-In: I085cc723ff1c19d8acc8972a391f894e16dd1875
Change-Id: I085cc723ff1c19d8acc8972a391f894e16dd1875