Skip to contentSkip to conversation

nfp: flower: fix used time of merge flow statistics

PATCH In review Simon Horman 2 participants 2 messages May 27, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfp: flower: fix used time of merge flow statistics

From: Heinrich Kuhn <[email protected]>

Prior to this change the correct value for the used counter is calculated but not stored nor, therefore, propagated to user-space. In use-cases such as OVS use-case at least this results in active flows being removed from the hardware datapath. Which results in both unnecessary flow tear-down and setup, and packet processing on the host.

This patch addresses the problem by saving the calculated used value which allows the value to propagate to user-space.

Found by inspection.

Fixes aa6ce2ea0c93 ("nfp: flower: support stats update for merge flows")
---
 drivers/net/ethernet/netronome/nfp/flower/offload.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/netronome/nfp/flower/offload.c +2 -1
index c694dbc239d0..6b60771ccb19 100644
@@ -1440,7 +1440,8 @@ __nfp_flower_update_merge_stats(struct nfp_app *app,
 		ctx_id = be32_to_cpu(sub_flow->meta.host_ctx_id);
 		priv->stats[ctx_id].pkts += pkts;
 		priv->stats[ctx_id].bytes += bytes;
-		max_t(u64, priv->stats[ctx_id].used, used);
+		priv->stats[ctx_id].used = max_t(u64, used,
+						 priv->stats[ctx_id].used);
 	}
 }
 
Signature · 1 line
2.20.1
maintainer
#1 lore raw

From: Simon Horman <[email protected]>
Date: Wed, 27 May 2020 09:44:20 +0200

Quoted 8 lines

From: Heinrich Kuhn <[email protected]>

Prior to this change the correct value for the used counter is calculated but not stored nor, therefore, propagated to user-space. In use-cases such as OVS use-case at least this results in active flows being removed from the hardware datapath. Which results in both unnecessary flow tear-down and setup, and packet processing on the host.

Quoted 8 lines

This patch addresses the problem by saving the calculated used value which allows the value to propagate to user-space.

Found by inspection.

Fixes aa6ce2ea0c93 ("nfp: flower: support stats update for merge flows")

Applied and queued up for -stable, thanks.