From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: netfilter-devel@vger.kernel.org, nbd@nbd.name
Subject: Re: [PATCH nf-next,v2 1/2] netfilter: flowtable: retrieve stats on flow deletion
Date: Thu, 29 Oct 2026 12:40:41 +0100 [thread overview]
Message-ID: <auMwuTTFuVLYKvOE@chamomile> (raw)
In-Reply-To: <auMwW3OirtvvRYE-@lore-desk>
On Thu, Oct 29, 2026 at 12:39:07PM +0100, Lorenzo Bianconi wrote:
> I guess you can add even the patch below.
Thanks, more driver updates are good :-)
>
> Regards,
> Lorenzo
>
> From c13752f12d74e35685f427f28659e8cd632d028b Mon Sep 17 00:00:00 2001
> Message-ID: <c13752f12d74e35685f427f28659e8cd632d028b.1793273803.git.lorenzo.bianconi@oss.qualcomm.com>
> From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
> Date: Thu, 29 Oct 2026 12:35:23 +0100
> Subject: [PATCH] net: airoha: update stats on flow deletion
>
> 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>
> ---
> 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 92611802801e..35750b61028b 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.56.0
>
prev parent reply other threads:[~2026-10-29 11:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 11:34 [PATCH nf-next,v2 1/2] netfilter: flowtable: retrieve stats on flow deletion Pablo Neira Ayuso
2026-10-29 11:34 ` [PATCH nf-next,v2 2/2] net: ethernet: mtk_ppe: update " Pablo Neira Ayuso
2026-10-29 11:39 ` [PATCH nf-next,v2 1/2] netfilter: flowtable: retrieve " Lorenzo Bianconi
2026-10-29 11:40 ` Pablo Neira Ayuso [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=auMwuTTFuVLYKvOE@chamomile \
--to=pablo@netfilter.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.