bpf: KVER_5_8 -> KVER_5_10
Neither 5.8 nor 5.9 are LTS, and thus aren't supported. Let's simplify to 5.10 which is the actual LTS supported version. Generated via: sed -i -r 's/KVER_5_8/KVER_5_10/' bpf/progs/offload.c sed -i -r 's/KVER_5_8/KVER_5_10/' bpf/progs/netd.c plus manual edit to: bpf/headers/include/bpf_helpers.h Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I2b9563e1a392011718d3f7d788f84201993e58c2
This commit is contained in:
parent
1ef91d67c0
commit
276dd9dbf7
3 changed files with 26 additions and 25 deletions
|
|
@ -291,14 +291,15 @@ static void (*bpf_ringbuf_submit_unsafe)(const void* data, __u64 flags) = (void*
|
|||
// Type safe macro to declare a ring buffer and related output functions.
|
||||
// Compatibility:
|
||||
// * BPF ring buffers are only available kernels 5.8 and above. Any program
|
||||
// accessing the ring buffer should set a program level min_kver >= 5.8.
|
||||
// * The definition below sets a map min_kver of 5.8 which requires targeting
|
||||
// accessing the ring buffer should set a program level min_kver >= 5.10,
|
||||
// since 5.10 is the next LTS version.
|
||||
// * The definition below sets a map min_kver of 5.10 which requires targeting
|
||||
// a BPFLOADER_MIN_VER >= BPFLOADER_S_VERSION.
|
||||
#define DEFINE_BPF_RINGBUF_EXT(the_map, ValueType, size_bytes, usr, grp, md, \
|
||||
selinux, pindir, share, min_loader, max_loader, \
|
||||
ignore_eng, ignore_user, ignore_userdebug) \
|
||||
DEFINE_BPF_MAP_BASE(the_map, RINGBUF, 0, 0, size_bytes, usr, grp, md, \
|
||||
selinux, pindir, share, KVER_5_8, KVER_INF, \
|
||||
selinux, pindir, share, KVER_5_10, KVER_INF, \
|
||||
min_loader, max_loader, ignore_eng, ignore_user, \
|
||||
ignore_userdebug, 0); \
|
||||
\
|
||||
|
|
|
|||
|
|
@ -514,14 +514,14 @@ static __always_inline inline int bpf_traffic_account(struct __sk_buff* skb,
|
|||
return match;
|
||||
}
|
||||
|
||||
// Tracing on Android U+ 5.8+
|
||||
// Tracing on Android U+ 5.10+
|
||||
DEFINE_BPF_PROG_EXT("cgroupskb/ingress/stats$trace", AID_ROOT, AID_SYSTEM,
|
||||
bpf_cgroup_ingress_trace, KVER_5_8, KVER_INF,
|
||||
bpf_cgroup_ingress_trace, KVER_5_10, KVER_INF,
|
||||
BPFLOADER_MAINLINE_U_VERSION, BPFLOADER_MAX_VER, MANDATORY,
|
||||
"fs_bpf_netd_readonly", "",
|
||||
LOAD_ON_ENG, LOAD_ON_USER, LOAD_ON_USERDEBUG)
|
||||
(struct __sk_buff* skb) {
|
||||
return bpf_traffic_account(skb, INGRESS, TRACE_ON, KVER_5_8, SDK_LEVEL_U);
|
||||
return bpf_traffic_account(skb, INGRESS, TRACE_ON, KVER_5_10, SDK_LEVEL_U);
|
||||
}
|
||||
|
||||
DEFINE_NETD_BPF_PROG_KVER_RANGE("cgroupskb/ingress/stats$4_19", AID_ROOT, AID_SYSTEM,
|
||||
|
|
@ -536,14 +536,14 @@ DEFINE_NETD_BPF_PROG_KVER_RANGE("cgroupskb/ingress/stats$4_14", AID_ROOT, AID_SY
|
|||
return bpf_traffic_account(skb, INGRESS, TRACE_OFF, KVER_NONE, SDK_LEVEL_NONE);
|
||||
}
|
||||
|
||||
// Tracing on Android U+ 5.8+
|
||||
// Tracing on Android U+ 5.10+
|
||||
DEFINE_BPF_PROG_EXT("cgroupskb/egress/stats$trace", AID_ROOT, AID_SYSTEM,
|
||||
bpf_cgroup_egress_trace, KVER_5_8, KVER_INF,
|
||||
bpf_cgroup_egress_trace, KVER_5_10, KVER_INF,
|
||||
BPFLOADER_MAINLINE_U_VERSION, BPFLOADER_MAX_VER, MANDATORY,
|
||||
"fs_bpf_netd_readonly", "",
|
||||
LOAD_ON_ENG, LOAD_ON_USER, LOAD_ON_USERDEBUG)
|
||||
(struct __sk_buff* skb) {
|
||||
return bpf_traffic_account(skb, EGRESS, TRACE_ON, KVER_5_8, SDK_LEVEL_U);
|
||||
return bpf_traffic_account(skb, EGRESS, TRACE_ON, KVER_5_10, SDK_LEVEL_U);
|
||||
}
|
||||
|
||||
DEFINE_NETD_BPF_PROG_KVER_RANGE("cgroupskb/egress/stats$4_19", AID_ROOT, AID_SYSTEM,
|
||||
|
|
|
|||
|
|
@ -609,27 +609,27 @@ static inline __always_inline int do_forward4(struct __sk_buff* skb,
|
|||
// Full featured (required) implementations for 5.8+ kernels (these are S+ by definition)
|
||||
|
||||
DEFINE_BPF_PROG_KVER("schedcls/tether_downstream4_rawip$5_8", AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_downstream4_rawip_5_8, KVER_5_8)
|
||||
sched_cls_tether_downstream4_rawip_5_8, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, RAWIP, DOWNSTREAM, UPDATETIME, KVER_5_8);
|
||||
return do_forward4(skb, RAWIP, DOWNSTREAM, UPDATETIME, KVER_5_10);
|
||||
}
|
||||
|
||||
DEFINE_BPF_PROG_KVER("schedcls/tether_upstream4_rawip$5_8", AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_upstream4_rawip_5_8, KVER_5_8)
|
||||
sched_cls_tether_upstream4_rawip_5_8, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, RAWIP, UPSTREAM, UPDATETIME, KVER_5_8);
|
||||
return do_forward4(skb, RAWIP, UPSTREAM, UPDATETIME, KVER_5_10);
|
||||
}
|
||||
|
||||
DEFINE_BPF_PROG_KVER("schedcls/tether_downstream4_ether$5_8", AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_downstream4_ether_5_8, KVER_5_8)
|
||||
sched_cls_tether_downstream4_ether_5_8, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, ETHER, DOWNSTREAM, UPDATETIME, KVER_5_8);
|
||||
return do_forward4(skb, ETHER, DOWNSTREAM, UPDATETIME, KVER_5_10);
|
||||
}
|
||||
|
||||
DEFINE_BPF_PROG_KVER("schedcls/tether_upstream4_ether$5_8", AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_upstream4_ether_5_8, KVER_5_8)
|
||||
sched_cls_tether_upstream4_ether_5_8, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, ETHER, UPSTREAM, UPDATETIME, KVER_5_8);
|
||||
return do_forward4(skb, ETHER, UPSTREAM, UPDATETIME, KVER_5_10);
|
||||
}
|
||||
|
||||
// Full featured (optional) implementations for 4.14-S, 4.19-S & 5.4-S kernels
|
||||
|
|
@ -638,7 +638,7 @@ DEFINE_BPF_PROG_KVER("schedcls/tether_upstream4_ether$5_8", AID_ROOT, AID_NETWOR
|
|||
DEFINE_OPTIONAL_BPF_PROG_KVER_RANGE("schedcls/tether_downstream4_rawip$opt",
|
||||
AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_downstream4_rawip_opt,
|
||||
KVER_4_14, KVER_5_8)
|
||||
KVER_4_14, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, RAWIP, DOWNSTREAM, UPDATETIME, KVER_4_14);
|
||||
}
|
||||
|
|
@ -646,7 +646,7 @@ DEFINE_OPTIONAL_BPF_PROG_KVER_RANGE("schedcls/tether_downstream4_rawip$opt",
|
|||
DEFINE_OPTIONAL_BPF_PROG_KVER_RANGE("schedcls/tether_upstream4_rawip$opt",
|
||||
AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_upstream4_rawip_opt,
|
||||
KVER_4_14, KVER_5_8)
|
||||
KVER_4_14, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, RAWIP, UPSTREAM, UPDATETIME, KVER_4_14);
|
||||
}
|
||||
|
|
@ -654,7 +654,7 @@ DEFINE_OPTIONAL_BPF_PROG_KVER_RANGE("schedcls/tether_upstream4_rawip$opt",
|
|||
DEFINE_OPTIONAL_BPF_PROG_KVER_RANGE("schedcls/tether_downstream4_ether$opt",
|
||||
AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_downstream4_ether_opt,
|
||||
KVER_4_14, KVER_5_8)
|
||||
KVER_4_14, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, ETHER, DOWNSTREAM, UPDATETIME, KVER_4_14);
|
||||
}
|
||||
|
|
@ -662,7 +662,7 @@ DEFINE_OPTIONAL_BPF_PROG_KVER_RANGE("schedcls/tether_downstream4_ether$opt",
|
|||
DEFINE_OPTIONAL_BPF_PROG_KVER_RANGE("schedcls/tether_upstream4_ether$opt",
|
||||
AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_upstream4_ether_opt,
|
||||
KVER_4_14, KVER_5_8)
|
||||
KVER_4_14, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, ETHER, UPSTREAM, UPDATETIME, KVER_4_14);
|
||||
}
|
||||
|
|
@ -682,13 +682,13 @@ DEFINE_OPTIONAL_BPF_PROG_KVER_RANGE("schedcls/tether_upstream4_ether$opt",
|
|||
// RAWIP: Required for 5.4-R kernels -- which always support bpf_skb_change_head().
|
||||
|
||||
DEFINE_BPF_PROG_KVER_RANGE("schedcls/tether_downstream4_rawip$5_4", AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_downstream4_rawip_5_4, KVER_5_4, KVER_5_8)
|
||||
sched_cls_tether_downstream4_rawip_5_4, KVER_5_4, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, RAWIP, DOWNSTREAM, NO_UPDATETIME, KVER_5_4);
|
||||
}
|
||||
|
||||
DEFINE_BPF_PROG_KVER_RANGE("schedcls/tether_upstream4_rawip$5_4", AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_upstream4_rawip_5_4, KVER_5_4, KVER_5_8)
|
||||
sched_cls_tether_upstream4_rawip_5_4, KVER_5_4, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, RAWIP, UPSTREAM, NO_UPDATETIME, KVER_5_4);
|
||||
}
|
||||
|
|
@ -715,13 +715,13 @@ DEFINE_OPTIONAL_BPF_PROG_KVER_RANGE("schedcls/tether_upstream4_rawip$4_14",
|
|||
// ETHER: Required for 4.14-Q/R, 4.19-Q/R & 5.4-R kernels.
|
||||
|
||||
DEFINE_BPF_PROG_KVER_RANGE("schedcls/tether_downstream4_ether$4_14", AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_downstream4_ether_4_14, KVER_4_14, KVER_5_8)
|
||||
sched_cls_tether_downstream4_ether_4_14, KVER_4_14, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, ETHER, DOWNSTREAM, NO_UPDATETIME, KVER_4_14);
|
||||
}
|
||||
|
||||
DEFINE_BPF_PROG_KVER_RANGE("schedcls/tether_upstream4_ether$4_14", AID_ROOT, AID_NETWORK_STACK,
|
||||
sched_cls_tether_upstream4_ether_4_14, KVER_4_14, KVER_5_8)
|
||||
sched_cls_tether_upstream4_ether_4_14, KVER_4_14, KVER_5_10)
|
||||
(struct __sk_buff* skb) {
|
||||
return do_forward4(skb, ETHER, UPSTREAM, NO_UPDATETIME, KVER_4_14);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue