Get bpf level when check bpf support
Instead of return boolean, bpf support check now returns a integer
represent the current bpf level on device. This level is used to decide
if the device support some advanced bpf feature such as map_in_map and
bpf cgroup socket filter. Delete the binder call for bpf status check
since no one is using it.
Bug: 111441138
Test: libnetdbpf_test, netd_integration_test
Change-Id: Ib70c07647ffe491d493b4582b4b4b0eba7caf3a9
diff --git a/server/Controllers.cpp b/server/Controllers.cpp
index 8f0dad2..a5c9eba 100644
--- a/server/Controllers.cpp
+++ b/server/Controllers.cpp
@@ -282,7 +282,7 @@
}
gLog.info("Initializing traffic control: %.1fms", s.getTimeAndReset());
- bandwidthCtrl.setBpfEnabled(trafficCtrl.checkBpfStatsEnable());
+ bandwidthCtrl.setBpfEnabled(trafficCtrl.getBpfLevel() != android::bpf::BpfLevel::NONE);
bandwidthCtrl.enableBandwidthControl();
gLog.info("Enabling bandwidth control: %.1fms", s.getTimeAndReset());