Commit graph

1173 commits

Author SHA1 Message Date
Maciej Żenczykowski
298d16e28c document how to debug bpfloader failures am: e49e0c60cd am: cd132dc1fc
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1896605

Change-Id: I0ea803dd88b137dab3803783343f9931bdf2bb6f
2021-11-19 01:50:29 +00:00
Maciej Żenczykowski
cd132dc1fc document how to debug bpfloader failures am: e49e0c60cd
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1896605

Change-Id: Ib243829d791547f7680ca0c78111616e6c6377c6
2021-11-19 01:33:46 +00:00
Maciej Żenczykowski
e49e0c60cd document how to debug bpfloader failures
Test: N/A
Bug: 204131517
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia6a8ca026f3ab403443e130dceb2aca0ce0f2343
2021-11-19 01:18:12 +00:00
Maciej Żenczykowski
d87a5be05f Merge "add mainline module support for targetting only newer bpfloader versions" am: 210d6be5ac am: c50acfa7b9
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1895608

Change-Id: I36b582d3e23283373b0fbdf9db9ff79b029210b0
2021-11-18 07:47:04 +00:00
Treehugger Robot
453f93e9db Merge "rename SEC() to SECTION()" am: bc8df444d1 am: bab48348a4
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1895607

Change-Id: If4ebb24ddb95a5178d1386bdf961c87d9652b365
2021-11-18 07:47:00 +00:00
Maciej Żenczykowski
c50acfa7b9 Merge "add mainline module support for targetting only newer bpfloader versions" am: 210d6be5ac
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1895608

Change-Id: I8cc973f23b777f39fa399db2ed345c066ee15d3f
2021-11-18 07:31:03 +00:00
Treehugger Robot
bab48348a4 Merge "rename SEC() to SECTION()" am: bc8df444d1
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1895607

Change-Id: I0f8bd3f270c5988e90c941c1cd3b507149a17a43
2021-11-18 07:30:54 +00:00
Maciej Żenczykowski
210d6be5ac Merge "add mainline module support for targetting only newer bpfloader versions" 2021-11-18 07:19:28 +00:00
Treehugger Robot
bc8df444d1 Merge "rename SEC() to SECTION()" 2021-11-18 07:18:54 +00:00
Maciej Żenczykowski
20f6dd2d3a Always use OWNERS from master branch. am: fbe8caf45a am: d392956d00
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1895601

Change-Id: Ib40966a155bf2ac2e65f849e3803ba3ca70d3ad2
2021-11-18 05:52:54 +00:00
Maciej Żenczykowski
41661a10e3 add mainline module support for targetting only newer bpfloader versions
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
2021-11-18 05:47:24 +00:00
Maciej Żenczykowski
3adb1d5569 rename SEC() to SECTION()
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
2021-11-18 05:45:21 +00:00
Maciej Żenczykowski
d392956d00 Always use OWNERS from master branch. am: fbe8caf45a
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1895601

Change-Id: I6ef20684debb86f7c4b736193804ab01a8c78b6a
2021-11-18 05:42:29 +00:00
Maciej Żenczykowski
fbe8caf45a Always use OWNERS from master branch.
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
2021-11-17 10:51:28 -08:00
Maciej Żenczykowski
959ccaba1d BpfUtils.h - switch to GTEST_SKIP in all 4 SKIP macros am: 5460527c74 am: 4273296e72
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1888239

Change-Id: I4afcf1529820587e2ee79991a877d2034643ef59
2021-11-12 09:44:26 +00:00
Maciej Żenczykowski
4273296e72 BpfUtils.h - switch to GTEST_SKIP in all 4 SKIP macros am: 5460527c74
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1888239

Change-Id: Icd8bffdbfbc141d21d269d9ccc993b620d7bfbf9
2021-11-12 09:26:36 +00:00
Maciej Żenczykowski
5460527c74 BpfUtils.h - switch to GTEST_SKIP in all 4 SKIP macros
Test: TreeHugger, atest libbpf_android_test netd_unit_test netd_integration_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3acb47a432378f257418f81b26516e18d6ff3780
2021-11-11 11:54:02 -08:00
Maciej Żenczykowski
6ce5b01775 bpfloader.rc: set /proc/sys/kernel/unprivileged_bpf_disabled to 0 am: fa03239a81 am: 04a70b8dda am: 7e399c7847
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1887534

Change-Id: Ib87674e2a304f09d208f32ffed722c794821ead2
2021-11-11 13:02:15 +00:00
Maciej Żenczykowski
7e399c7847 bpfloader.rc: set /proc/sys/kernel/unprivileged_bpf_disabled to 0 am: fa03239a81 am: 04a70b8dda
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1887534

Change-Id: I44d19e15adf178d52b39235efae67050ac159d69
2021-11-11 12:50:49 +00:00
Maciej Żenczykowski
04a70b8dda bpfloader.rc: set /proc/sys/kernel/unprivileged_bpf_disabled to 0 am: fa03239a81
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1887534

Change-Id: If324aa1068a44e4338d0989317759a10e952b812
2021-11-11 12:32:52 +00:00
Maciej Żenczykowski
fa03239a81 bpfloader.rc: set /proc/sys/kernel/unprivileged_bpf_disabled to 0
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
2021-11-11 01:53:39 +00:00
Tyler Wear
9bc358c110 Add Bpf Prog Type for CGROUP_SOCK_ADDR am: 25c028576d am: e8ac9034f9 am: 4d2963a6cc
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1870862

Change-Id: Ifdff389cd3aa20e6574f89acacd1c20620f72534
2021-10-27 05:07:55 +00:00
Tyler Wear
4d2963a6cc Add Bpf Prog Type for CGROUP_SOCK_ADDR am: 25c028576d am: e8ac9034f9
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1870862

Change-Id: I286784dd074644cff85fbf68e468a7900c71c97b
2021-10-27 04:14:41 +00:00
Tyler Wear
e8ac9034f9 Add Bpf Prog Type for CGROUP_SOCK_ADDR am: 25c028576d
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1870862

Change-Id: I18370168df9ff122e42c3cb18f8e05b6d609b40e
2021-10-27 03:47:27 +00:00
Tyler Wear
25c028576d Add Bpf Prog Type for CGROUP_SOCK_ADDR
When loading a BPF program check for CGROUP_SOCK_ADDR
program type.

Bug: 179733303
Change-Id: I0464052065ec6f77a639a12a8dd343b7bf6f6ef8
2021-10-26 16:54:35 -07:00
Stephane Lee
b345752c63 Increase the log size for larger bpf programs am: eb61b739ae am: 54ac637fcf am: 73d10ac0ee
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1867988

Change-Id: I7c41ac39590bd2f5e40c94eac7c99fde57972dd1
2021-10-25 04:42:38 +00:00
Stephane Lee
73d10ac0ee Increase the log size for larger bpf programs am: eb61b739ae am: 54ac637fcf
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1867988

Change-Id: I97ee6385993c19dd0881f7cccc6bdc1bf73b3301
2021-10-25 04:28:30 +00:00
Stephane Lee
54ac637fcf Increase the log size for larger bpf programs am: eb61b739ae
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1867988

Change-Id: I75c3dceddbd35615445eff444d4c0bda60614cbb
2021-10-25 04:18:36 +00:00
Stephane Lee
eb61b739ae Increase the log size for larger bpf programs
Test: Build passes, bpf program loads without an out of space error
Bug: 203462310
Change-Id: I5f67021a530223467662f341cdfffc4816781078
2021-10-22 19:07:05 -07:00
Treehugger Robot
269163f819 Merge "bpfloader: add schedact support" am: bf05d42ef4 am: 54ee2ca342 am: e33d723d4f
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1853438

Change-Id: I8d657d19c983e6cbd4374a59c80a9edcbbcfac90
2021-10-14 02:51:50 +00:00
Treehugger Robot
e33d723d4f Merge "bpfloader: add schedact support" am: bf05d42ef4 am: 54ee2ca342
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1853438

Change-Id: I13ff01ebc3b9a2635e3ec219829eb3e233d79c8b
2021-10-14 02:37:15 +00:00
Treehugger Robot
54ee2ca342 Merge "bpfloader: add schedact support" am: bf05d42ef4
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1853438

Change-Id: I3e8126c9340ec719d1b37c482031664d30b4d17e
2021-10-14 02:22:32 +00:00
Treehugger Robot
bf05d42ef4 Merge "bpfloader: add schedact support" 2021-10-14 02:06:12 +00:00
Patrick Rohr
b28bf2aa53 bpfloader: add schedact support
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
2021-10-13 19:28:53 +00:00
Pirama Arumuga Nainar
a37cb0139e Cleanup unused dependency to libprocessgroup am: e8d6df1231 am: ee9072f58e am: b9f78b89d6
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1815076

Change-Id: I66384c21232f5a974085756721ad491865930ce4
2021-08-31 21:22:36 +00:00
Pirama Arumuga Nainar
b9f78b89d6 Cleanup unused dependency to libprocessgroup am: e8d6df1231 am: ee9072f58e
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1815076

Change-Id: Ia9cf78285cb4797bab5224d68206f53d5a8c7973
2021-08-31 21:12:17 +00:00
Pirama Arumuga Nainar
ee9072f58e Cleanup unused dependency to libprocessgroup am: e8d6df1231
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1815076

Change-Id: I2250ddd495b6dc05b5161e0739f6f3fefc69f63d
2021-08-31 20:59:11 +00:00
Pirama Arumuga Nainar
e8d6df1231 Cleanup unused dependency to libprocessgroup
Bug: http://b/197965342

Dependence on libprocessgroup was removed in aosp/947297

Test: presubmit
Change-Id: I802efee3500e25006b55e0f35cb8650fd1aa2033
2021-08-31 19:59:20 +00:00
Dmitri Plotnikov
e93ed7e867 Add support for testing of eBPF programs am: bb05a5c138 am: f0e77da7be
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1507724

Change-Id: Ib6e1c04a3ff1b9dd5d4cdc5b6877ce99399481fa
2021-07-16 03:00:15 +00:00
Dmitri Plotnikov
f0e77da7be Add support for testing of eBPF programs am: bb05a5c138
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1507724

Change-Id: I1d386f72940ce6e271970bc3d2e862a98bac0556
2021-07-16 02:41:52 +00:00
Dmitri Plotnikov
bb05a5c138 Add support for testing of eBPF programs
Bug: 171262763
Test: this is just a header file
Change-Id: Id25846f91d2da698717a9cc0d8d9091022dd7233
2021-07-15 17:06:15 -07:00
Maciej Żenczykowski
475ac08ee8 [automerger skipped] expose readSectionUint() for testing am: c1f8ca3060 -s ours
am skip reason: Merged-In I772c918d162440de6cc492b2faeafe03340fca11 with SHA-1 7ed94efeda is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/15212804

Change-Id: I6812cfa7767b4954ba5e7b35ddd87caf1fe3de72
2021-07-06 12:37:25 +00:00
Maciej Żenczykowski
fbe33e1b4c [automerger skipped] bpf - struct bpf_map_def - add min/max kernel version. am: 2a51516a63 -s ours
am skip reason: Merged-In I085cc723ff1c19d8acc8972a391f894e16dd1875 with SHA-1 36c53ba91e is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/15212803

Change-Id: I2f61b1be0d81117e7facde4a7b9ca50f161b9e66
2021-07-06 12:37:24 +00:00
Maciej Żenczykowski
c1f8ca3060 expose readSectionUint() for testing
Bug: 190519702
Test: atest bpf_module_test, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1756850
Merged-In: I772c918d162440de6cc492b2faeafe03340fca11
Change-Id: I772c918d162440de6cc492b2faeafe03340fca11
2021-07-06 10:50:12 +00:00
Maciej Żenczykowski
2a51516a63 bpf - struct bpf_map_def - add min/max kernel version.
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
2021-07-06 10:49:52 +00:00
Maciej Żenczykowski
f71ce9b4c9 expose readSectionUint() for testing am: 7ed94efeda am: 0f24b26b6c
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1756850

Change-Id: Ibd6d7fb84b583ef5a9a15e7ccc28ae79173f3f76
2021-07-06 10:37:12 +00:00
Maciej Żenczykowski
6f2b6ca0ca bpf - struct bpf_map_def - add min/max kernel version. am: 36c53ba91e am: f1421cd47f
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1756575

Change-Id: I75a99d681d7e82cb46f4350e29bf4ce1992636d1
2021-07-06 10:37:11 +00:00
Maciej Żenczykowski
0f24b26b6c expose readSectionUint() for testing am: 7ed94efeda
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1756850

Change-Id: Iea2971e09d3c7f1a7ac2d3344bd3d6b5df3e110f
2021-07-06 10:25:07 +00:00
Maciej Żenczykowski
f1421cd47f bpf - struct bpf_map_def - add min/max kernel version. am: 36c53ba91e
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1756575

Change-Id: I2848c223ff92111e7012da0e82ea2325401971f6
2021-07-06 10:25:06 +00:00
Maciej Żenczykowski
7ed94efeda expose readSectionUint() for testing
Bug: 190519702
Test: atest bpf_module_test, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I772c918d162440de6cc492b2faeafe03340fca11
2021-07-06 01:55:33 -07:00