patch 'net/hns3: fix setting DCB capability' has been queued to stable release 20.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Nov 8 20:25:18 CET 2023


Hi,

FYI, your patch has been queued to stable release 20.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/10/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/4cf3c2381b0ccbd1491f3662e4739bac41a8c72d

Thanks.

Luca Boccassi

---
>From 4cf3c2381b0ccbd1491f3662e4739bac41a8c72d Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong at huawei.com>
Date: Tue, 31 Oct 2023 20:23:54 +0800
Subject: [PATCH] net/hns3: fix setting DCB capability

[ upstream commit ac61c444e647298dded80a2ab52966a2dbe22b68 ]

The "hw->capability" is set after querying firmware and version.
But the DCB capability of PF is set in other place.
So this patch moves setting DCB capability to the place where
all capabilities are set.

Fixes: ab2e2e344163 ("net/hns3: get device capability in primary process")

Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Jie Hai <haijie1 at huawei.com>
---
 drivers/net/hns3/hns3_cmd.c    | 25 +++++++++++++++++++++++++
 drivers/net/hns3/hns3_ethdev.c |  8 --------
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c
index dc65ef8c26..2a67c264c6 100644
--- a/drivers/net/hns3/hns3_cmd.c
+++ b/drivers/net/hns3/hns3_cmd.c
@@ -448,6 +448,28 @@ hns3_build_api_caps(void)
 	return rte_cpu_to_le_32(api_caps);
 }
 
+static void
+hns3_set_dcb_capability(struct hns3_hw *hw)
+{
+	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
+	struct rte_pci_device *pci_dev;
+	struct rte_eth_dev *eth_dev;
+	uint16_t device_id;
+
+	if (hns->is_vf)
+		return;
+
+	eth_dev = &rte_eth_devices[hw->data->port_id];
+	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
+	device_id = pci_dev->id.device_id;
+
+	if (device_id == HNS3_DEV_ID_25GE_RDMA ||
+	    device_id == HNS3_DEV_ID_50GE_RDMA ||
+	    device_id == HNS3_DEV_ID_100G_RDMA_MACSEC ||
+	    device_id == HNS3_DEV_ID_200G_RDMA)
+		hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1);
+}
+
 static int
 hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
 {
@@ -465,6 +487,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
 		return ret;
 
 	hw->fw_version = rte_le_to_cpu_32(resp->firmware);
+
+	hns3_set_dcb_capability(hw);
+
 	hns3_parse_capability(hw, resp);
 
 	return 0;
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 2acb2a56d6..454f73ac77 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -3112,19 +3112,11 @@ hns3_get_capability(struct hns3_hw *hw)
 	struct rte_pci_device *pci_dev;
 	struct hns3_pf *pf = &hns->pf;
 	struct rte_eth_dev *eth_dev;
-	uint16_t device_id;
 	uint8_t revision;
 	int ret;
 
 	eth_dev = &rte_eth_devices[hw->data->port_id];
 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
-	device_id = pci_dev->id.device_id;
-
-	if (device_id == HNS3_DEV_ID_25GE_RDMA ||
-	    device_id == HNS3_DEV_ID_50GE_RDMA ||
-	    device_id == HNS3_DEV_ID_100G_RDMA_MACSEC ||
-	    device_id == HNS3_DEV_ID_200G_RDMA)
-		hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1);
 
 	/* Get PCI revision id */
 	ret = rte_pci_read_config(pci_dev, &revision, HNS3_PCI_REVISION_ID_LEN,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-11-08 19:23:52.992733685 +0000
+++ 0020-net-hns3-fix-setting-DCB-capability.patch	2023-11-08 19:23:51.793396707 +0000
@@ -1 +1 @@
-From ac61c444e647298dded80a2ab52966a2dbe22b68 Mon Sep 17 00:00:00 2001
+From 4cf3c2381b0ccbd1491f3662e4739bac41a8c72d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ac61c444e647298dded80a2ab52966a2dbe22b68 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -18,2 +19,2 @@
- drivers/net/hns3/hns3_ethdev.c | 13 -------------
- 2 files changed, 25 insertions(+), 13 deletions(-)
+ drivers/net/hns3/hns3_ethdev.c |  8 --------
+ 2 files changed, 25 insertions(+), 8 deletions(-)
@@ -22 +23 @@
-index ca1d3f1b8c..62c55f347f 100644
+index dc65ef8c26..2a67c264c6 100644
@@ -25 +26 @@
-@@ -525,6 +525,28 @@ hns3_build_api_caps(void)
+@@ -448,6 +448,28 @@ hns3_build_api_caps(void)
@@ -54 +55 @@
-@@ -542,6 +564,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
+@@ -465,6 +487,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
@@ -61,3 +62,3 @@
- 	/*
- 	 * Make sure mask the capability before parse capability because it
- 	 * may overwrite resp's data.
+ 	hns3_parse_capability(hw, resp);
+ 
+ 	return 0;
@@ -65 +66 @@
-index 0feea52542..472737e8a8 100644
+index 2acb2a56d6..454f73ac77 100644
@@ -68,5 +69,2 @@
-@@ -2719,22 +2719,9 @@ static int
- hns3_get_capability(struct hns3_hw *hw)
- {
- 	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
--	struct rte_pci_device *pci_dev;
+@@ -3112,19 +3112,11 @@ hns3_get_capability(struct hns3_hw *hw)
+ 	struct rte_pci_device *pci_dev;
@@ -74 +72 @@
--	struct rte_eth_dev *eth_dev;
+ 	struct rte_eth_dev *eth_dev;
@@ -75,0 +74 @@
+ 	uint8_t revision;
@@ -78,2 +77,2 @@
--	eth_dev = &rte_eth_devices[hw->data->port_id];
--	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
+ 	eth_dev = &rte_eth_devices[hw->data->port_id];
+ 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
@@ -87,4 +86,3 @@
--
- 	ret = hns3_get_pci_revision_id(hw, &hw->revision);
- 	if (ret)
- 		return ret;
+ 
+ 	/* Get PCI revision id */
+ 	ret = rte_pci_read_config(pci_dev, &revision, HNS3_PCI_REVISION_ID_LEN,


More information about the stable mailing list