All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] nfp: flower: fix used time of merge flow statistics
@ 2020-05-27  7:44 Simon Horman
  2020-05-27 18:19 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Horman @ 2020-05-27  7:44 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski
  Cc: netdev, oss-drivers, Heinrich Kuhn, Simon Horman

From: Heinrich Kuhn <heinrich.kuhn@netronome.com>

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")
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 drivers/net/ethernet/netronome/nfp/flower/offload.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c
index c694dbc239d0..6b60771ccb19 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
@@ -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);
 	}
 }
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] nfp: flower: fix used time of merge flow statistics
  2020-05-27  7:44 [PATCH net] nfp: flower: fix used time of merge flow statistics Simon Horman
@ 2020-05-27 18:19 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-27 18:19 UTC (permalink / raw)
  To: simon.horman; +Cc: jakub.kicinski, netdev, oss-drivers, heinrich.kuhn

From: Simon Horman <simon.horman@netronome.com>
Date: Wed, 27 May 2020 09:44:20 +0200

> From: Heinrich Kuhn <heinrich.kuhn@netronome.com>
> 
> 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")
> Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
> Signed-off-by: Simon Horman <simon.horman@netronome.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-27 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27  7:44 [PATCH net] nfp: flower: fix used time of merge flow statistics Simon Horman
2020-05-27 18:19 ` David Miller

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.