From b0ac41f0cd57350f50d19e7d9a10d95aa133154d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Sun, 14 Feb 2021 21:34:03 -0800 Subject: [PATCH] tethering offload ebpf - lower requirement from 5.9 to 5.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As this is the actual version that is required, ie. the version that supports bpf_ktime_get_boot_ns() helper. Test: atest, TreeHugger Signed-off-by: Maciej Żenczykowski Change-Id: I2ea4830597a0bed53950a5d0c483a47208959f35 --- Tethering/bpf_progs/offload.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Tethering/bpf_progs/offload.c b/Tethering/bpf_progs/offload.c index bf60e67ea6..8054ef4cc5 100644 --- a/Tethering/bpf_progs/offload.c +++ b/Tethering/bpf_progs/offload.c @@ -535,54 +535,54 @@ if (!is_tcp) return TC_ACT_OK; // HACK return bpf_redirect(v->oif, 0 /* this is effectively BPF_F_EGRESS */); } -// Real implementations for 5.9+ kernels +// Real implementations for 5.8+ kernels -DEFINE_BPF_PROG_KVER("schedcls/tether_downstream4_ether$5_9", AID_ROOT, AID_NETWORK_STACK, - sched_cls_tether_downstream4_ether_5_9, KVER(5, 9, 0)) +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, 0)) (struct __sk_buff* skb) { return do_forward4(skb, /* is_ethernet */ true, /* downstream */ true); } -DEFINE_BPF_PROG_KVER("schedcls/tether_downstream4_rawip$5_9", AID_ROOT, AID_NETWORK_STACK, - sched_cls_tether_downstream4_rawip_5_9, KVER(5, 9, 0)) +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, 0)) (struct __sk_buff* skb) { return do_forward4(skb, /* is_ethernet */ false, /* downstream */ true); } -DEFINE_BPF_PROG_KVER("schedcls/tether_upstream4_ether$5_9", AID_ROOT, AID_NETWORK_STACK, - sched_cls_tether_upstream4_ether_5_9, KVER(5, 9, 0)) +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, 0)) (struct __sk_buff* skb) { return do_forward4(skb, /* is_ethernet */ true, /* downstream */ false); } -DEFINE_BPF_PROG_KVER("schedcls/tether_upstream4_rawip$5_9", AID_ROOT, AID_NETWORK_STACK, - sched_cls_tether_upstream4_rawip_5_9, KVER(5, 9, 0)) +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, 0)) (struct __sk_buff* skb) { return do_forward4(skb, /* is_ethernet */ false, /* downstream */ false); } -// Placeholder implementations for older pre-5.9 kernels +// Placeholder implementations for older pre-5.8 kernels DEFINE_BPF_PROG_KVER_RANGE("schedcls/tether_downstream4_ether$stub", AID_ROOT, AID_NETWORK_STACK, - sched_cls_tether_downstream4_ether_stub, KVER_NONE, KVER(5, 9, 0)) + sched_cls_tether_downstream4_ether_stub, KVER_NONE, KVER(5, 8, 0)) (struct __sk_buff* skb) { return TC_ACT_OK; } DEFINE_BPF_PROG_KVER_RANGE("schedcls/tether_downstream4_rawip$stub", AID_ROOT, AID_NETWORK_STACK, - sched_cls_tether_downstream4_rawip_stub, KVER_NONE, KVER(5, 9, 0)) + sched_cls_tether_downstream4_rawip_stub, KVER_NONE, KVER(5, 8, 0)) (struct __sk_buff* skb) { return TC_ACT_OK; } DEFINE_BPF_PROG_KVER_RANGE("schedcls/tether_upstream4_ether$stub", AID_ROOT, AID_NETWORK_STACK, - sched_cls_tether_upstream4_ether_stub, KVER_NONE, KVER(5, 9, 0)) + sched_cls_tether_upstream4_ether_stub, KVER_NONE, KVER(5, 8, 0)) (struct __sk_buff* skb) { return TC_ACT_OK; } DEFINE_BPF_PROG_KVER_RANGE("schedcls/tether_upstream4_rawip$stub", AID_ROOT, AID_NETWORK_STACK, - sched_cls_tether_upstream4_rawip_stub, KVER_NONE, KVER(5, 9, 0)) + sched_cls_tether_upstream4_rawip_stub, KVER_NONE, KVER(5, 8, 0)) (struct __sk_buff* skb) { return TC_ACT_OK; }