patch 'net/hns3: fix some return values' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Mon Dec 11 11:11:02 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=84b217ed2cf446539ff591af5c52eec75e3bdf84

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 84b217ed2cf446539ff591af5c52eec75e3bdf84 Mon Sep 17 00:00:00 2001
From: Jie Hai <haijie1 at huawei.com>
Date: Tue, 31 Oct 2023 20:23:56 +0800
Subject: [PATCH] net/hns3: fix some return values
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 ]

1. Fix the return value of hns3_get_imissed_stats_num as 'uint16_t'.
2. Add some error check for return value.

Fixes: fcba820d9b9e ("net/hns3: support flow director")

Signed-off-by: Jie Hai <haijie1 at huawei.com>
---
 drivers/net/hns3/hns3_ethdev_vf.c |  5 ++++-
 drivers/net/hns3/hns3_fdir.c      |  2 +-
 drivers/net/hns3/hns3_stats.c     | 15 ++++++++++-----
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 3cbf2ed2a7..64f4dd148c 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -2162,8 +2162,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)
 		 */
 		if (pci_dev->kdrv == RTE_PCI_KDRV_IGB_UIO ||
 		    pci_dev->kdrv == RTE_PCI_KDRV_UIO_GENERIC) {
-			if (hns3vf_enable_msix(pci_dev, true))
+			ret = hns3vf_enable_msix(pci_dev, true);
+			if (ret != 0) {
 				hns3_err(hw, "Failed to enable msix");
+				return ret;
+			}
 		}
 
 		rte_intr_enable(pci_dev->intr_handle);
diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index 48a91fb517..a3e79619ec 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -974,7 +974,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
 				 rule->key_conf.spec.src_port,
 				 rule->key_conf.spec.dst_port, ret);
 		else
-			hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf);
+			ret = hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf);
 
 		return ret;
 	}
diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c
index c2e692a2c5..9a1e8935e5 100644
--- a/drivers/net/hns3/hns3_stats.c
+++ b/drivers/net/hns3/hns3_stats.c
@@ -771,7 +771,7 @@ hns3_mac_stats_reset(struct hns3_hw *hw)
 	return 0;
 }
 
-static int
+static uint16_t
 hns3_get_imissed_stats_num(struct hns3_adapter *hns)
 {
 #define NO_IMISSED_STATS_NUM   0
@@ -993,7 +993,7 @@ hns3_imissed_stats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
 	struct hns3_rx_missed_stats *imissed_stats = &hw->imissed_stats;
-	int imissed_stats_num;
+	uint16_t imissed_stats_num;
 	int cnt = *count;
 	char *addr;
 	uint16_t i;
@@ -1170,7 +1170,7 @@ hns3_imissed_stats_name_get(struct rte_eth_dev *dev,
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	uint32_t cnt = *count;
-	int imissed_stats_num;
+	uint16_t imissed_stats_num;
 	uint16_t i;
 
 	imissed_stats_num = hns3_get_imissed_stats_num(hns);
@@ -1539,8 +1539,13 @@ hns3_stats_init(struct hns3_hw *hw)
 		return ret;
 	}
 
-	if (!hns->is_vf)
-		hns3_mac_stats_reset(hw);
+	if (!hns->is_vf) {
+		ret = hns3_mac_stats_reset(hw);
+		if (ret) {
+			hns3_err(hw, "reset mac stats failed, ret = %d", ret);
+			return ret;
+		}
+	}
 
 	return hns3_tqp_stats_init(hw);
 }
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-12-11 17:56:24.368063600 +0800
+++ 0037-net-hns3-fix-some-return-values.patch	2023-12-11 17:56:22.977652300 +0800
@@ -1 +1 @@
-From 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 Mon Sep 17 00:00:00 2001
+From 84b217ed2cf446539ff591af5c52eec75e3bdf84 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 0a227e6e45..156fb905f9 100644
+index 3cbf2ed2a7..64f4dd148c 100644
@@ -23 +25 @@
-@@ -2081,8 +2081,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)
+@@ -2162,8 +2162,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)
@@ -37 +39 @@
-index c80fa59e63..d100e58d10 100644
+index 48a91fb517..a3e79619ec 100644
@@ -40 +42 @@
-@@ -978,7 +978,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
+@@ -974,7 +974,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,


More information about the stable mailing list