From: shenhao shenhao21@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
--------------------------------------------
When restores rules failed in flow table list, PF driver should delete this rule in list and go on restore the rest rules. It means that it would never return other value except "0" in hclge_restore_fd_entries. So this patch modify the return type to "void".
Signed-off-by: Guojia Liao liaoguojia@huawei.com Signed-off-by: shenhao shenhao21@huawei.com Reviewed-by: Zhong Zhaohui zhongzhaohui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index b73c417..e2fa3b3 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -526,7 +526,7 @@ struct hnae3_ae_ops { struct ethtool_rxnfc *cmd); int (*get_fd_all_rules)(struct hnae3_handle *handle, struct ethtool_rxnfc *cmd, u32 *rule_locs); - int (*restore_fd_rules)(struct hnae3_handle *handle); + void (*restore_fd_rules)(struct hnae3_handle *handle); void (*enable_fd)(struct hnae3_handle *handle, bool enable); int (*add_arfs_entry)(struct hnae3_handle *handle, u16 queue_id, u16 flow_id, struct flow_keys *fkeys); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index a620b20..61d4362 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -68,7 +68,7 @@ static int hclge_set_default_loopback(struct hclge_dev *hdev);
static void hclge_sync_mac_table(struct hclge_dev *hdev); -static int hclge_restore_hw_table(struct hclge_dev *hdev); +static void hclge_restore_hw_table(struct hclge_dev *hdev); static void hclge_sync_promisc_mode(struct hclge_dev *hdev); static int hclge_vf_vlan_filter_switch(struct hclge_vport *vport);
@@ -5995,7 +5995,7 @@ static void hclge_del_all_fd_entries(struct hnae3_handle *handle, } }
-static int hclge_restore_fd_entries(struct hnae3_handle *handle) +static void hclge_restore_fd_entries(struct hnae3_handle *handle) { struct hclge_vport *vport = hclge_get_vport(handle); struct hclge_dev *hdev = vport->back; @@ -6008,11 +6008,11 @@ static int hclge_restore_fd_entries(struct hnae3_handle *handle) * fail. */ if (!hnae3_dev_fd_supported(hdev)) - return 0; + return;
/* if fd is disabled, should not restore it when reset */ if (!hdev->fd_en) - return 0; + return;
spin_lock_bh(&hdev->fd_rule_lock); hlist_for_each_entry_safe(rule, node, &hdev->fd_rule_list, rule_node) { @@ -6035,8 +6035,6 @@ static int hclge_restore_fd_entries(struct hnae3_handle *handle) hdev->fd_active_type = HCLGE_FD_EP_ACTIVE;
spin_unlock_bh(&hdev->fd_rule_lock); - - return 0; }
static int hclge_get_fd_rule_cnt(struct hnae3_handle *handle, @@ -8996,7 +8994,7 @@ void hclge_restore_mac_table_common(struct hclge_vport *vport) spin_unlock_bh(&vport->mac_list_lock); }
-static int hclge_restore_hw_table(struct hclge_dev *hdev) +static void hclge_restore_hw_table(struct hclge_dev *hdev) { struct hclge_vport *vport = &hdev->vport[0]; struct hnae3_handle *handle = &vport->nic; @@ -9006,7 +9004,7 @@ static int hclge_restore_hw_table(struct hclge_dev *hdev) hclge_restore_vport_vlan_table(vport); set_bit(HCLGE_STATE_PROMISC_CHANGED, &hdev->state);
- return hclge_restore_fd_entries(handle); + hclge_restore_fd_entries(handle); }
int hclge_en_hw_strip_rxvtag(struct hnae3_handle *handle, bool enable)