enable btf = true for block/clatd/dscp_policy/netd bpf programs
(we avoid offload - for now - due to that being shipped to <T devices)
Before:
$ adbz shell ls -l /apex/com.android.tethering/etc/bpf/net_shared/*.o
-rw-r--r-- 1 system system 2848 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/net_shared/block.o
-rw-r--r-- 1 system system 10240 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/net_shared/clatd.o
-rw-r--r-- 1 system system 16144 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/net_shared/dscp_policy.o
-rw-r--r-- 1 system system 18840 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/net_shared/netd.o
After:
$ adbz shell ls -l /apex/com.android.tethering/etc/bpf/net_shared/*.o
-rw-r--r-- 1 system system 6192 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/net_shared/block.o
-rw-r--r-- 1 system system 19008 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/net_shared/clatd.o
-rw-r--r-- 1 system system 23960 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/net_shared/dscp_policy.o
-rw-r--r-- 1 system system 27112 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/net_shared/netd.o
So there is a minor increase in .o size, but this allows:
$ adbz shell cat /sys/fs/bpf/net_shared/map_netd_iface_index_name_map
# WARNING!! The output is for debug purpose only
# WARNING!! The output format will change
8: {['e','r','s','p','a','n','0',],}
1: {['l','o',],}
4: {['i','f','b','1',],}
2: {['d','u','m','m','y','0',],}
16: {['e','t','h','1',],}
5: {['t','u','n','l','0',],}
14: {['h','w','s','i','m','0',],}
17: {['w','l','a','n','0',],}
12: {['i','p','6','t','n','l','0',],}
18: {['w','l','a','n','1',],}
13: {['i','p','6','g','r','e','0',],}
3: {['i','f','b','0',],}
15: {['b','u','r','i','e','d','_','e','t','h','0',],}
9: {['i','p','_','v','t','i','0',],}
11: {['s','i','t','0',],}
10: {['i','p','6','_','v','t','i','0',],}
6: {['g','r','e','0',],}
7: {['g','r','e','t','a','p','0',],}
This is safe as the net_shared bpf programs are not loaded on pre-T devices,
and the T bpfloader is btf enabled.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2d480391b6d1a6e2ba99b0445281684d4a51d74b
diff --git a/bpf_progs/Android.bp b/bpf_progs/Android.bp
index 0e7b22d..6c78244 100644
--- a/bpf_progs/Android.bp
+++ b/bpf_progs/Android.bp
@@ -61,6 +61,7 @@
bpf {
name: "block.o",
srcs: ["block.c"],
+ btf: true,
cflags: [
"-Wall",
"-Werror",
@@ -71,6 +72,7 @@
bpf {
name: "dscp_policy.o",
srcs: ["dscp_policy.c"],
+ btf: true,
cflags: [
"-Wall",
"-Werror",
@@ -99,6 +101,7 @@
bpf {
name: "clatd.o",
srcs: ["clatd.c"],
+ btf: true,
cflags: [
"-Wall",
"-Werror",
@@ -112,6 +115,7 @@
bpf {
name: "netd.o",
srcs: ["netd.c"],
+ btf: true,
cflags: [
"-Wall",
"-Werror",