The rlimit was recently set to 8MB for bpfloader in
Change Id Ib97d1d304f4ea9a6215afed76e1c1e28f1415221
This could be causing intermittent failures to create maps, let us
increase it to 64MB for bpfloader.
Bug: 134558982
Change-Id: Iabb2e6c7d9ea3843ae28f2c465756e5aacdf1904
Signed-off-by: Joel Fernandes <joelaf@google.com>
Test: treehugger will, plus no other references found by:
repo grep 'unsafe_bpf_map_(lookup|update|delete)_elem'
Bug: 132703771
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I59b8fe8f5a00fd005f466f8f2177a2e01cff58aa
These are apparently not used anywhere, and this can be trivially
confirmed via code search.
Test: builds
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I738c83c1b00bf9a7d7344a4b31bf80581788ec10
delete the loader code that is no longer used by any bpf programs.
Bug: 130206035
Test: build all the bpf related target.
Change-Id: I3ea4e40cb986b380f3b79a7685c3c09633e4d199
The bpfloader should not try to load bpf objects on unsupported devices
since devices with 4.4 kernel can have bpf maps but not bpf pogram
support. Creating bpf maps on those devices would mislead the framework
code to use an unsupported code path and crash system server.
Bug: 130687855
Test: cuttlefish boot test for 4.4 kernel.
Change-Id: I43ffc01e1099ee3effaa6ba30aa78080d5bec72f
This is needed for the iorapd project (i/o readahead).
Change-Id: If6a3de682296bbce0fc808a0eced6bd778106292
Signed-off-by: Joel Fernandes <joelaf@google.com>
Add a helper function to set sufficient MEMLOCK rlimit
for bpf related unit tests.
Bug: 119279144
Bug: 129246448
Test: libbpf_android_test
Change-Id: I5390f4d3b21436abff69a661d1c6e6a6749542ed
Since bpfloader is only used to create the bpf maps and load bpf
programs on android devices. It is okay to set the MEMLOCK rlimit of
bpfloader to the proper size needed by bpf maps regardless of the global
device values. It helps partner to adopt the bpf feature without
changing the device configuration.
Bug: 119279144
Bug: 129246448
Test: remove device specific rlimit and build and verify bpf maps
created.
Change-Id: Ib97d1d304f4ea9a6215afed76e1c1e28f1415221
We don't have the appropriate selinux privs to create the maps anyway.
Test: builds (when combined with system/netd change)
'git grep getOrCreate' in system/{bpf,netd} comes up empty
atest netd_unit_test netd_integration_test libbpf_android_test
Bug: 65674744
Bug: 129654883
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Idffbce5b28b723943c6495cfafdecddc7a0f4e67
This was necessary when the netd BPF program lived in system/bpf,
but it's no longer necessary.
Test: m
Bug: 65674744
Change-Id: I1fcf7e41276341b1258adf9d3795e81b6139f84f
The data collected by this program currently has no consumers, so
there's no need to load it or include it in the bpfloader build yet.
Test: make bpfloader
Change-Id: I206d94e3da34dc3b81bdbfdd4a00b05cfb624f48
Signed-off-by: Connor O'Brien <connoro@google.com>
For the eBPF programs that only related to networking, move them back
to netd so for the future changes in networking eBPF area, there is not
need to make changes in both netd project and bpf project.
Bug: 112334572
Test: mmma -j32 system/bpf
Change-Id: Icd0efd165c60c055a00fe88705a0c8070c0d22f5
For devices with 4.14 kernel shipping with bpf feature, they support more
functionality compared to 4.9 kernels. So when checking if the device
supports a given bpf feature, return a bpf level dependent on the detailed
kernel version instead of a simple boolean. This information would be
useful when we support new features such as map_in_map and cgroup socket
filters.
Bug: 111441138
Test: libnetdbpf_test, netd_integration_test
Change-Id: Ib51a56a35643ad76b58987ba1938c69905d28141
The BPF helper is moved into system/bpf/include/ and is available
to all BPF programs in the include search path. Make use of it.
Only minor refactor, no functional change.
Bug: 122665156
Change-Id: Ib5b495aff83874d39abe3640fb369b2ff92b3239
Signed-off-by: Joel Fernandes <joelaf@google.com>