Article View: linux.kernel.netdev
Article #16840[PATCH net-next 04/13] net: airoha: update stats on flow deletion
From: Pablo Neira Ayuso
Date: Mon, 16 Nov 2026 00:16
Date: Mon, 16 Nov 2026 00:16
77 lines
10622 bytes
10622 bytes
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Update this driver to use the new approach to fetch stats on flow
deletion, introduced by ("netfilter: flowtable: retrieve stats on flow
deletion").
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
drivers/net/ethernet/airoha/airoha_ppe.c | 31 +++++++++++++++---------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/airoha/airoha_ppe.c b/drivers/net/ethernet/airoha/airoha_ppe.c
index f5369c45766d..af8c7fe9b7f0 100644
--- a/drivers/net/ethernet/airoha/airoha_ppe.c
+++ b/drivers/net/ethernet/airoha/airoha_ppe.c
@@ -1285,6 +1285,23 @@ static int airoha_ppe_flow_offload_replace(struct airoha_eth *eth,
return err;
}
+static void airoha_ppe_flow_update_stats(struct airoha_eth *eth,
+ struct flow_cls_offload *f,
+ struct airoha_flow_table_entry *e)
+{
+ u32 idle = airoha_ppe_entry_idle_time(eth->ppe, e);
+
+ f->stats.lastused = jiffies - idle * HZ;
+ if (e->hash != 0xffff) {
+ struct airoha_foe_stats64 stats = {};
+
+ airoha_ppe_foe_entry_get_stats(eth->ppe, e->hash, &stats);
+ f->stats.pkts += (stats.packets - e->stats.packets);
+ f->stats.bytes += (stats.bytes - e->stats.bytes);
+ e->stats = stats;
+ }
+}
+
static int airoha_ppe_flow_offload_destroy(struct airoha_eth *eth,
struct flow_cls_offload *f)
{
@@ -1295,6 +1312,7 @@ static int airoha_ppe_flow_offload_destroy(struct airoha_eth *eth,
if (!e)
return -ENOENT;
+ airoha_ppe_flow_update_stats(eth, f, e);
airoha_ppe_foe_flow_remove_entry(eth->ppe, e);
rhashtable_remove_fast(ð->flow_table, &e->node,
airoha_flow_table_params);
@@ -1342,24 +1360,13 @@ static int airoha_ppe_flow_offload_stats(struct airoha_eth *eth,
struct flow_cls_offload *f)
{
struct airoha_flow_table_entry *e;
- u32 idle;
e = rhashtable_lookup(ð->flow_table, &f->cookie,
airoha_flow_table_params);
if (!e)
return -ENOENT;
- idle = airoha_ppe_entry_idle_time(eth->ppe, e);
- f->stats.lastused = jiffies - idle * HZ;
-
- if (e->hash != 0xffff) {
- struct airoha_foe_stats64 stats = {};
-
- airoha_ppe_foe_entry_get_stats(eth->ppe, e->hash, &stats);
- f->stats.pkts += (stats.packets - e->stats.packets);
- f->stats.bytes += (stats.bytes - e->stats.bytes);
- e->stats = stats;
- }
+ airoha_ppe_flow_update_stats(eth, f, e);
return 0;
}
--
2.47.3
Technical Details
Message-ID:
<20261116001612.2806263-5-pablo@netfilter.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363928-linux-kernel-netdev=dewy.ruReferences:
<20261116001612.2806263-1-pablo@netfilter.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363928-linux-kernel-netdev=dewy.ru From: pablo@netfilter.org (Pablo Neira Ayuso) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next 04/13] net: airoha: update stats on flow deletion Date: Mon, 16 Nov 2026 01:16:03 +0100 Organization: Usenet Network Message-ID: <20261116001612.2806263-5-pablo@netfilter.org> References: <20261116001612.2806263-1-pablo@netfilter.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1941207"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:WcljUFOd2QCYq96rYb7JcJrfSm0= sha256:Uhcw4ySSoXN+beC0ipfesnJQYEhsRNRGBApHP3wQWL0= sha1:SwfCaS3+NECjomLlOzFQLBVlpEY= sha256:Mhsj3QGo6VOBGpqHOlwMS+kcXOFUHLOLgmURdqEg2IU= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id E0BF8114AB7; Mon, 16 Nov 2026 03:16:44 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=netfilter.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 533mbFOi0aJv; Mon, 16 Nov 2026 03:16:42 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363928-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=netfilter.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 029B1114AB4; Mon, 16 Nov 2026 03:16:32 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 98F922E1F1; Mon, 16 Nov 2026 00:16:31 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1794788191; b=u5JkuwRHBfDqC0+JX/NrNmRgiRzHpR1Fs+VJVzYxVdWPOXVB+2KNRDQuJxWeh9tZUn1v 5d8bN+t5WJgPRwUkpRLbfu5cdBIUquwnjG2LC0t2tNM3/s/7aRq3asabuVOSWm6RED67Y uLT6mkpWIp9Pmgbuhs6kUuRE8XwWpGoeQRpIlcQ7q6Ub9YdTdaM7YN/QK3dBzIGxJMJ67 oJuUexyVL0QwrlEw3rY4JGB8Hfn25uYRfoYcsvwne7i03O7XhkQyxuqFa3zcauLOWA24Y sHglUKbyX9s0d5GJeGjjP/UugJ02PfwS1MWje3Xl0oHF35j0fv93eAsMe6iBeVd8EUA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794788191; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=TG/14QAYLr9AECWOTVuoUws/MaH0SzB3BMceRMURL3c=; b=AXvRRHLY04+3Ve4Xp/tdtxpMSLx9ikyqauX4Y8/W/o2lVN4Rd/j+YpYEeL9kQ0i2SdiE Rj0VVkgjPZyinRgiv40bRLehTSvKZJTkg/wYwqKjcV80iA7qDwSidqH5Wet5qMeiKKnSk 3VzcGp12kO5gAbFGqXW4NqZduAhb92tZIM7NWjhrm87n9nnWx/6XBebqHY2a/vfaQGEp8 T9bt6DJDlsMeolqKv0AX+WXXMiunkasojEivGfdSNe04p0dW1SsYeYw/foW/9B3lBf0Wc 40lBeqTRI3fIke7U9bCMgiffhJaTg1town679q0hp3b9wBiLkXFn/kr6Y9Nr0gVA4bw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b="a8fl18/1"; dmarc=none header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; arc=fail smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5BB42606A334; Mon, 16 Nov 2026 00:16:31 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=a8fl18/1 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794788190; b=wwDIwfY/aH1hC+i34e2fDv2DB9R4CT4ADz6++Bx2lkS4rEnD0+DZ/tfHr1VKJwoQMLhi 91a5F85xtyRegUg8j9boxWqg9rrPok7sXnhIJKySx1y8Jwm1EdlFd3JqsbRicZ/dzK9M2 p4e/bmyY9TjXaW/aUq7EB/3klzLcAW45Bly78uRz0AyZTlHz9I2wm7ARdWJZuf+XI4FdZ kYchnQd37eQJXaQm19Wd/LuZLDvb/7Qm4jRwqXE9Wboyr58/n4076bni/9D8SqDcVnp2g fCPFvsgYwbRA7ZwovJTCtY/oYGDjsTiq66LyCCGgu7KBWtO1rnjDe9woZuiahNX0r3g== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794788190; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Spam-Status:X-Spam-Checker-Version; bh=TG/14QAYLr9AECWOTVuoUws/MaH0SzB3BMceRMURL3c=; b=zaOBRQUUaSbcCQmtbdeBewKgVmQGE2GukjT5yDPgUeLX9GvLxEEWclHAW1UU4jF/ktP7 Wpgar0ydoAph9UBiJeR+bSQmsgVOksKKtJvmkBj1pQcU/wnwOQeuONXRQTX3B0wYd1lSj /qxf+nRNp3iMmHNCY1dZOjkFtaJ7C3z2e8oiGtCgZyldeItuqfiBc3Ii+EW5J77KGTIHR 1TKs5FvCcJw5O9c5ZL8m9t+WiZmlwdJuFzq+BmuEocJAnAnQKEQ5Bl28ksVO3oPltlkQe qPqWE7KCTN9gW9nnhm1X0gwoze2rFa0Q4oR9iOJZZuRnrApUsY5TKZFC8kE7bfVyG1w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b="a8fl18/1"; arc=none smtp.remote-ip=217.70.190.124 X-Received: from mail.netfilter.org (mail.netfilter.org [217.70.190.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 072DB606A339; Mon, 16 Nov 2026 00:16:29 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 072DB606A339 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org; s=2025; t=1794788186; bh=TG/14QAYLr9AECWOTVuoUws/MaH0SzB3BMceRMURL3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a8fl18/1id9f/Ao6aFXKB+TjjCWn9buCJt4eq9P7n7Hqg11q/QK0djujI71ouRnzE pN7eBkQgVgSb5qT01Y5MAQebRZBmeIg5Nk0YDAbou5XsDCecUGToCwj0c962ws3j6H 2Dl95ny8gCt3+umjWILwBNYkIZDoxQgyouYYE3jYIJh06HDJl3mIc6jlNJxjUcNuYX Xmy0RgAcwr+7+2hV0i+COBmUdnngFCno/5A6hjnm5NFIcQqTGPCguccICMbJQolGzN 2QSfqBzNpSIDKbDHh/tb9CG7NHPb3D0cj1tNeYJGD7Lce/dtCC793ehKxJOS2OGZwD 6O3TaVp25dU7Q== X-Received: from localhost.localdomain (mail-agni [217.70.190.124]) by mail.netfilter.org (Postfix) with ESMTPSA id E1A7E60058; Mon, 16 Nov 2026 01:16:25 +0100 (CET) X-Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, horms@kernel.org, fw@strlen.de, ja@ssi.bg X-Mailer: git-send-email 2.47.3 X-In-Reply-To: <20261116001612.2806263-1-pablo@netfilter.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list