git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/hns3: fix delay for waiting to stop Rx/Tx
[dpdk.git]
/
drivers
/
net
/
hns3
/
hns3_fdir.c
diff --git
a/drivers/net/hns3/hns3_fdir.c
b/drivers/net/hns3/hns3_fdir.c
index
0ef0938
..
d043f57
100644
(file)
--- a/
drivers/net/hns3/hns3_fdir.c
+++ b/
drivers/net/hns3/hns3_fdir.c
@@
-1026,25
+1026,37
@@
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;
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 */
rte_hash_reset(fdir_info->hash_handle);
int ret = 0;
/* flush flow director */
rte_hash_reset(fdir_info->hash_handle);
+ memset(fdir_info->hash_map, 0,
+ sizeof(struct hns3_fdir_rule_ele *) *
+ fdir_info->fd_cfg.rule_num[HNS3_FD_STAGE_1]);
+
fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list);
while (fdir_filter) {
TAILQ_REMOVE(&fdir_info->fdir_list, fdir_filter, entries);
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);
}
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;
}
ret = -EIO;
}
+
return ret;
}
return ret;
}