From a457bf7ea84e759e53376260cab056eb8b963c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Fri, 22 Oct 2021 21:41:25 -0700 Subject: [PATCH] explicitly specify that offload.o & test.o bpf programs are S+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note: due to the release version of the Connectivity/Tethering mainline module being built from sc-mainline-prod, this won't actually take effect until system/bpf bpfloader at version 0.6+ is merged in to that tree. This doesn't really matter, since currently things default to v0.0+. But there is no mainline module updatable pre-v0.2 supported OS anyway. BpfLoader v0.2 is what shipped in Android S Beta 4 through Android S Final. Before S there simply was no bpfloader support for mainline updatable ebpf code, while S Beta 3 and earlier shipped v0.0 which is badly incompatible with even the current version of the mainline module. Additionally v0.0 doesn't even parse this field, while v0.1 which does was very short lived [~3 days] and can thus be utterly ignored. As such this change is effectively a no-op, and even post merge of bpfloader v0.6+ into sc-mainline-prod will still be effectively a no-op. So why do it? I want to explicitly document that these programs are S+, so that I can change the default in the future to be T+. Test: TreeHugger Signed-off-by: Maciej Żenczykowski Change-Id: I7e5d0124700c7045abe16b1f3b504c9e88054ff2 --- Tethering/bpf_progs/offload.c | 3 +++ Tethering/bpf_progs/test.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Tethering/bpf_progs/offload.c b/Tethering/bpf_progs/offload.c index 51fed768bf..977e918d67 100644 --- a/Tethering/bpf_progs/offload.c +++ b/Tethering/bpf_progs/offload.c @@ -24,6 +24,9 @@ #define __kernel_udphdr udphdr #include +// The resulting .o needs to load on the Android S bpfloader v0.2 +#define BPFLOADER_MIN_VER 2u + #include "bpf_helpers.h" #include "bpf_net_helpers.h" #include "bpf_tethering.h" diff --git a/Tethering/bpf_progs/test.c b/Tethering/bpf_progs/test.c index 3f0df2eae7..a76e346d4c 100644 --- a/Tethering/bpf_progs/test.c +++ b/Tethering/bpf_progs/test.c @@ -18,6 +18,9 @@ #include #include +// The resulting .o needs to load on the Android S bpfloader v0.2 +#define BPFLOADER_MIN_VER 2u + #include "bpf_helpers.h" #include "bpf_net_helpers.h" #include "bpf_tethering.h"