patch 'net/hns3: support backplane media type' has been queued to stable release 21.11.2

Kevin Traynor ktraynor at redhat.com
Tue Jun 28 17:19:26 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.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/30/22. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/bdabb55ddcc5c575ae743b093e671fa3afb86560

Thanks.

Kevin

---
>From bdabb55ddcc5c575ae743b093e671fa3afb86560 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Wed, 22 Jun 2022 11:09:57 +0800
Subject: [PATCH] net/hns3: support backplane media type

[ upstream commit 916508f002ae887942ab3b970db33c0cc7fc6c02 ]

The 802.11 physical PMA sub-layer defines three media: copper, fiber and
backplane. For PMD, the backplane is similar to the fiber, the main
differences are that backplane doesn't have optical module.

Because the interface of firmware fiber is also applicable to the
backplane, this patch supports the backplane only through simple
extension.

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3 at huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 54 +++++++++++++++++++---------------
 1 file changed, 30 insertions(+), 24 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 7fb246c193..d75e3b2012 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2814,10 +2814,7 @@ hns3_check_media_type(struct hns3_hw *hw, uint8_t media_type)
 		break;
 	case HNS3_MEDIA_TYPE_FIBER:
+	case HNS3_MEDIA_TYPE_BACKPLANE:
 		ret = 0;
 		break;
-	case HNS3_MEDIA_TYPE_BACKPLANE:
-		PMD_INIT_LOG(ERR, "Media type is Backplane, not supported.");
-		ret = -EOPNOTSUPP;
-		break;
 	default:
 		PMD_INIT_LOG(ERR, "Unknown media type = %u!", media_type);
@@ -4273,12 +4270,9 @@ hns3_update_link_info(struct rte_eth_dev *eth_dev)
 	struct hns3_adapter *hns = eth_dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
-	int ret = 0;
 
 	if (hw->mac.media_type == HNS3_MEDIA_TYPE_COPPER)
-		ret = hns3_update_copper_link_info(hw);
-	else if (hw->mac.media_type == HNS3_MEDIA_TYPE_FIBER)
-		ret = hns3_update_fiber_link_info(hw);
+		return hns3_update_copper_link_info(hw);
 
-	return ret;
+	return hns3_update_fiber_link_info(hw);
 }
 
@@ -4573,9 +4567,11 @@ hns3_get_port_supported_speed(struct rte_eth_dev *eth_dev)
 		return ret;
 
-	if (mac->media_type == HNS3_MEDIA_TYPE_FIBER) {
+	if (mac->media_type == HNS3_MEDIA_TYPE_FIBER ||
+	    mac->media_type == HNS3_MEDIA_TYPE_BACKPLANE) {
 		/*
 		 * Some firmware does not support the report of supported_speed,
-		 * and only report the effective speed of SFP. In this case, it
-		 * is necessary to use the SFP's speed as the supported_speed.
+		 * and only report the effective speed of SFP/backplane. In this
+		 * case, it is necessary to use the SFP/backplane's speed as the
+		 * supported_speed.
 		 */
 		if (mac->supported_speed == 0)
@@ -4839,5 +4835,5 @@ hns3_check_port_speed(struct hns3_hw *hw, uint32_t link_speeds)
 	if (mac->media_type == HNS3_MEDIA_TYPE_COPPER)
 		speed_bit = hns3_convert_link_speeds2bitmap_copper(link_speeds);
-	else if (mac->media_type == HNS3_MEDIA_TYPE_FIBER)
+	else
 		speed_bit = hns3_convert_link_speeds2bitmap_fiber(link_speeds);
 
@@ -4983,4 +4979,17 @@ hns3_set_fiber_port_link_speed(struct hns3_hw *hw,
 }
 
+static const char *
+hns3_get_media_type_name(uint8_t media_type)
+{
+	if (media_type == HNS3_MEDIA_TYPE_FIBER)
+		return "fiber";
+	else if (media_type == HNS3_MEDIA_TYPE_COPPER)
+		return "copper";
+	else if (media_type == HNS3_MEDIA_TYPE_BACKPLANE)
+		return "backplane";
+	else
+		return "unknown";
+}
+
 static int
 hns3_set_port_link_speed(struct hns3_hw *hw,
@@ -4997,16 +5006,13 @@ hns3_set_port_link_speed(struct hns3_hw *hw,
 
 		ret = hns3_set_copper_port_link_speed(hw, cfg);
-		if (ret) {
-			hns3_err(hw, "failed to set copper port link speed,"
-				 "ret = %d.", ret);
-			return ret;
-		}
-	} else if (hw->mac.media_type == HNS3_MEDIA_TYPE_FIBER) {
+	} else {
 		ret = hns3_set_fiber_port_link_speed(hw, cfg);
-		if (ret) {
-			hns3_err(hw, "failed to set fiber port link speed,"
-				 "ret = %d.", ret);
-			return ret;
-		}
+	}
+
+	if (ret) {
+		hns3_err(hw, "failed to set %s port link speed, ret = %d.",
+			 hns3_get_media_type_name(hw->mac.media_type),
+			 ret);
+		return ret;
 	}
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-28 16:18:04.360002328 +0100
+++ 0014-net-hns3-support-backplane-media-type.patch	2022-06-28 16:18:04.028387176 +0100
@@ -1 +1 @@
-From 916508f002ae887942ab3b970db33c0cc7fc6c02 Mon Sep 17 00:00:00 2001
+From bdabb55ddcc5c575ae743b093e671fa3afb86560 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 916508f002ae887942ab3b970db33c0cc7fc6c02 ]
+
@@ -14,2 +15,0 @@
-Cc: stable at dpdk.org
-
@@ -19,3 +19,2 @@
- doc/guides/rel_notes/release_22_07.rst |  4 ++
- drivers/net/hns3/hns3_ethdev.c         | 54 ++++++++++++++------------
- 2 files changed, 34 insertions(+), 24 deletions(-)
+ drivers/net/hns3/hns3_ethdev.c | 54 +++++++++++++++++++---------------
+ 1 file changed, 30 insertions(+), 24 deletions(-)
@@ -23,13 +21,0 @@
-diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
-index d3cb36b089..6365800313 100644
---- a/doc/guides/rel_notes/release_22_07.rst
-+++ b/doc/guides/rel_notes/release_22_07.rst
-@@ -140,4 +140,8 @@ New Features
-   * Added PMD support for virtual functions and vfio_pci driver.
- 
-+* **Updated HiSilicon hns3 driver.**
-+
-+  * Added support for backplane media type.
-+
- * **Updated Intel iavf driver.**
- 
@@ -37 +23 @@
-index 6c77c8b964..b17a3e8669 100644
+index 7fb246c193..d75e3b2012 100644
@@ -40 +26 @@
-@@ -2788,10 +2788,7 @@ hns3_check_media_type(struct hns3_hw *hw, uint8_t media_type)
+@@ -2814,10 +2814,7 @@ hns3_check_media_type(struct hns3_hw *hw, uint8_t media_type)
@@ -52 +38 @@
-@@ -4245,12 +4242,9 @@ hns3_update_link_info(struct rte_eth_dev *eth_dev)
+@@ -4273,12 +4270,9 @@ hns3_update_link_info(struct rte_eth_dev *eth_dev)
@@ -67 +53 @@
-@@ -4545,9 +4539,11 @@ hns3_get_port_supported_speed(struct rte_eth_dev *eth_dev)
+@@ -4573,9 +4567,11 @@ hns3_get_port_supported_speed(struct rte_eth_dev *eth_dev)
@@ -82 +68 @@
-@@ -4811,5 +4807,5 @@ hns3_check_port_speed(struct hns3_hw *hw, uint32_t link_speeds)
+@@ -4839,5 +4835,5 @@ hns3_check_port_speed(struct hns3_hw *hw, uint32_t link_speeds)
@@ -89 +75 @@
-@@ -4955,4 +4951,17 @@ hns3_set_fiber_port_link_speed(struct hns3_hw *hw,
+@@ -4983,4 +4979,17 @@ hns3_set_fiber_port_link_speed(struct hns3_hw *hw,
@@ -107 +93 @@
-@@ -4969,16 +4978,13 @@ hns3_set_port_link_speed(struct hns3_hw *hw,
+@@ -4997,16 +5006,13 @@ hns3_set_port_link_speed(struct hns3_hw *hw,



More information about the stable mailing list