|
@@ -1473,21 +1473,8 @@ static int hclge_alloc_vport(struct hclge_dev *hdev)
|
|
|
hdev->vport = vport;
|
|
|
hdev->num_alloc_vport = num_vport;
|
|
|
|
|
|
-#ifdef CONFIG_PCI_IOV
|
|
|
- /* Enable SRIOV */
|
|
|
- if (hdev->num_req_vfs) {
|
|
|
- dev_info(&pdev->dev, "active VFs(%d) found, enabling SRIOV\n",
|
|
|
- hdev->num_req_vfs);
|
|
|
- ret = pci_enable_sriov(hdev->pdev, hdev->num_req_vfs);
|
|
|
- if (ret) {
|
|
|
- hdev->num_alloc_vfs = 0;
|
|
|
- dev_err(&pdev->dev, "SRIOV enable failed %d\n",
|
|
|
- ret);
|
|
|
- return ret;
|
|
|
- }
|
|
|
- }
|
|
|
- hdev->num_alloc_vfs = hdev->num_req_vfs;
|
|
|
-#endif
|
|
|
+ if (IS_ENABLED(CONFIG_PCI_IOV))
|
|
|
+ hdev->num_alloc_vfs = hdev->num_req_vfs;
|
|
|
|
|
|
for (i = 0; i < num_vport; i++) {
|
|
|
vport->back = hdev;
|
|
@@ -2946,21 +2933,6 @@ static void hclge_service_task(struct work_struct *work)
|
|
|
hclge_service_complete(hdev);
|
|
|
}
|
|
|
|
|
|
-static void hclge_disable_sriov(struct hclge_dev *hdev)
|
|
|
-{
|
|
|
- /* If our VFs are assigned we cannot shut down SR-IOV
|
|
|
- * without causing issues, so just leave the hardware
|
|
|
- * available but disabled
|
|
|
- */
|
|
|
- if (pci_vfs_assigned(hdev->pdev)) {
|
|
|
- dev_warn(&hdev->pdev->dev,
|
|
|
- "disabling driver while VFs are assigned\n");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- pci_disable_sriov(hdev->pdev);
|
|
|
-}
|
|
|
-
|
|
|
struct hclge_vport *hclge_get_vport(struct hnae3_handle *handle)
|
|
|
{
|
|
|
/* VF handle has no client */
|
|
@@ -5540,7 +5512,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
|
|
|
ret = hclge_map_tqp(hdev);
|
|
|
if (ret) {
|
|
|
dev_err(&pdev->dev, "Map tqp error, ret = %d.\n", ret);
|
|
|
- goto err_sriov_disable;
|
|
|
+ goto err_msi_irq_uninit;
|
|
|
}
|
|
|
|
|
|
if (hdev->hw.mac.media_type == HNAE3_MEDIA_TYPE_COPPER) {
|
|
@@ -5548,7 +5520,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
|
|
|
if (ret) {
|
|
|
dev_err(&hdev->pdev->dev,
|
|
|
"mdio config fail ret=%d\n", ret);
|
|
|
- goto err_sriov_disable;
|
|
|
+ goto err_msi_irq_uninit;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -5612,9 +5584,6 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
|
|
|
err_mdiobus_unreg:
|
|
|
if (hdev->hw.mac.phydev)
|
|
|
mdiobus_unregister(hdev->hw.mac.mdio_bus);
|
|
|
-err_sriov_disable:
|
|
|
- if (IS_ENABLED(CONFIG_PCI_IOV))
|
|
|
- hclge_disable_sriov(hdev);
|
|
|
err_msi_irq_uninit:
|
|
|
hclge_misc_irq_uninit(hdev);
|
|
|
err_msi_uninit:
|
|
@@ -5717,9 +5686,6 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev)
|
|
|
|
|
|
set_bit(HCLGE_STATE_DOWN, &hdev->state);
|
|
|
|
|
|
- if (IS_ENABLED(CONFIG_PCI_IOV))
|
|
|
- hclge_disable_sriov(hdev);
|
|
|
-
|
|
|
if (hdev->service_timer.function)
|
|
|
del_timer_sync(&hdev->service_timer);
|
|
|
if (hdev->service_task.func)
|