Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp564366ybm; Wed, 27 May 2020 02:26:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTBDEtWrrfv6DtLr90RNpYWNDhhiHv2Mk1fDERtaziaGG5Qy+NZ44JNj6D5GZMb8xxFs7Z X-Received: by 2002:a17:906:1199:: with SMTP id n25mr4751463eja.230.1590571608801; Wed, 27 May 2020 02:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590571608; cv=none; d=google.com; s=arc-20160816; b=CKyCIFJpbaEPI3Nv9KRgNvxtUqIFdw46XFHD9DezBNXkVZFJiD3MecVrHe/086CzlC A5MfinzXuxrtuXUrlf+qRZQhxIrv3Q2zzA9YgXt9jF92aEei2oDwLFN/yAuF7IN5LAzI Ay9/UFQWBlXXP21i/iawPz73Lig7MZ1VNpvk+I9q6F1gJVFXdO3XS8OCzOr2FCdhPlrZ b6hpDahbpRVO/GXJdE6WSi15l7uI5FnR8zvX3wUGqoA+J3mRaBo0NFnlL+RkfDGhTS2n EL+Pf3YW5BHWuqTqf/C8/7C3PRzkC/8mCXm4DFi9rP1pSWUPvkvr5dFzvwWTP3HbgCNd VPZA== 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=Z5bUoesHqAgfvz2L5Iv0+k7BtIjwfb0uHA6R6KD7Wa2cKKhSCnJqpkqk+5cJNmqOPG qS8XTo8omF1lLlsywwJZEBsUhxLpl+Uwts2PU8MEsyxkyHeL/rfztWY+g+mc1IpzQSAB mdOtIAiflncOMYh4Vy9GTcHIqNC9BEYQptQGm1ORphuZd0wA3rjM412eXwMLHVD84lCM O/Ff/afGvEper4lJc/YkpErJ5yotmr7TWsG55ap2JlTQlZIKuOwUHM2D+aiJVfqBdV1s 9NQb5thBXwOdwBcnwWhsAOmc/yQ6VZHv1KPe3PNFDVPa4nNDuOidfwGi3KoGzekO5AtO a/4Q== 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 y4si1385040edt.104.2020.05.27.02.26.25; Wed, 27 May 2020 02:26:48 -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 S1727862AbgE0BAo (ORCPT + 99 others); Tue, 26 May 2020 21:00:44 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5341 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727812AbgE0BAn (ORCPT ); Tue, 26 May 2020 21:00:43 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D5900943A41C341C0CCE; Wed, 27 May 2020 09:00:41 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Wed, 27 May 2020 09:00:34 +0800 From: Huazhong Tan To: CC: , , , , , , Yufeng Mo , Huazhong Tan Subject: [PATCH V2 net-next 2/4] net: hns3: change the order of reinitializing RoCE and NIC client during reset Date: Wed, 27 May 2020 08:59:15 +0800 Message-ID: <1590541157-6803-3-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590541157-6803-1-git-send-email-tanhuazhong@huawei.com> References: <1590541157-6803-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