dpdk/0157-net-hns3-fix-log-on-flow-director-clear.patch
speech_white 3a8995b1ad Update DPDK baseline version
Update DPDK version from 19.11 to 20.11 and also support
hns3 PMD for Kunpeng 920 and Kunpeng 930.

Signed-off-by: speech_white <humin29@huawei.com>
2021-06-28 00:52:34 +00:00

66 lines
2.0 KiB
Diff

From f3a62e370e72558eb1fe41b540b9aad7036b9679 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 7 May 2021 17:08:15 +0800
Subject: [PATCH 157/189] net/hns3: fix log on flow director clear
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 06dd51b..e87e064 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