Skip to content

Commit

Permalink
net: hns3: add judge fd ability for sync and clear process of flow di…
Browse files Browse the repository at this point in the history
…rector

Currently, driver will always clear user defined field of flow director
in uninit process and sync flow director table in periodic task. However,
if hardware does not support flow director driver should not do those
processes, so add fd ability judgement.

The fd ability judgement in function hclge_clear_fd_rules_in_list() is
redundant, so delete it.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Guangbin Huang authored and Jakub Kicinski committed Sep 21, 2022
1 parent 09431ed commit 236b8f5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
Original file line number Diff line number Diff line change
@@ -6628,9 +6628,6 @@ static void hclge_clear_fd_rules_in_list(struct hclge_dev *hdev,
struct hlist_node *node;
u16 location;

if (!hnae3_ae_dev_fd_supported(hdev->ae_dev))
return;

spin_lock_bh(&hdev->fd_rule_lock);

for_each_set_bit(location, hdev->fd_bmap,
@@ -6655,6 +6652,9 @@ static void hclge_clear_fd_rules_in_list(struct hclge_dev *hdev,

static void hclge_del_all_fd_entries(struct hclge_dev *hdev)
{
if (!hnae3_ae_dev_fd_supported(hdev->ae_dev))
return;

hclge_clear_fd_rules_in_list(hdev, true);
hclge_fd_disable_user_def(hdev);
}
@@ -7488,6 +7488,9 @@ static void hclge_sync_fd_list(struct hclge_dev *hdev, struct hlist_head *hlist)

static void hclge_sync_fd_table(struct hclge_dev *hdev)
{
if (!hnae3_ae_dev_fd_supported(hdev->ae_dev))
return;

if (test_and_clear_bit(HCLGE_STATE_FD_CLEAR_ALL, &hdev->state)) {
bool clear_list = hdev->fd_active_type == HCLGE_FD_ARFS_ACTIVE;

0 comments on commit 236b8f5

Please sign in to comment.