From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C9F7FA0547; Thu, 29 Apr 2021 11:03:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45C0241125; Thu, 29 Apr 2021 11:03:59 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id 0E6324067E for ; Thu, 29 Apr 2021 11:03:57 +0200 (CEST) Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FW8dD6MvyzjcJd for ; Thu, 29 Apr 2021 17:01:52 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Thu, 29 Apr 2021 17:03:51 +0800 From: "Min Hu (Connor)" To: CC: Date: Thu, 29 Apr 2021 17:03:59 +0800 Message-ID: <1619687039-57570-1-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] net/hns3: fix MAC enable failed rollback X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Huisong Li If driver fails to enable MAC, it does not need to rollback the MAC configuration. This patch fixes it. Fixes: bdaf190f8235 ("net/hns3: support link speed autoneg for PF") Signed-off-by: Huisong Li Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_ethdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index a6f4c92..d0f23e8 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -5611,12 +5611,14 @@ hns3_do_start(struct hns3_adapter *hns, bool reset_queue) ret = hns3_apply_link_speed(hw); if (ret) - goto err_config_mac_mode; + goto err_set_link_speed; return 0; -err_config_mac_mode: +err_set_link_speed: (void)hns3_cfg_mac_mode(hw, false); + +err_config_mac_mode: hns3_dev_release_mbufs(hns); /* * Here is exception handling, hns3_reset_all_tqps will have the -- 2.7.4