From bd8b2e428f30a1921d206dd3e011d97136fadcf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Wed, 17 Apr 2024 06:30:52 +0000 Subject: [PATCH] Add a comment about clat bpf stat lifetime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: 335125325 Test: N/A, comment only Signed-off-by: Maciej Żenczykowski Change-Id: I091b25fb86af9643e9734d42bb03b561f1446431 --- .../src/com/android/server/connectivity/ClatCoordinator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/service/src/com/android/server/connectivity/ClatCoordinator.java b/service/src/com/android/server/connectivity/ClatCoordinator.java index eea16bf73e..aec4f243da 100644 --- a/service/src/com/android/server/connectivity/ClatCoordinator.java +++ b/service/src/com/android/server/connectivity/ClatCoordinator.java @@ -399,6 +399,10 @@ public class ClatCoordinator { mCookieTagMap = mDeps.getBpfCookieTagMap(); } + // Note that this may only be called on a brand new v4-* interface, + // because it uses bpfmap.insertEntry() which fails if entry exists, + // and because the value includes (initialized to 0) byte/packet + // counters, so a replace (instead of insert) would wipe those stats. private void maybeStartBpf(final ClatdTracker tracker) { if (mIngressMap == null || mEgressMap == null) return;