[1/5] net/hns3: fix VF default MAC modified when set failed

Message ID 20230805083627.8681-2-liudongdong3@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/hns3: some bugfixes for hns3 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dongdong Liu Aug. 5, 2023, 8:36 a.m. UTC
  From: Dengdui Huang <huangdengdui@huawei.com>

When the VF fail to set the default MAC address,
"hw->mac.mac_addr" should not be updated.

Fixes: a5475d61fa34 ("net/hns3: support VF")
Cc: stable@dpdk.org

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_ethdev_vf.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 5aac62a41f..ad0ccb82fe 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -250,6 +250,8 @@  hns3vf_set_default_mac_addr(struct rte_eth_dev *dev,
 			hns3_err(hw, "Failed to set mac addr(%s) for vf: %d",
 				 mac_str, ret);
 		}
+		rte_spinlock_unlock(&hw->lock);
+		return ret;
 	}
 
 	rte_ether_addr_copy(mac_addr,