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

Xueming Li xuemingl at nvidia.com
Mon Dec 11 11:11:00 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/13/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=518bc133278f9c88e81f5be63e293612a611976e

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 518bc133278f9c88e81f5be63e293612a611976e 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
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 | 13 -------------
 2 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c
index bdfc85f934..8f5c373acf 100644
--- a/drivers/net/hns3/hns3_cmd.c
+++ b/drivers/net/hns3/hns3_cmd.c
@@ -519,6 +519,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)
 {
@@ -536,6 +558,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);
+
 	/*
 	 * Make sure mask the capability before parse capability because it
 	 * may overwrite resp's data.
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index af66bf062e..03ddc14eae 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2723,22 +2723,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;
 	struct hns3_pf *pf = &hns->pf;
-	struct rte_eth_dev *eth_dev;
-	uint16_t device_id;
 	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);
-
 	ret = hns3_get_pci_revision_id(hw, &hw->revision);
 	if (ret)
 		return ret;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-12-11 17:56:24.304259400 +0800
+++ 0035-net-hns3-fix-setting-DCB-capability.patch	2023-12-11 17:56:22.957652300 +0800
@@ -1 +1 @@
-From ac61c444e647298dded80a2ab52966a2dbe22b68 Mon Sep 17 00:00:00 2001
+From 518bc133278f9c88e81f5be63e293612a611976e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit ac61c444e647298dded80a2ab52966a2dbe22b68 ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +24 @@
-index ca1d3f1b8c..62c55f347f 100644
+index bdfc85f934..8f5c373acf 100644
@@ -25 +27 @@
-@@ -525,6 +525,28 @@ hns3_build_api_caps(void)
+@@ -519,6 +519,28 @@ hns3_build_api_caps(void)
@@ -54 +56 @@
-@@ -542,6 +564,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
+@@ -536,6 +558,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
@@ -65 +67 @@
-index 0feea52542..472737e8a8 100644
+index af66bf062e..03ddc14eae 100644
@@ -68 +70 @@
-@@ -2719,22 +2719,9 @@ static int
+@@ -2723,22 +2723,9 @@ static int


More information about the stable mailing list