Add bugfixes for hns3 PMD to sync upstream branch. Signed-off-by: speech_white <humin29@huawei.com>
63 lines
2.4 KiB
Diff
63 lines
2.4 KiB
Diff
From 7c10ec3ea203c6190df96a72f5169a4674b8ea74 Mon Sep 17 00:00:00 2001
|
|
From: Huisong Li <lihuisong@huawei.com>
|
|
Date: Sat, 17 Jul 2021 10:02:54 +0800
|
|
Subject: [PATCH 22/26] net/hns3: move speed auto-negotiation warning
|
|
|
|
PF driver prints a warning on device that does not support auto-negotiation
|
|
when user does not configure "link_speeds" (default 0), which means
|
|
auto-negotiation. Currently, this warning information is printed in
|
|
dev_configure stage and a success is returned. Perhaps the user may call
|
|
dev_configure multiple times before dev_start for some reason or purpose.
|
|
In this case, this message may be printed multiple times. So this patch
|
|
moves it to dev_start stage.
|
|
|
|
Fixes: cfc9fe48c4d4 ("net/hns3: move link speeds check to configure")
|
|
Cc: stable@dpdk.org
|
|
|
|
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
|
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
|
---
|
|
drivers/net/hns3/hns3_ethdev.c | 14 +++++++-------
|
|
1 file changed, 7 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
|
index f658e74..c8f283c 100644
|
|
--- a/drivers/net/hns3/hns3_ethdev.c
|
|
+++ b/drivers/net/hns3/hns3_ethdev.c
|
|
@@ -2437,14 +2437,11 @@ hns3_check_link_speed(struct hns3_hw *hw, uint32_t link_speeds)
|
|
/*
|
|
* Some hardware doesn't support auto-negotiation, but users may not
|
|
* configure link_speeds (default 0), which means auto-negotiation.
|
|
- * In this case, a warning message need to be printed, instead of
|
|
- * an error.
|
|
+ * In this case, it should return success.
|
|
*/
|
|
if (link_speeds == ETH_LINK_SPEED_AUTONEG &&
|
|
- hw->mac.support_autoneg == 0) {
|
|
- hns3_warn(hw, "auto-negotiation is not supported, use default fixed speed!");
|
|
+ hw->mac.support_autoneg == 0)
|
|
return 0;
|
|
- }
|
|
|
|
if (link_speeds != ETH_LINK_SPEED_AUTONEG) {
|
|
ret = hns3_check_port_speed(hw, link_speeds);
|
|
@@ -5512,10 +5509,13 @@ hns3_set_fiber_port_link_speed(struct hns3_hw *hw,
|
|
/*
|
|
* Some hardware doesn't support auto-negotiation, but users may not
|
|
* configure link_speeds (default 0), which means auto-negotiation.
|
|
- * In this case, it should return success.
|
|
+ * In this case, a warning message need to be printed, instead of
|
|
+ * an error.
|
|
*/
|
|
- if (cfg->autoneg)
|
|
+ if (cfg->autoneg) {
|
|
+ hns3_warn(hw, "auto-negotiation is not supported, use default fixed speed!");
|
|
return 0;
|
|
+ }
|
|
|
|
return hns3_cfg_mac_speed_dup(hw, cfg->speed, cfg->duplex);
|
|
}
|
|
--
|
|
2.7.4
|
|
|