Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1924590ybk; Thu, 21 May 2020 19:52:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlN++aeE/u/yDdxhHC1gwVNx6KzngO+pMarcJ2LV62sj9zkSqtyq7RQH02vq5o/7qOn8PL X-Received: by 2002:a17:906:355b:: with SMTP id s27mr6514914eja.501.1590115974214; Thu, 21 May 2020 19:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590115974; cv=none; d=google.com; s=arc-20160816; b=jcOerapqfrKRYNElX7yM9aQ4v2msydi6TJ5QZp23bJdJLV2iY3xumhWq/MiNNnEqNS PpDyN3ncRYa2dCxwKjq6pPfTwsflcn0H2C39Y4qPHpFRUhMxxg67EPvSvixZrXfpXMJn n2NhRyhU2DVvKc/Cp0zDQmsJOtXdBhD3BUxDlRHqb8qOXL/6sI07kEBMZr/Fe9yl9Cwp RU5BPm77oHRV5CuFwQrIhXjMUPFxo3nBkcl5nzi4jVO5tIlvk5ftqZVPAYaC2z0DzU7r 9gwh6u4eq0Y6E0hrjqMNI3R6Mf5DTzSr7LGSs2slm8iNjMFSZIV/kD2lPRcR1w12Ew1K 0q2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=KrYUw9YOhEzmQN8y9YolAl6mBR39C51t9qYWQiw4xU8=; b=DeTec0iv544LZ+s6WpEFdT210zFrhxVcK0uNF7zsUcYYViPUPDUKbO9D/UwCJ8yX3I f46zpHmv8bxiW7LODY1fKFeD5+DeVCbs9jxiliA1aq7X/p8LRdXyqAJq4gKcArv6iaXt eMzmNDmOVo3JIII0GBazepJZh0+pZtdnuJEAVDGgntBboZdbZ90iTj4H/qvOMgA81ycN YFBtdmgjpthTqFuDu9KUEf8ieBk5cEzigvWUQxcWBs+QLYscIANugPh8JcpOIqgAEsMI U1ybGfF8OzaSUt1KEa/lUg1PltFmyRByi4aL4VxVPuRbNarFu7b6+t80+gIpbXVF2tx2 7i/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c26si1518199edj.45.2020.05.21.19.52.31; Thu, 21 May 2020 19:52:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728019AbgEVCvP (ORCPT + 99 others); Thu, 21 May 2020 22:51:15 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4884 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727004AbgEVCvO (ORCPT ); Thu, 21 May 2020 22:51:14 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A4070CC9263DCE6047FB; Fri, 22 May 2020 10:51:11 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 22 May 2020 10:51:02 +0800 From: Huazhong Tan To: CC: , , , , , , Yufeng Mo , Huazhong Tan Subject: [PATCH net-next 3/5] net: hns3: change the order of reinitializing RoCE and NIC client during reset Date: Fri, 22 May 2020 10:49:44 +0800 Message-ID: <1590115786-9940-4-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590115786-9940-1-git-send-email-tanhuazhong@huawei.com> References: <1590115786-9940-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yufeng Mo The HNS RDMA driver will support VF device later, whose re-initialization should be done after PF's. This patch changes the order of hclge_reset_prepare_up() and hclge_notify_roce_client(), so that PF's RoCE client will be reinitialized before VF's. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index b796d3f..6e1e2cf 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3770,11 +3770,6 @@ static int hclge_reset_rebuild(struct hclge_dev *hdev) hclge_clear_reset_cause(hdev); - ret = hclge_reset_prepare_up(hdev); - if (ret) - return ret; - - ret = hclge_notify_roce_client(hdev, HNAE3_INIT_CLIENT); /* ignore RoCE notify error if it fails HCLGE_RESET_MAX_FAIL_CNT - 1 * times @@ -3783,6 +3778,10 @@ static int hclge_reset_rebuild(struct hclge_dev *hdev) hdev->rst_stats.reset_fail_cnt < HCLGE_RESET_MAX_FAIL_CNT - 1) return ret; + ret = hclge_reset_prepare_up(hdev); + if (ret) + return ret; + rtnl_lock(); ret = hclge_notify_client(hdev, HNAE3_UP_CLIENT); rtnl_unlock(); -- 2.7.4