Skip to content

Commit

Permalink
net/hns3: clear hash map on flow director clear
Browse files Browse the repository at this point in the history
[ upstream commit 7d01f89 ]

The fdir hash map hold the pointers of fdir rule elements, it needs to
be set to NULL when clear all fdir rules.

Fixes: fcba820 ("net/hns3: support flow director")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
fengchengwen authored and cpaelzer committed Jun 10, 2021
1 parent 041ad33 commit 5016096
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/hns3/hns3_fdir.c
Expand Up @@ -1012,6 +1012,10 @@ int hns3_clear_all_fdir_filter(struct hns3_adapter *hns)
rte_hash_reset(fdir_info->hash_handle);
rte_spinlock_unlock(&fdir_info->flows_lock);

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);
Expand Down

0 comments on commit 5016096

Please sign in to comment.