Commit f07203b0 authored by Jian Shen's avatar Jian Shen Committed by David S. Miller

net: hns3: refine for hns3_del_all_fd_entries()

For only PF driver can configure flow director rule, it's
better to call hclge_del_all_fd_entries() directly in hclge
layer, rather than call hns3_del_all_fd_entries() in hns3
layer. Then the ae_algo->ops.del_all_fd_entries can be removed.
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc4243b8
...@@ -612,8 +612,6 @@ struct hnae3_ae_ops { ...@@ -612,8 +612,6 @@ struct hnae3_ae_ops {
struct ethtool_rxnfc *cmd); struct ethtool_rxnfc *cmd);
int (*del_fd_entry)(struct hnae3_handle *handle, int (*del_fd_entry)(struct hnae3_handle *handle,
struct ethtool_rxnfc *cmd); struct ethtool_rxnfc *cmd);
void (*del_all_fd_entries)(struct hnae3_handle *handle,
bool clear_list);
int (*get_fd_rule_cnt)(struct hnae3_handle *handle, int (*get_fd_rule_cnt)(struct hnae3_handle *handle,
struct ethtool_rxnfc *cmd); struct ethtool_rxnfc *cmd);
int (*get_fd_rule_info)(struct hnae3_handle *handle, int (*get_fd_rule_info)(struct hnae3_handle *handle,
......
...@@ -4143,14 +4143,6 @@ static void hns3_uninit_phy(struct net_device *netdev) ...@@ -4143,14 +4143,6 @@ static void hns3_uninit_phy(struct net_device *netdev)
h->ae_algo->ops->mac_disconnect_phy(h); h->ae_algo->ops->mac_disconnect_phy(h);
} }
static void hns3_del_all_fd_rules(struct net_device *netdev, bool clear_list)
{
struct hnae3_handle *h = hns3_get_handle(netdev);
if (h->ae_algo->ops->del_all_fd_entries)
h->ae_algo->ops->del_all_fd_entries(h, clear_list);
}
static int hns3_client_start(struct hnae3_handle *handle) static int hns3_client_start(struct hnae3_handle *handle)
{ {
if (!handle->ae_algo->ops->client_start) if (!handle->ae_algo->ops->client_start)
...@@ -4337,8 +4329,6 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset) ...@@ -4337,8 +4329,6 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset)
hns3_nic_uninit_irq(priv); hns3_nic_uninit_irq(priv);
hns3_del_all_fd_rules(netdev, true);
hns3_clear_all_ring(handle, true); hns3_clear_all_ring(handle, true);
hns3_nic_uninit_vector_data(priv); hns3_nic_uninit_vector_data(priv);
......
...@@ -6384,13 +6384,9 @@ static void hclge_clear_fd_rules_in_list(struct hclge_dev *hdev, ...@@ -6384,13 +6384,9 @@ static void hclge_clear_fd_rules_in_list(struct hclge_dev *hdev,
spin_unlock_bh(&hdev->fd_rule_lock); spin_unlock_bh(&hdev->fd_rule_lock);
} }
static void hclge_del_all_fd_entries(struct hnae3_handle *handle, static void hclge_del_all_fd_entries(struct hclge_dev *hdev)
bool clear_list)
{ {
struct hclge_vport *vport = hclge_get_vport(handle); hclge_clear_fd_rules_in_list(hdev, true);
struct hclge_dev *hdev = vport->back;
hclge_clear_fd_rules_in_list(hdev, clear_list);
} }
static int hclge_restore_fd_entries(struct hnae3_handle *handle) static int hclge_restore_fd_entries(struct hnae3_handle *handle)
...@@ -11427,6 +11423,7 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev) ...@@ -11427,6 +11423,7 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev)
hclge_misc_affinity_teardown(hdev); hclge_misc_affinity_teardown(hdev);
hclge_state_uninit(hdev); hclge_state_uninit(hdev);
hclge_uninit_mac_table(hdev); hclge_uninit_mac_table(hdev);
hclge_del_all_fd_entries(hdev);
if (mac->phydev) if (mac->phydev)
mdiobus_unregister(mac->mdio_bus); mdiobus_unregister(mac->mdio_bus);
...@@ -12250,7 +12247,6 @@ static const struct hnae3_ae_ops hclge_ops = { ...@@ -12250,7 +12247,6 @@ static const struct hnae3_ae_ops hclge_ops = {
.get_link_mode = hclge_get_link_mode, .get_link_mode = hclge_get_link_mode,
.add_fd_entry = hclge_add_fd_entry, .add_fd_entry = hclge_add_fd_entry,
.del_fd_entry = hclge_del_fd_entry, .del_fd_entry = hclge_del_fd_entry,
.del_all_fd_entries = hclge_del_all_fd_entries,
.get_fd_rule_cnt = hclge_get_fd_rule_cnt, .get_fd_rule_cnt = hclge_get_fd_rule_cnt,
.get_fd_rule_info = hclge_get_fd_rule_info, .get_fd_rule_info = hclge_get_fd_rule_info,
.get_fd_all_rules = hclge_get_all_rules, .get_fd_all_rules = hclge_get_all_rules,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment