net/hns3: fix MAC enable failed rollback

Message ID 1619687039-57570-1-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/hns3: fix MAC enable failed rollback |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

humin (Q) April 29, 2021, 9:03 a.m. UTC
  From: Huisong Li <lihuisong@huawei.com>

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 <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit May 4, 2021, 2:12 p.m. UTC | #1
On 4/29/2021 10:03 AM, Min Hu (Connor) wrote:
> From: Huisong Li <lihuisong@huawei.com>
> 
> 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 <lihuisong@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>

Applied to dpdk-next-net/main, thanks.
  

Patch

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