From b38db5445ac405dccf096b28481709a249ed091c Mon Sep 17 00:00:00 2001 From: dann frazier Date: Fri, 4 Jan 2019 10:28:17 -0700 Subject: [PATCH] Revert "UBUNTU: SAUCE: {topost} net: hns3: optimize the process of notifying roce client" BugLink: https://bugs.launchpad.net/bugs/1810457 This reverts commit 2e5ed0d2d5f7a87a9e7a7f4e7fd9eb1cf446c6d4. Signed-off-by: dann frazier Acked-by: Stefan Bader Acked-by: Kleber Sacilotto de Souza Signed-off-by: Kleber Sacilotto de Souza --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../hisilicon/hns3/hns3pf/hclge_main.c | 31 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index 67befff0bfc5..4293aa12a87c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -466,6 +466,7 @@ struct hnae3_roce_private_info { void __iomem *roce_io_base; int base_vector; int num_vectors; + bool is_reset; }; struct hnae3_unic_private_info { diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index b458bb8070b1..b49b13249199 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2013,6 +2013,7 @@ static int hclge_init_roce_base_info(struct hclge_vport *vport) roce->rinfo.netdev = nic->kinfo.netdev; roce->rinfo.roce_io_base = vport->back->hw.io_base; + roce->rinfo.is_reset = false; roce->pdev = nic->pdev; roce->ae_algo = nic->ae_algo; @@ -2631,7 +2632,6 @@ 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; @@ -2641,22 +2641,29 @@ static int hclge_notify_client(struct hclge_dev *hdev, return -EOPNOTSUPP; for (i = 0; i < hdev->num_vmdq_vport + 1; i++) { + if (hdev->roce_client) { + handle = &hdev->vport[i].roce; + client = hdev->roce_client; + if (type == HNAE3_UNINIT_CLIENT) + if (handle) + client->ops->uninit_instance(handle, + true); + } + + client = hdev->nic_client; handle = &hdev->vport[i].nic; + ret = client->ops->reset_notify(handle, type); - if (ret) { - dev_err(&hdev->pdev->dev, - "notify nic client failed %d", ret); + if (ret) return ret; - } - if (rclient && rclient->ops->reset_notify) { + if (hdev->roce_client) { 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; - } + client = hdev->roce_client; + if (type == HNAE3_INIT_CLIENT) + if (handle) + return client->ops->init_instance( + handle); } } -- 2.39.5