[dpdk-stable] patch 'net/hns3: fix return value when clearing statistics' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:04:46 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

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

Thanks.

Luca Boccassi

---
>From ee263a1371c2258602fb6674957b95c3d6068f62 Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei at huawei.com>
Date: Wed, 29 Apr 2020 19:13:28 +0800
Subject: [PATCH] net/hns3: fix return value when clearing statistics

[ upstream commit 68ca93e31cff53d7726d5f7e2b71c5c1cb1743e6 ]

Since the return value of the '.stats_reset' and '.xstats_reset'
callback function is int, when failing to issue command to firmware to
execute clear statistics, the relevant callback function should return
non-zero value.

Fixes: 8839c5e202f3 ("net/hns3: support device stats")

Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
---
 drivers/net/hns3/hns3_stats.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c
index 9948beb179..6e13948f48 100644
--- a/drivers/net/hns3/hns3_stats.c
+++ b/drivers/net/hns3/hns3_stats.c
@@ -492,6 +492,7 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev)
 		if (ret) {
 			hns3_err(hw, "Failed to reset RX No.%d queue stat: %d",
 				 i, ret);
+			return ret;
 		}
 
 		hns3_cmd_setup_basic_desc(&desc_reset, HNS3_OPC_QUERY_TX_STATUS,
@@ -502,6 +503,7 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev)
 		if (ret) {
 			hns3_err(hw, "Failed to reset TX No.%d queue stat: %d",
 				 i, ret);
+			return ret;
 		}
 	}
 
@@ -524,7 +526,7 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
-static void
+static int
 hns3_mac_stats_reset(__rte_unused struct rte_eth_dev *dev)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
@@ -533,10 +535,14 @@ hns3_mac_stats_reset(__rte_unused struct rte_eth_dev *dev)
 	int ret;
 
 	ret = hns3_query_update_mac_stats(dev);
-	if (ret)
+	if (ret) {
 		hns3_err(hw, "Clear Mac stats fail : %d", ret);
+		return ret;
+	}
 
 	memset(mac_stats, 0, sizeof(struct hns3_mac_stats));
+
+	return 0;
 }
 
 /* This function calculates the number of xstats based on the current config */
@@ -911,9 +917,13 @@ hns3_dev_xstats_reset(struct rte_eth_dev *dev)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_pf *pf = &hns->pf;
+	int ret;
 
 	/* Clear tqp stats */
-	(void)hns3_stats_reset(dev);
+	ret = hns3_stats_reset(dev);
+	if (ret)
+		return ret;
+
 	/* Clear reset stats */
 	memset(&hns->hw.reset.stats, 0, sizeof(struct hns3_reset_stats));
 
@@ -921,7 +931,10 @@ hns3_dev_xstats_reset(struct rte_eth_dev *dev)
 		return 0;
 
 	/* HW registers are cleared on read */
-	hns3_mac_stats_reset(dev);
+	ret = hns3_mac_stats_reset(dev);
+	if (ret)
+		return ret;
+
 	/* Clear error stats */
 	memset(&pf->abn_int_stats, 0, sizeof(struct hns3_err_msix_intr_stats));
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:50.602429184 +0100
+++ 0151-net-hns3-fix-return-value-when-clearing-statistics.patch	2020-05-19 14:04:44.476653085 +0100
@@ -1,15 +1,16 @@
-From 68ca93e31cff53d7726d5f7e2b71c5c1cb1743e6 Mon Sep 17 00:00:00 2001
+From ee263a1371c2258602fb6674957b95c3d6068f62 Mon Sep 17 00:00:00 2001
 From: "Wei Hu (Xavier)" <xavier.huwei at huawei.com>
 Date: Wed, 29 Apr 2020 19:13:28 +0800
 Subject: [PATCH] net/hns3: fix return value when clearing statistics
 
+[ upstream commit 68ca93e31cff53d7726d5f7e2b71c5c1cb1743e6 ]
+
 Since the return value of the '.stats_reset' and '.xstats_reset'
 callback function is int, when failing to issue command to firmware to
 execute clear statistics, the relevant callback function should return
 non-zero value.
 
 Fixes: 8839c5e202f3 ("net/hns3: support device stats")
-Cc: stable at dpdk.org
 
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
 ---
@@ -17,10 +18,10 @@
  1 file changed, 17 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c
-index ad276206c5..d2467a4840 100644
+index 9948beb179..6e13948f48 100644
 --- a/drivers/net/hns3/hns3_stats.c
 +++ b/drivers/net/hns3/hns3_stats.c
-@@ -527,6 +527,7 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev)
+@@ -492,6 +492,7 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev)
  		if (ret) {
  			hns3_err(hw, "Failed to reset RX No.%d queue stat: %d",
  				 i, ret);
@@ -28,7 +29,7 @@
  		}
  
  		hns3_cmd_setup_basic_desc(&desc_reset, HNS3_OPC_QUERY_TX_STATUS,
-@@ -537,6 +538,7 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev)
+@@ -502,6 +503,7 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev)
  		if (ret) {
  			hns3_err(hw, "Failed to reset TX No.%d queue stat: %d",
  				 i, ret);
@@ -36,7 +37,7 @@
  		}
  	}
  
-@@ -571,7 +573,7 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev)
+@@ -524,7 +526,7 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev)
  	return 0;
  }
  
@@ -45,7 +46,7 @@
  hns3_mac_stats_reset(__rte_unused struct rte_eth_dev *dev)
  {
  	struct hns3_adapter *hns = dev->data->dev_private;
-@@ -580,10 +582,14 @@ hns3_mac_stats_reset(__rte_unused struct rte_eth_dev *dev)
+@@ -533,10 +535,14 @@ hns3_mac_stats_reset(__rte_unused struct rte_eth_dev *dev)
  	int ret;
  
  	ret = hns3_query_update_mac_stats(dev);
@@ -61,7 +62,7 @@
  }
  
  /* This function calculates the number of xstats based on the current config */
-@@ -979,9 +985,13 @@ hns3_dev_xstats_reset(struct rte_eth_dev *dev)
+@@ -911,9 +917,13 @@ hns3_dev_xstats_reset(struct rte_eth_dev *dev)
  {
  	struct hns3_adapter *hns = dev->data->dev_private;
  	struct hns3_pf *pf = &hns->pf;
@@ -76,7 +77,7 @@
  	/* Clear reset stats */
  	memset(&hns->hw.reset.stats, 0, sizeof(struct hns3_reset_stats));
  
-@@ -989,7 +999,10 @@ hns3_dev_xstats_reset(struct rte_eth_dev *dev)
+@@ -921,7 +931,10 @@ hns3_dev_xstats_reset(struct rte_eth_dev *dev)
  		return 0;
  
  	/* HW registers are cleared on read */


More information about the stable mailing list