patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Chengwen Feng <fengchengwen@huawei.com>
Cc: Dongdong Liu <liudongdong3@huawei.com>, dpdk stable <stable@dpdk.org>
Subject: patch 'net/hns3: support backplane media type' has been queued to stable release 21.11.2
Date: Tue, 28 Jun 2022 16:19:26 +0100	[thread overview]
Message-ID: <20220628151938.2278711-14-ktraynor@redhat.com> (raw)
In-Reply-To: <20220628151938.2278711-1-ktraynor@redhat.com>

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@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@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@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@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,


  parent reply	other threads:[~2022-06-28 15:20 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 15:19 patch 'raw/ioat: fix build missing errno include' " Kevin Traynor
2022-06-28 15:19 ` patch 'raw/ioat: fix build when ioat dmadev enabled' " Kevin Traynor
2022-06-28 15:19 ` patch 'dma/idxd: fix AVX2 in non-datapath functions' " Kevin Traynor
2022-06-28 15:19 ` patch 'dma/idxd: fix non-AVX builds with old compilers' " Kevin Traynor
2022-06-28 15:19 ` patch 'rib: fix references for IPv6 implementation' " Kevin Traynor
2022-06-28 15:19 ` patch 'test/hash: fix out of bound access' " Kevin Traynor
2022-06-28 15:19 ` patch 'app/procinfo: show all non-owned ports' " Kevin Traynor
2022-06-28 15:19 ` patch 'test: check memory allocation for CRC' " Kevin Traynor
2022-06-28 15:19 ` patch 'app/testpmd: cleanup port resources after implicit close' " Kevin Traynor
2022-06-28 15:19 ` patch 'app/testpmd: fix flex parser destroy command' " Kevin Traynor
2022-06-28 15:19 ` patch 'net: fix GTP PSC headers' " Kevin Traynor
2022-06-28 15:19 ` patch 'app/testpmd: fix GTP PSC raw processing' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/hns3: fix link status capability query from VF' " Kevin Traynor
2022-06-28 15:19 ` Kevin Traynor [this message]
2022-06-28 15:19 ` patch 'net/hns3: fix PTP interrupt logging' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/hns3: fix statistics locking' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/hns3: fix descriptors check with SVE' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/hns3: delete unused code' " Kevin Traynor
2022-06-28 15:19 ` patch 'examples/distributor: fix distributor on Rx core' " Kevin Traynor
2022-06-28 15:19 ` patch 'doc: add more instructions for running as non-root' " Kevin Traynor
2022-06-28 20:26   ` Dmitry Kozlyuk
2022-06-28 15:19 ` patch 'net/bnxt: fix switch domain allocation' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/bnxt: allow Tx only or Rx only' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/bnxt: fix setting forced speed' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/bnxt: disallow MTU change when device is started' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/bnxt: cleanup MTU setting' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/bnxt: fix check for autoneg enablement in the PHY FW' " Kevin Traynor
2022-07-06 20:34   ` patch 'test/crypto: fix authentication IV for ZUC SGL' " luca.boccassi
2022-07-06 20:34     ` patch 'test/crypto: fix ZUC vector IV format' " luca.boccassi
2022-07-06 20:34     ` patch 'test/crypto: fix SNOW3G " luca.boccassi
2022-07-06 20:34     ` patch 'examples/fips_validation: handle empty payload' " luca.boccassi
2022-07-07  7:22       ` [EXT] " Gowrishankar Muthukrishnan
2022-07-07  7:31         ` Gowrishankar Muthukrishnan
2022-07-06 20:34     ` patch 'crypto/qat: fix DOCSIS crash' " luca.boccassi
2022-07-06 20:34     ` patch 'doc: fix grammar and formatting in compressdev guide' " luca.boccassi
2022-07-06 20:34     ` patch 'doc: fix grammar and parameters in l2fwd-crypto " luca.boccassi
2022-07-06 20:34     ` patch 'eventdev/eth_tx: fix queue delete' " luca.boccassi
2022-07-06 20:34     ` patch 'app/testpmd: fix supported RSS offload display' " luca.boccassi
2022-07-06 20:34     ` patch 'net/netvsc: fix vmbus device reference in multi-process' " luca.boccassi
2022-07-06 20:34     ` patch 'net/virtio-user: fix socket non-blocking mode' " luca.boccassi
2022-07-06 20:34     ` patch 'doc: fix readability in vhost guide' " luca.boccassi
2022-07-06 20:34     ` patch 'net/vhost: fix deadlock on vring state change' " luca.boccassi
2022-07-06 20:34     ` patch 'vdpa/sfc: fix sync between QEMU and vhost-user' " luca.boccassi
2022-07-06 20:34     ` patch 'vhost: add some trailing newline in log messages' " luca.boccassi
2022-07-06 20:34     ` patch 'vhost: restore device information " luca.boccassi
2022-07-06 20:34     ` patch 'net/virtio-user: fix Rx interrupts with multi-queue' " luca.boccassi
2022-07-06 20:34     ` patch 'common/cnxk: fix GRE tunnel parsing' " luca.boccassi
2022-07-06 20:34     ` patch 'net/iavf: fix VF reset' " luca.boccassi
2022-07-06 20:34     ` patch 'net/igc: support multi-process' " luca.boccassi
2022-07-06 20:34     ` patch 'service: fix lingering active status' " luca.boccassi
2022-07-06 20:34     ` patch 'gro: fix identifying fragmented packets' " luca.boccassi
2022-07-06 20:34     ` patch 'common/cnxk: allow changing PTP mode on CN10K' " luca.boccassi
2022-07-06 20:34     ` patch 'common/mlx5: fix non-expandable global MR cache' " luca.boccassi
2022-07-06 20:35     ` patch 'net/mlx5: reject negative integrity item configuration' " luca.boccassi
2022-07-06 20:35     ` patch 'dma/idxd: fix memory leak in PCI close' " luca.boccassi
2022-07-06 20:35     ` patch 'dma/idxd: fix partial freeing " luca.boccassi
2022-07-06 20:35     ` patch 'dma/idxd: fix null dereference in PCI remove' " luca.boccassi
2022-07-06 20:35     ` patch 'app/regex: avoid division by zero' " luca.boccassi
2022-07-06 20:35     ` patch 'app/regex: fix mbuf size for multi-segment buffer' " luca.boccassi
2022-07-06 20:35     ` patch 'avoid AltiVec keyword vector' " luca.boccassi
2022-07-12 19:23       ` patch 'examples/link_status_interrupt: fix stats refresh rate' " luca.boccassi
2022-07-12 19:23         ` patch 'vdpa/mlx5: fix leak on event thread creation' " luca.boccassi
2022-07-12 19:23         ` patch 'vdpa/ifc/base: fix null pointer dereference' " luca.boccassi
2022-07-13  2:13           ` Pei, Andy
2022-07-12 19:23         ` patch 'vdpa/sfc: resolve race between vhost lib and device conf' " luca.boccassi
2022-07-12 19:23         ` patch 'net/iavf: fix GTP-U extension flow' " luca.boccassi
2022-07-12 19:23         ` patch 'app/testpmd: fix GTP PSC raw processing' " luca.boccassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220628151938.2278711-14-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=fengchengwen@huawei.com \
    --cc=liudongdong3@huawei.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).