[dpdk-stable] patch 'net/i40e/base: improve the polling mechanism' has been queued to stable release 18.08.1

Kevin Traynor ktraynor at redhat.com
Wed Nov 21 17:47:31 CET 2018


Hi,

FYI, your patch has been queued to stable release 18.08.1

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/27/18. 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. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Kevin Traynor

---
>From a788a452adf94a9c4d3cac183b8f3d666de4a369 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang at intel.com>
Date: Tue, 25 Sep 2018 10:34:29 +0800
Subject: [PATCH] net/i40e/base: improve the polling mechanism

[ upstream commit 54f4a22dc1731ef32760eb3a13f7d5a2e889650b ]

This patch fixes the polling mechanism of GLGEN_RSTAT.DEVSTATE
in the PF Reset path when Global Reset is in progress.
While the driver is polling for the end of the PF Reset and
the Global Reset is triggered, abandon the PF Reset path and
prepare for the upcoming Global Reset.

Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
Acked-by: Beilei Xing <beilei.xing at intel.com>
---
 drivers/net/i40e/base/i40e_common.c | 35 ++++++++++++++++++++++++-----
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index 6fbba01d3..f10761644 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -1327,4 +1327,27 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 }
 
+/**
+ * i40e_poll_globr - Poll for Global Reset completion
+ * @hw: pointer to the hardware structure
+ * @retry_limit: how many times to retry before failure
+ **/
+STATIC enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw,
+					     u32 retry_limit)
+{
+	u32 cnt, reg = 0;
+
+	for (cnt = 0; cnt < retry_limit; cnt++) {
+		reg = rd32(hw, I40E_GLGEN_RSTAT);
+		if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK))
+			return I40E_SUCCESS;
+		i40e_msec_delay(100);
+	}
+
+	DEBUGOUT("Global reset failed.\n");
+	DEBUGOUT1("I40E_GLGEN_RSTAT = 0x%x\n", reg);
+
+	return I40E_ERR_RESET_FAILED;
+}
+
 #define I40E_PF_RESET_WAIT_COUNT	200
 /**
@@ -1396,12 +1419,12 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw)
 				break;
 			reg2 = rd32(hw, I40E_GLGEN_RSTAT);
-			if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) {
-				DEBUGOUT("Core reset upcoming. Skipping PF reset request.\n");
-				DEBUGOUT1("I40E_GLGEN_RSTAT = 0x%x\n", reg2);
-				return I40E_ERR_NOT_READY;
-			}
+			if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK)
+				break;
 			i40e_msec_delay(1);
 		}
-		if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) {
+		if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) {
+			if (i40e_poll_globr(hw, grst_del) != I40E_SUCCESS)
+				return I40E_ERR_RESET_FAILED;
+		} else if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) {
 			DEBUGOUT("PF reset polling failed to complete.\n");
 			return I40E_ERR_RESET_FAILED;
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-21 16:44:31.399682301 +0000
+++ 0017-net-i40e-base-improve-the-polling-mechanism.patch	2018-11-21 16:44:30.000000000 +0000
@@ -1,16 +1,16 @@
-From 54f4a22dc1731ef32760eb3a13f7d5a2e889650b Mon Sep 17 00:00:00 2001
+From a788a452adf94a9c4d3cac183b8f3d666de4a369 Mon Sep 17 00:00:00 2001
 From: Qi Zhang <qi.z.zhang at intel.com>
 Date: Tue, 25 Sep 2018 10:34:29 +0800
 Subject: [PATCH] net/i40e/base: improve the polling mechanism
 
+[ upstream commit 54f4a22dc1731ef32760eb3a13f7d5a2e889650b ]
+
 This patch fixes the polling mechanism of GLGEN_RSTAT.DEVSTATE
 in the PF Reset path when Global Reset is in progress.
 While the driver is polling for the end of the PF Reset and
 the Global Reset is triggered, abandon the PF Reset path and
 prepare for the upcoming Global Reset.
 
-Cc: stable at dpdk.org
-
 Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
 Acked-by: Beilei Xing <beilei.xing at intel.com>
 ---
@@ -18,10 +18,10 @@
  1 file changed, 29 insertions(+), 6 deletions(-)
 
 diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
-index 18009be3b..0affa98ac 100644
+index 6fbba01d3..f10761644 100644
 --- a/drivers/net/i40e/base/i40e_common.c
 +++ b/drivers/net/i40e/base/i40e_common.c
-@@ -1297,4 +1297,27 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
+@@ -1327,4 +1327,27 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
  }
  
 +/**
@@ -49,7 +49,7 @@
 +
  #define I40E_PF_RESET_WAIT_COUNT	200
  /**
-@@ -1366,12 +1389,12 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw)
+@@ -1396,12 +1419,12 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw)
  				break;
  			reg2 = rd32(hw, I40E_GLGEN_RSTAT);
 -			if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) {


More information about the stable mailing list