]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Revert "UBUNTU: SAUCE: {topost} net: hns3: separate roce from nic when resetting"
authordann frazier <dann.frazier@canonical.com>
Thu, 16 Aug 2018 19:19:10 +0000 (13:19 -0600)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 5 Sep 2018 12:18:31 +0000 (14:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 0520c2e5923b6d3c3bb69a50de5da8596f4896d9.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 3db190764bf20ee4e4d3e471a9fb90eaed83c6c8..6f33c17ffb4dac858fd21a7e79582d1bf9602e83 100644 (file)
@@ -2621,6 +2621,7 @@ static void hclge_misc_irq_uninit(struct hclge_dev *hdev)
 static int hclge_notify_client(struct hclge_dev *hdev,
                               enum hnae3_reset_notify_type type)
 {
+       struct hnae3_client *rclient = hdev->roce_client;
        struct hnae3_client *client = hdev->nic_client;
        struct hnae3_handle *handle;
        int ret;
@@ -2637,36 +2638,19 @@ static int hclge_notify_client(struct hclge_dev *hdev,
                                "notify nic client failed %d", ret);
                        return ret;
                }
-       }
-
-       return 0;
-}
 
-static int hclge_notify_roce_client(struct hclge_dev *hdev,
-                                   enum hnae3_reset_notify_type type)
-{
-       struct hnae3_client *client = hdev->roce_client;
-       struct hnae3_handle *handle;
-       int ret = 0;
-       u16 i;
-
-       if (!client)
-               return 0;
-
-       if (!client->ops->reset_notify)
-               return -EOPNOTSUPP;
-
-       for (i = 0; i < hdev->num_vmdq_vport + 1; i++) {
-               handle = &hdev->vport[i].roce;
-               ret = client->ops->reset_notify(handle, type);
-               if (ret) {
-                       dev_err(&hdev->pdev->dev,
-                               "notify roce client failed %d", ret);
-                       return ret;
+               if (rclient && rclient->ops->reset_notify) {
+                       handle = &hdev->vport[i].roce;
+                       ret = rclient->ops->reset_notify(handle, type);
+                       if (ret) {
+                               dev_err(&hdev->pdev->dev,
+                                       "notify roce client failed %d", ret);
+                               return ret;
+                       }
                }
        }
 
-       return ret;
+       return 0;
 }
 
 static int hclge_reset_wait(struct hclge_dev *hdev)
@@ -2818,10 +2802,6 @@ static void hclge_reset(struct hclge_dev *hdev)
 
        /* perform reset of the stack & ae device for a client */
        handle = &hdev->vport[0].nic;
-
-       hclge_notify_roce_client(hdev, HNAE3_DOWN_CLIENT);
-       hclge_notify_roce_client(hdev, HNAE3_UNINIT_CLIENT);
-
        rtnl_lock();
        hclge_notify_client(hdev, HNAE3_DOWN_CLIENT);
 
@@ -2840,9 +2820,6 @@ static void hclge_reset(struct hclge_dev *hdev)
        hclge_notify_client(hdev, HNAE3_UP_CLIENT);
        handle->last_reset_time = jiffies;
        rtnl_unlock();
-
-       hclge_notify_roce_client(hdev, HNAE3_INIT_CLIENT);
-       hclge_notify_roce_client(hdev, HNAE3_UP_CLIENT);
 }
 
 static void hclge_reset_event(struct hnae3_handle *handle)