From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Heinrich Kuhn <heinrich.kuhn@netronome.com>,
Simon Horman <simon.horman@netronome.com>,
"David S . Miller" <davem@davemloft.net>,
Sasha Levin <sashal@kernel.org>,
oss-drivers@netronome.com, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 08/14] nfp: flower: fix used time of merge flow statistics
Date: Fri, 5 Jun 2020 08:25:34 -0400 [thread overview]
Message-ID: <20200605122540.2882539-8-sashal@kernel.org> (raw)
In-Reply-To: <20200605122540.2882539-1-sashal@kernel.org>
From: Heinrich Kuhn <heinrich.kuhn@netronome.com>
[ Upstream commit 5b186cd60f033110960a3db424ffbd6de4cee528 ]
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 987ae221f6be..4dd3f8a5a9b8 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
@@ -1368,7 +1368,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.25.1
next prev parent reply other threads:[~2020-06-05 12:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-05 12:25 [PATCH AUTOSEL 5.4 01/14] Input: mms114 - fix handling of mms345l Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 02/14] ARM: 8977/1: ptrace: Fix mask for thumb breakpoint hook Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 03/14] sched/fair: Don't NUMA balance for kthreads Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 04/14] net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 05/14] net: check untrusted gso_size at kernel entry Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 06/14] net: usb: qmi_wwan: add Telit LE910C1-EUX composition Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 07/14] Input: synaptics - add a second working PNP_ID for Lenovo T470s Sasha Levin
2020-06-05 12:25 ` Sasha Levin [this message]
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 09/14] csky: Fixup abiv2 syscall_trace break a4 & a5 Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 10/14] gfs2: Even more gfs2_find_jhead fixes Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 11/14] net/mlx5: Fix crash upon suspend/resume Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 12/14] NFC: st21nfca: add missed kfree_skb() in an error path Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 13/14] drivers/net/ibmvnic: Update VNIC protocol version reporting Sasha Levin
2020-06-05 12:25 ` [PATCH AUTOSEL 5.4 14/14] l2tp: do not use inet_hash()/inet_unhash() Sasha Levin
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=20200605122540.2882539-8-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=davem@davemloft.net \
--cc=heinrich.kuhn@netronome.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
--cc=simon.horman@netronome.com \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome