[dpdk-stable] patch 'net/hns3: fix link speed when port is down' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Sat Jun 12 01:02:20 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/14/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/180a37c3ef268f6f1c31b8948bf04f6e9e4281bc

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 180a37c3ef268f6f1c31b8948bf04f6e9e4281bc Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong at huawei.com>
Date: Sun, 25 Apr 2021 20:06:29 +0800
Subject: [PATCH] net/hns3: fix link speed when port is down
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 230d4940ed8e4fc0138fab2fdb2087553b8465dd ]

When the port is link down state, it is meaningless to display the
port link speed. It should be an undefined state.

Fixes: 59fad0f32135 ("net/hns3: support link update operation")

Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 01ff8de7f7..40e4cfde31 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2684,16 +2684,18 @@ hns3_setup_linkstatus(struct rte_eth_dev *eth_dev,
 	case ETH_SPEED_NUM_50G:
 	case ETH_SPEED_NUM_100G:
 	case ETH_SPEED_NUM_200G:
-		new_link->link_speed = mac->link_speed;
+		if (mac->link_status)
+			new_link->link_speed = mac->link_speed;
 		break;
 	default:
 		if (mac->link_status)
 			new_link->link_speed = ETH_SPEED_NUM_UNKNOWN;
-		else
-			new_link->link_speed = ETH_SPEED_NUM_NONE;
 		break;
 	}
 
+	if (!mac->link_status)
+		new_link->link_speed = ETH_SPEED_NUM_NONE;
+
 	new_link->link_duplex = mac->link_duplex;
 	new_link->link_status = mac->link_status ? ETH_LINK_UP : ETH_LINK_DOWN;
 	new_link->link_autoneg =
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-06-12 06:53:57.848319100 +0800
+++ 0046-net-hns3-fix-link-speed-when-port-is-down.patch	2021-06-12 06:53:56.220000000 +0800
@@ -1 +1 @@
-From 230d4940ed8e4fc0138fab2fdb2087553b8465dd Mon Sep 17 00:00:00 2001
+From 180a37c3ef268f6f1c31b8948bf04f6e9e4281bc Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 230d4940ed8e4fc0138fab2fdb2087553b8465dd ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -19 +21 @@
-index 63ae555c9d..a6f4c92e41 100644
+index 01ff8de7f7..40e4cfde31 100644
@@ -22 +24 @@
-@@ -2870,16 +2870,18 @@ hns3_setup_linkstatus(struct rte_eth_dev *eth_dev,
+@@ -2684,16 +2684,18 @@ hns3_setup_linkstatus(struct rte_eth_dev *eth_dev,
@@ -43 +45 @@
- 	new_link->link_autoneg = mac->link_autoneg;
+ 	new_link->link_autoneg =


More information about the stable mailing list