From 64592df482673e1140b0093762e1c375e9608372 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Thu, 10 Feb 2022 15:19:31 +0100 Subject: [PATCH] Improve logging when using ingress rate limits Add some happy path logging that informs about active rate limits. Test: TreeHugger Bug: 218840346 Change-Id: Iddd50583ca2e90afe83a5c68611418fa794afb3f --- service/src/com/android/server/ConnectivityService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java index 008f8664a5..c323f2f5d2 100644 --- a/service/src/com/android/server/ConnectivityService.java +++ b/service/src/com/android/server/ConnectivityService.java @@ -1409,6 +1409,8 @@ public class ConnectivityService extends IConnectivityManager.Stub // converting rateInBytesPerSecond from long to int is safe here because the // setting's range is limited to INT_MAX. // TODO: add long/uint64 support to tcFilterAddDevIngressPolice. + Log.i(TAG, + "enableIngressRateLimit on " + iface + ": " + rateInBytesPerSecond + "B/s"); TcUtils.tcFilterAddDevIngressPolice(params.index, TC_PRIO_POLICE, (short) ETH_P_ALL, (int) rateInBytesPerSecond, TC_POLICE_BPF_PROG_PATH); } catch (IOException e) { @@ -1430,6 +1432,8 @@ public class ConnectivityService extends IConnectivityManager.Stub return; } try { + Log.i(TAG, + "disableIngressRateLimit on " + iface); TcUtils.tcFilterDelDev(params.index, true, TC_PRIO_POLICE, (short) ETH_P_ALL); } catch (IOException e) { loge("TcUtils.tcFilterDelDev(ifaceIndex=" + params.index