Commit b69c9737 authored by Yonglong Liu's avatar Yonglong Liu Committed by David S. Miller

net: hns3: delete the redundant user NIC codes

Since HNAE3_CLIENT_UNIC and HNAE3_DEV_UNIC is not used any more,
this patch removes the redundant codes.
Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0cd86182
...@@ -16,14 +16,10 @@ static LIST_HEAD(hnae3_ae_dev_list); ...@@ -16,14 +16,10 @@ static LIST_HEAD(hnae3_ae_dev_list);
*/ */
static DEFINE_MUTEX(hnae3_common_lock); static DEFINE_MUTEX(hnae3_common_lock);
static bool hnae3_client_match(enum hnae3_client_type client_type, static bool hnae3_client_match(enum hnae3_client_type client_type)
enum hnae3_dev_type dev_type)
{ {
if ((dev_type == HNAE3_DEV_KNIC) && (client_type == HNAE3_CLIENT_KNIC || if (client_type == HNAE3_CLIENT_KNIC ||
client_type == HNAE3_CLIENT_ROCE)) client_type == HNAE3_CLIENT_ROCE)
return true;
if (dev_type == HNAE3_DEV_UNIC && client_type == HNAE3_CLIENT_UNIC)
return true; return true;
return false; return false;
...@@ -39,9 +35,6 @@ void hnae3_set_client_init_flag(struct hnae3_client *client, ...@@ -39,9 +35,6 @@ void hnae3_set_client_init_flag(struct hnae3_client *client,
case HNAE3_CLIENT_KNIC: case HNAE3_CLIENT_KNIC:
hnae3_set_bit(ae_dev->flag, HNAE3_KNIC_CLIENT_INITED_B, inited); hnae3_set_bit(ae_dev->flag, HNAE3_KNIC_CLIENT_INITED_B, inited);
break; break;
case HNAE3_CLIENT_UNIC:
hnae3_set_bit(ae_dev->flag, HNAE3_UNIC_CLIENT_INITED_B, inited);
break;
case HNAE3_CLIENT_ROCE: case HNAE3_CLIENT_ROCE:
hnae3_set_bit(ae_dev->flag, HNAE3_ROCE_CLIENT_INITED_B, inited); hnae3_set_bit(ae_dev->flag, HNAE3_ROCE_CLIENT_INITED_B, inited);
break; break;
...@@ -61,10 +54,6 @@ static int hnae3_get_client_init_flag(struct hnae3_client *client, ...@@ -61,10 +54,6 @@ static int hnae3_get_client_init_flag(struct hnae3_client *client,
inited = hnae3_get_bit(ae_dev->flag, inited = hnae3_get_bit(ae_dev->flag,
HNAE3_KNIC_CLIENT_INITED_B); HNAE3_KNIC_CLIENT_INITED_B);
break; break;
case HNAE3_CLIENT_UNIC:
inited = hnae3_get_bit(ae_dev->flag,
HNAE3_UNIC_CLIENT_INITED_B);
break;
case HNAE3_CLIENT_ROCE: case HNAE3_CLIENT_ROCE:
inited = hnae3_get_bit(ae_dev->flag, inited = hnae3_get_bit(ae_dev->flag,
HNAE3_ROCE_CLIENT_INITED_B); HNAE3_ROCE_CLIENT_INITED_B);
...@@ -82,7 +71,7 @@ static int hnae3_init_client_instance(struct hnae3_client *client, ...@@ -82,7 +71,7 @@ static int hnae3_init_client_instance(struct hnae3_client *client,
int ret; int ret;
/* check if this client matches the type of ae_dev */ /* check if this client matches the type of ae_dev */
if (!(hnae3_client_match(client->type, ae_dev->dev_type) && if (!(hnae3_client_match(client->type) &&
hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B))) { hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B))) {
return 0; return 0;
} }
...@@ -99,7 +88,7 @@ static void hnae3_uninit_client_instance(struct hnae3_client *client, ...@@ -99,7 +88,7 @@ static void hnae3_uninit_client_instance(struct hnae3_client *client,
struct hnae3_ae_dev *ae_dev) struct hnae3_ae_dev *ae_dev)
{ {
/* check if this client matches the type of ae_dev */ /* check if this client matches the type of ae_dev */
if (!(hnae3_client_match(client->type, ae_dev->dev_type) && if (!(hnae3_client_match(client->type) &&
hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B))) hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B)))
return; return;
......
...@@ -102,15 +102,9 @@ enum hnae3_loop { ...@@ -102,15 +102,9 @@ enum hnae3_loop {
enum hnae3_client_type { enum hnae3_client_type {
HNAE3_CLIENT_KNIC, HNAE3_CLIENT_KNIC,
HNAE3_CLIENT_UNIC,
HNAE3_CLIENT_ROCE, HNAE3_CLIENT_ROCE,
}; };
enum hnae3_dev_type {
HNAE3_DEV_KNIC,
HNAE3_DEV_UNIC,
};
/* mac media type */ /* mac media type */
enum hnae3_media_type { enum hnae3_media_type {
HNAE3_MEDIA_TYPE_UNKNOWN, HNAE3_MEDIA_TYPE_UNKNOWN,
...@@ -220,7 +214,6 @@ struct hnae3_ae_dev { ...@@ -220,7 +214,6 @@ struct hnae3_ae_dev {
struct list_head node; struct list_head node;
u32 flag; u32 flag;
u8 override_pci_need_reset; /* fix to stop multiple reset happening */ u8 override_pci_need_reset; /* fix to stop multiple reset happening */
enum hnae3_dev_type dev_type;
enum hnae3_reset_type reset_type; enum hnae3_reset_type reset_type;
void *priv; void *priv;
}; };
......
...@@ -1837,7 +1837,6 @@ static int hns3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1837,7 +1837,6 @@ static int hns3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ae_dev->pdev = pdev; ae_dev->pdev = pdev;
ae_dev->flag = ent->driver_data; ae_dev->flag = ent->driver_data;
ae_dev->dev_type = HNAE3_DEV_KNIC;
ae_dev->reset_type = HNAE3_NONE_RESET; ae_dev->reset_type = HNAE3_NONE_RESET;
hns3_get_dev_capability(pdev, ae_dev); hns3_get_dev_capability(pdev, ae_dev);
pci_set_drvdata(pdev, ae_dev); pci_set_drvdata(pdev, ae_dev);
......
...@@ -1461,11 +1461,6 @@ static int hclge_map_tqp(struct hclge_dev *hdev) ...@@ -1461,11 +1461,6 @@ static int hclge_map_tqp(struct hclge_dev *hdev)
return 0; return 0;
} }
static void hclge_unic_setup(struct hclge_vport *vport, u16 num_tqps)
{
/* this would be initialized later */
}
static int hclge_vport_setup(struct hclge_vport *vport, u16 num_tqps) static int hclge_vport_setup(struct hclge_vport *vport, u16 num_tqps)
{ {
struct hnae3_handle *nic = &vport->nic; struct hnae3_handle *nic = &vport->nic;
...@@ -1476,20 +1471,12 @@ static int hclge_vport_setup(struct hclge_vport *vport, u16 num_tqps) ...@@ -1476,20 +1471,12 @@ static int hclge_vport_setup(struct hclge_vport *vport, u16 num_tqps)
nic->ae_algo = &ae_algo; nic->ae_algo = &ae_algo;
nic->numa_node_mask = hdev->numa_node_mask; nic->numa_node_mask = hdev->numa_node_mask;
if (hdev->ae_dev->dev_type == HNAE3_DEV_KNIC) { ret = hclge_knic_setup(vport, num_tqps,
ret = hclge_knic_setup(vport, num_tqps, hdev->num_tx_desc, hdev->num_rx_desc);
hdev->num_tx_desc, hdev->num_rx_desc); if (ret)
dev_err(&hdev->pdev->dev, "knic setup failed %d\n", ret);
if (ret) {
dev_err(&hdev->pdev->dev, "knic setup failed %d\n",
ret);
return ret;
}
} else {
hclge_unic_setup(vport, num_tqps);
}
return 0; return ret;
} }
static int hclge_alloc_vport(struct hclge_dev *hdev) static int hclge_alloc_vport(struct hclge_dev *hdev)
...@@ -8263,17 +8250,6 @@ static int hclge_init_client_instance(struct hnae3_client *client, ...@@ -8263,17 +8250,6 @@ static int hclge_init_client_instance(struct hnae3_client *client,
if (ret) if (ret)
goto clear_roce; goto clear_roce;
break;
case HNAE3_CLIENT_UNIC:
hdev->nic_client = client;
vport->nic.client = client;
ret = client->ops->init_instance(&vport->nic);
if (ret)
goto clear_nic;
hnae3_set_client_init_flag(client, ae_dev, 1);
break; break;
case HNAE3_CLIENT_ROCE: case HNAE3_CLIENT_ROCE:
if (hnae3_dev_roce_supported(hdev)) { if (hnae3_dev_roce_supported(hdev)) {
......
...@@ -470,12 +470,6 @@ static int hclgevf_set_handle_info(struct hclgevf_dev *hdev) ...@@ -470,12 +470,6 @@ static int hclgevf_set_handle_info(struct hclgevf_dev *hdev)
nic->numa_node_mask = hdev->numa_node_mask; nic->numa_node_mask = hdev->numa_node_mask;
nic->flags |= HNAE3_SUPPORT_VF; nic->flags |= HNAE3_SUPPORT_VF;
if (hdev->ae_dev->dev_type != HNAE3_DEV_KNIC) {
dev_err(&hdev->pdev->dev, "unsupported device type %d\n",
hdev->ae_dev->dev_type);
return -EINVAL;
}
ret = hclgevf_knic_setup(hdev); ret = hclgevf_knic_setup(hdev);
if (ret) if (ret)
dev_err(&hdev->pdev->dev, "VF knic setup failed %d\n", dev_err(&hdev->pdev->dev, "VF knic setup failed %d\n",
...@@ -2322,16 +2316,6 @@ static int hclgevf_init_client_instance(struct hnae3_client *client, ...@@ -2322,16 +2316,6 @@ static int hclgevf_init_client_instance(struct hnae3_client *client,
if (ret) if (ret)
goto clear_roce; goto clear_roce;
break;
case HNAE3_CLIENT_UNIC:
hdev->nic_client = client;
hdev->nic.client = client;
ret = client->ops->init_instance(&hdev->nic);
if (ret)
goto clear_nic;
hnae3_set_client_init_flag(client, ae_dev, 1);
break; break;
case HNAE3_CLIENT_ROCE: case HNAE3_CLIENT_ROCE:
if (hnae3_dev_roce_supported(hdev)) { if (hnae3_dev_roce_supported(hdev)) {
......
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