DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH 2/6] net/hns3: fix logging info when clear all FDIR rules
Date: Fri, 7 May 2021 17:08:15 +0800	[thread overview]
Message-ID: <1620378499-5090-3-git-send-email-humin29@huawei.com> (raw)
In-Reply-To: <1620378499-5090-1-git-send-email-humin29@huawei.com>

From: Chengwen Feng <fengchengwen@huawei.com>

If clear FDIR rules fail, the error code was logged, but the error code
was useless because it was the sum of all fail code.

This patch fixes it by log the success cnt and fail cnt.

Fixes: fcba820d9b9e ("net/hns3: support flow director")
Fixes: 8eed8acc812e ("net/hns3: add error code to some logs")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_fdir.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index 0ef0938..e116d87 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -1026,6 +1026,8 @@ int hns3_clear_all_fdir_filter(struct hns3_adapter *hns)
 	struct hns3_fdir_info *fdir_info = &pf->fdir;
 	struct hns3_fdir_rule_ele *fdir_filter;
 	struct hns3_hw *hw = &hns->hw;
+	int succ_cnt = 0;
+	int fail_cnt = 0;
 	int ret = 0;
 
 	/* flush flow director */
@@ -1034,17 +1036,23 @@ int hns3_clear_all_fdir_filter(struct hns3_adapter *hns)
 	fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list);
 	while (fdir_filter) {
 		TAILQ_REMOVE(&fdir_info->fdir_list, fdir_filter, entries);
-		ret += hns3_fd_tcam_config(hw, true,
-					   fdir_filter->fdir_conf.location,
-					   NULL, false);
+		ret = hns3_fd_tcam_config(hw, true,
+					  fdir_filter->fdir_conf.location,
+					  NULL, false);
+		if (ret == 0)
+			succ_cnt++;
+		else
+			fail_cnt++;
 		rte_free(fdir_filter);
 		fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list);
 	}
 
-	if (ret) {
-		hns3_err(hw, "Fail to delete FDIR filter, ret = %d", ret);
+	if (fail_cnt > 0) {
+		hns3_err(hw, "fail to delete all FDIR filter, success num = %d "
+			 "fail num = %d", succ_cnt, fail_cnt);
 		ret = -EIO;
 	}
+
 	return ret;
 }
 
-- 
2.7.4


  parent reply	other threads:[~2021-05-07  9:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07  9:08 [dpdk-dev] [PATCH 0/6] bugfix for hns3 PMD Min Hu (Connor)
2021-05-07  9:08 ` [dpdk-dev] [PATCH 1/6] net/hns3: return code when PCI config space write fail Min Hu (Connor)
2021-05-07  9:08 ` Min Hu (Connor) [this message]
2021-05-07  9:08 ` [dpdk-dev] [PATCH 3/6] net/hns3: clear hash map when clear all FDIR rules Min Hu (Connor)
2021-05-07  9:08 ` [dpdk-dev] [PATCH 4/6] net/hns3: fix VF setting alive order problem Min Hu (Connor)
2021-05-07  9:08 ` [dpdk-dev] [PATCH 5/6] net/hns3: fix out param not set when query FDIR counter Min Hu (Connor)
2021-05-07  9:08 ` [dpdk-dev] [PATCH 6/6] doc: add link status event pre-conditions Min Hu (Connor)
2021-05-11 16:14   ` Ferruh Yigit
2021-05-12  1:05     ` Min Hu (Connor)
2021-06-30  2:00       ` Min Hu (Connor)
2021-06-30  1:56   ` [dpdk-dev] [PATCH v2] " Min Hu (Connor)
2021-07-02  8:55     ` Andrew Rybchenko
2021-07-02 12:35       ` Thomas Monjalon
2021-07-02 12:58         ` Andrew Rybchenko
2021-07-04 19:42           ` Thomas Monjalon
2021-05-11 16:30 ` [dpdk-dev] [PATCH 0/6] bugfix for hns3 PMD 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=1620378499-5090-3-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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).