]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nfp: flower: fix used time of merge flow statistics
authorHeinrich Kuhn <heinrich.kuhn@netronome.com>
Wed, 27 May 2020 07:44:20 +0000 (09:44 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2020 18:18:57 +0000 (11:18 -0700)
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: 828a58f05846 ("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/offload.c

index c694dbc239d0129bb22c0787c9c23fca5d501f0a..6b60771ccb195e407c90ea5f056f56f8dd03fece 100644 (file)
@@ -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);
        }
 }