Revert "NetBpfLoad: disable mainline on < U QPR3"
This reverts commit 4b28336a7a.
Fixed trivial comment conflicts in netd/BpfHandler.cpp
This is targetting mainline release M-2024-09.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I048af33789590dda4e1f0be0660419ca6b3ad57f
This commit is contained in:
parent
2afffc2d6a
commit
4e4f8720f2
7 changed files with 17 additions and 17 deletions
|
|
@ -20,7 +20,7 @@
|
|||
#include <stdint.h>
|
||||
|
||||
// The resulting .o needs to load on Android T+
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_T_VERSION
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_MAINLINE_T_VERSION
|
||||
|
||||
#include "bpf_helpers.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include <linux/udp.h>
|
||||
|
||||
// The resulting .o needs to load on Android T+
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_T_VERSION
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_MAINLINE_T_VERSION
|
||||
|
||||
#include "bpf_helpers.h"
|
||||
#include "bpf_net_helpers.h"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include <string.h>
|
||||
|
||||
// The resulting .o needs to load on Android T+
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_T_VERSION
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_MAINLINE_T_VERSION
|
||||
|
||||
#include "bpf_helpers.h"
|
||||
#include "dscpPolicy.h"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
// The resulting .o needs to load on Android T+
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_T_VERSION
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_MAINLINE_T_VERSION
|
||||
|
||||
#include <bpf_helpers.h>
|
||||
#include <linux/bpf.h>
|
||||
|
|
@ -106,13 +106,13 @@ DEFINE_BPF_MAP_NO_NETD(iface_index_name_map, HASH, uint32_t, IfaceValue, IFACE_I
|
|||
// A single-element configuration array, packet tracing is enabled when 'true'.
|
||||
DEFINE_BPF_MAP_EXT(packet_trace_enabled_map, ARRAY, uint32_t, bool, 1,
|
||||
AID_ROOT, AID_SYSTEM, 0060, "fs_bpf_net_shared", "", PRIVATE,
|
||||
BPFLOADER_U_VERSION, BPFLOADER_MAX_VER, LOAD_ON_ENG,
|
||||
BPFLOADER_MAINLINE_U_VERSION, BPFLOADER_MAX_VER, LOAD_ON_ENG,
|
||||
LOAD_ON_USER, LOAD_ON_USERDEBUG)
|
||||
|
||||
// A ring buffer on which packet information is pushed.
|
||||
DEFINE_BPF_RINGBUF_EXT(packet_trace_ringbuf, PacketTrace, PACKET_TRACE_BUF_SIZE,
|
||||
AID_ROOT, AID_SYSTEM, 0060, "fs_bpf_net_shared", "", PRIVATE,
|
||||
BPFLOADER_U_VERSION, BPFLOADER_MAX_VER, LOAD_ON_ENG,
|
||||
BPFLOADER_MAINLINE_U_VERSION, BPFLOADER_MAX_VER, LOAD_ON_ENG,
|
||||
LOAD_ON_USER, LOAD_ON_USERDEBUG);
|
||||
|
||||
DEFINE_BPF_MAP_RO_NETD(data_saver_enabled_map, ARRAY, uint32_t, bool,
|
||||
|
|
@ -527,7 +527,7 @@ static __always_inline inline int bpf_traffic_account(struct __sk_buff* skb,
|
|||
// This program is optional, and enables tracing on Android U+, 5.8+ on user builds.
|
||||
DEFINE_BPF_PROG_EXT("cgroupskb/ingress/stats$trace_user", AID_ROOT, AID_SYSTEM,
|
||||
bpf_cgroup_ingress_trace_user, KVER_5_8, KVER_INF,
|
||||
BPFLOADER_U_VERSION, BPFLOADER_MAX_VER, OPTIONAL,
|
||||
BPFLOADER_MAINLINE_U_VERSION, BPFLOADER_MAX_VER, OPTIONAL,
|
||||
"fs_bpf_netd_readonly", "",
|
||||
IGNORE_ON_ENG, LOAD_ON_USER, IGNORE_ON_USERDEBUG)
|
||||
(struct __sk_buff* skb) {
|
||||
|
|
@ -537,7 +537,7 @@ DEFINE_BPF_PROG_EXT("cgroupskb/ingress/stats$trace_user", AID_ROOT, AID_SYSTEM,
|
|||
// This program is required, and enables tracing on Android U+, 5.8+, userdebug/eng.
|
||||
DEFINE_BPF_PROG_EXT("cgroupskb/ingress/stats$trace", AID_ROOT, AID_SYSTEM,
|
||||
bpf_cgroup_ingress_trace, KVER_5_8, KVER_INF,
|
||||
BPFLOADER_U_VERSION, BPFLOADER_MAX_VER, MANDATORY,
|
||||
BPFLOADER_MAINLINE_U_VERSION, BPFLOADER_MAX_VER, MANDATORY,
|
||||
"fs_bpf_netd_readonly", "",
|
||||
LOAD_ON_ENG, IGNORE_ON_USER, LOAD_ON_USERDEBUG)
|
||||
(struct __sk_buff* skb) {
|
||||
|
|
@ -559,7 +559,7 @@ DEFINE_NETD_BPF_PROG_KVER_RANGE("cgroupskb/ingress/stats$4_14", AID_ROOT, AID_SY
|
|||
// This program is optional, and enables tracing on Android U+, 5.8+ on user builds.
|
||||
DEFINE_BPF_PROG_EXT("cgroupskb/egress/stats$trace_user", AID_ROOT, AID_SYSTEM,
|
||||
bpf_cgroup_egress_trace_user, KVER_5_8, KVER_INF,
|
||||
BPFLOADER_U_VERSION, BPFLOADER_MAX_VER, OPTIONAL,
|
||||
BPFLOADER_MAINLINE_U_VERSION, BPFLOADER_MAX_VER, OPTIONAL,
|
||||
"fs_bpf_netd_readonly", "",
|
||||
IGNORE_ON_ENG, LOAD_ON_USER, IGNORE_ON_USERDEBUG)
|
||||
(struct __sk_buff* skb) {
|
||||
|
|
@ -569,7 +569,7 @@ DEFINE_BPF_PROG_EXT("cgroupskb/egress/stats$trace_user", AID_ROOT, AID_SYSTEM,
|
|||
// This program is required, and enables tracing on Android U+, 5.8+, userdebug/eng.
|
||||
DEFINE_BPF_PROG_EXT("cgroupskb/egress/stats$trace", AID_ROOT, AID_SYSTEM,
|
||||
bpf_cgroup_egress_trace, KVER_5_8, KVER_INF,
|
||||
BPFLOADER_U_VERSION, BPFLOADER_MAX_VER, MANDATORY,
|
||||
BPFLOADER_MAINLINE_U_VERSION, BPFLOADER_MAX_VER, MANDATORY,
|
||||
"fs_bpf_netd_readonly", "",
|
||||
LOAD_ON_ENG, IGNORE_ON_USER, LOAD_ON_USERDEBUG)
|
||||
(struct __sk_buff* skb) {
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@
|
|||
// BTF is incompatible with bpfloaders < v0.10, hence for S (v0.2) we must
|
||||
// ship a different file than for later versions, but we need bpfloader v0.25+
|
||||
// for obj@ver.o support
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_OBJ_AT_VER_VERSION
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_MAINLINE_T_VERSION
|
||||
#else /* MAINLINE */
|
||||
// The resulting .o needs to load on the Android S & T bpfloaders
|
||||
// The resulting .o needs to load on the Android S bpfloader
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_S_VERSION
|
||||
#define BPFLOADER_MAX_VER BPFLOADER_OBJ_AT_VER_VERSION
|
||||
#define BPFLOADER_MAX_VER BPFLOADER_T_VERSION
|
||||
#endif /* MAINLINE */
|
||||
|
||||
// Warning: values other than AID_ROOT don't work for map uid on BpfLoader < v0.21
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@
|
|||
// BTF is incompatible with bpfloaders < v0.10, hence for S (v0.2) we must
|
||||
// ship a different file than for later versions, but we need bpfloader v0.25+
|
||||
// for obj@ver.o support
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_OBJ_AT_VER_VERSION
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_MAINLINE_T_VERSION
|
||||
#else /* MAINLINE */
|
||||
// The resulting .o needs to load on the Android S & T bpfloaders
|
||||
// The resulting .o needs to load on the Android S bpfloader
|
||||
#define BPFLOADER_MIN_VER BPFLOADER_S_VERSION
|
||||
#define BPFLOADER_MAX_VER BPFLOADER_OBJ_AT_VER_VERSION
|
||||
#define BPFLOADER_MAX_VER BPFLOADER_T_VERSION
|
||||
#endif /* MAINLINE */
|
||||
|
||||
// Warning: values other than AID_ROOT don't work for map uid on BpfLoader < v0.21
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ Status BpfHandler::init(const char* cg2_path) {
|
|||
android::bpf::waitForProgsLoaded();
|
||||
}
|
||||
|
||||
if (false && !mainlineNetBpfLoadDone()) {
|
||||
if (!mainlineNetBpfLoadDone()) {
|
||||
// We're on < U QPR3 & it's the first time netd is starting up (unless crashlooping)
|
||||
//
|
||||
// On U QPR3+ netbpfload is guaranteed to run before the platform bpfloader,
|
||||
|
|
|
|||
Loading…
Reference in a new issue