DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com,
	Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH] net/nfp: store counter reset before zeroing flow query
Date: Fri,  9 Dec 2022 14:22:59 +0800	[thread overview]
Message-ID: <20221209062259.22341-1-chaoyong.he@corigine.com> (raw)

The reset flag in the query structure are cleared by mistake, cause
the flow count never be reset, so the query API will always has count
value even the flow has stopped, and this will cause the flow never
been aged.

Fixes: 30ecce522732 ("net/nfp: support flow API")
Cc: chaoyong.he@corigine.com

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 6f79d950db..e177e75ff8 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -3809,6 +3809,7 @@ nfp_flow_stats_get(struct rte_eth_dev *dev,
 		struct rte_flow *nfp_flow,
 		void *data)
 {
+	bool reset;
 	uint32_t ctx_id;
 	struct rte_flow *flow;
 	struct nfp_flow_priv *priv;
@@ -3823,6 +3824,7 @@ nfp_flow_stats_get(struct rte_eth_dev *dev,
 	}
 
 	query = (struct rte_flow_query_count *)data;
+	reset = query->reset;
 	memset(query, 0, sizeof(*query));
 
 	ctx_id = rte_be_to_cpu_32(nfp_flow->payload.meta->host_ctx_id);
@@ -3834,7 +3836,7 @@ nfp_flow_stats_get(struct rte_eth_dev *dev,
 		query->bytes = stats->bytes;
 		query->hits_set = 1;
 		query->bytes_set = 1;
-		if (query->reset != 0) {
+		if (reset != 0) {
 			stats->pkts = 0;
 			stats->bytes = 0;
 		}
-- 
2.29.3


             reply	other threads:[~2022-12-09  6:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09  6:22 Chaoyong He [this message]
2022-12-09  8:17 ` [PATCH v2] " Chaoyong He
2023-01-17 17:00   ` Ferruh Yigit

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=20221209062259.22341-1-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=niklas.soderlund@corigine.com \
    --cc=oss-drivers@corigine.com \
    /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;
as well as URLs for NNTP newsgroup(s).