Commit graph android_packages_modules_Co.../bpf/loader/NetBpfLoad.cpp
Message SHA1
Revert "NetBpfLoad: hacky way to make LPM_TRIE bpf maps work."
This reverts commit dcb2e7496c.

Reason for revert: will use negative size to imply no prealloc instead.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If1ce59acc592435537bce1d61857ba964bf8b6e6

Maciej Żenczykowski   commited 2025-01-20 12:10:04 -08:00
c1a9f4ab4c
NetBpfLoad: hacky way to make LPM_TRIE bpf maps work.
Longer term we should fix the bpf_map_def.h to
actually set map_flags correctly.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4e7954ccd0afad4ca8d9cec179ad6efa20592609

Maciej Żenczykowski   commited 2024-08-29 18:10:28 +00:00
dcb2e7496c
NetBpfLoad: introduce APEXROOT/BPFROOT defines
This allows changing the location of bpf programs easily
when building for the host to run on UML as a test.

Bug: 205608149
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I24816b6660581e74f277df39495a43027b77d2cf

Maciej Żenczykowski   commited 2024-08-26 17:29:52 -07:00
78fa86107b
NetBpfLoad: sort BPF_PROG_LOAD bpf_attr req field order
Some compilers warn/error and fail to build if it is not in proper order.
(specifically: triggers during build for host)

Bug: 205608149
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I84ddec9a2443939616fd78f522e8620680e1289e

Maciej Żenczykowski   commited 2024-08-26 17:29:47 -07:00
52be6a822d
NetBpfLoad: remove spurious header includes
(particularly problematic on host builds where host headers are ancient...)

Bug: 205608149
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iae64b900464e7584ad657f18d8101993fd8c8e33

Maciej Żenczykowski   commited 2024-08-26 17:29:41 -07:00
020eaf4dd5
NetBpfLoad: reduce log level for some messages
These messages are quite spammy.

Since this is now all mainline code built/shipped together, they're basically all deterministic.

We print the map/program ids for all maps & programs we load which means it's pretty obvious what was skipped anyway.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id46d9be8f77bef0b4c86e3a76503570c43e43af4

Maciej Żenczykowski   commited 2024-08-22 23:43:27 +00:00
dbdd90fb31
bpf: move bpf_headers into /bpf subdirectory
Generated via:
  git mv staticlibs/native/bpf_headers bpf/headers
  cd bpf/headers/include
  git mv bpf/bpf_helpers.h .
  git mv bpf/bpf_map_def.h .
manually fix up bpf/bpf_map_def.h include path

bpf_helpers.h is only used by bpf programs so the 'bpf/'
prefix is spurious.

bpf_map_def.h is only used by bpf programs and the two
bpfloaders, which effectively means the 'bpf/' prefix isn't
useful.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic3fc4e354a15821c27c23b7dbc019daad9f6ad85

Maciej Żenczykowski   commited 2024-08-21 13:18:59 -07:00
d602835b4f
bpf: git mv netbpfload bpf/loader
Step 2 of moving bpf related stuff into a common directory,
will ease development.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I95cab49ae03eb275982f43d2246085b06e66dc6d

Maciej Żenczykowski   commited 2024-08-20 19:51:41 -07:00
a207ac743c
Renamed from netbpfload/NetBpfLoad.cpp (Browse further)