patch 'net/ice/base: remove unreachable code' has been queued to stable release 21.11.5

Kevin Traynor ktraynor at redhat.com
Thu Jul 20 17:18:23 CEST 2023


Hi,

FYI, your patch has been queued to stable release 21.11.5

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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/f420162557cea8f588c9a145d06d4b18d896bf11

Thanks.

Kevin

---
>From f420162557cea8f588c9a145d06d4b18d896bf11 Mon Sep 17 00:00:00 2001
From: Qiming Yang <qiming.yang at intel.com>
Date: Thu, 18 May 2023 15:16:36 +0000
Subject: [PATCH] net/ice/base: remove unreachable code

[ upstream commit ca2011635fa38c71f47933d77ee618ca4d4f640f ]

The default condition in the switch statement in
ice_sched_get_psm_clk_freq() is an unreachable code. The variable
clk_src is restricted to values 0 to 3 with the bit mask and shift
values set.

Fixes: 76ac9d771c97 ("net/ice/base: read PSM clock frequency from register")

Signed-off-by: Vignesh Sridhar <vignesh.sridhar at intel.com>
Signed-off-by: Qiming Yang <qiming.yang at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/ice/base/ice_sched.c | 16 ++++++----------
 drivers/net/ice/base/ice_sched.h |  5 +++++
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index 0841ec8c5b..f3655a820f 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -1395,9 +1395,4 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw)
 		GLGEN_CLKSTAT_SRC_PSM_CLK_SRC_S;
 
-#define PSM_CLK_SRC_367_MHZ 0x0
-#define PSM_CLK_SRC_416_MHZ 0x1
-#define PSM_CLK_SRC_446_MHZ 0x2
-#define PSM_CLK_SRC_390_MHZ 0x3
-
 	switch (clk_src) {
 	case PSM_CLK_SRC_367_MHZ:
@@ -1413,9 +1408,10 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw)
 		hw->psm_clk_freq = ICE_PSM_CLK_390MHZ_IN_HZ;
 		break;
-	default:
-		ice_debug(hw, ICE_DBG_SCHED, "PSM clk_src unexpected %u\n",
-			  clk_src);
-		/* fall back to a safe default */
-		hw->psm_clk_freq = ICE_PSM_CLK_446MHZ_IN_HZ;
+
+	/* default condition is not required as clk_src is restricted
+	 * to a 2-bit value from GLGEN_CLKSTAT_SRC_PSM_CLK_SRC_M mask.
+	 * The above switch statements cover the possible values of
+	 * this variable.
+	 */
 	}
 }
diff --git a/drivers/net/ice/base/ice_sched.h b/drivers/net/ice/base/ice_sched.h
index 1441b5f191..22ed09d2b1 100644
--- a/drivers/net/ice/base/ice_sched.h
+++ b/drivers/net/ice/base/ice_sched.h
@@ -36,4 +36,9 @@
 #define ICE_PSM_CLK_390MHZ_IN_HZ 390625000
 
+#define PSM_CLK_SRC_367_MHZ 0x0
+#define PSM_CLK_SRC_416_MHZ 0x1
+#define PSM_CLK_SRC_446_MHZ 0x2
+#define PSM_CLK_SRC_390_MHZ 0x3
+
 struct rl_profile_params {
 	u32 bw;			/* in Kbps */
-- 
2.41.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-07-20 16:18:03.582092242 +0100
+++ 0072-net-ice-base-remove-unreachable-code.patch	2023-07-20 16:17:54.889751439 +0100
@@ -1 +1 @@
-From ca2011635fa38c71f47933d77ee618ca4d4f640f Mon Sep 17 00:00:00 2001
+From f420162557cea8f588c9a145d06d4b18d896bf11 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ca2011635fa38c71f47933d77ee618ca4d4f640f ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index a526c8f32c..b16b27dcbf 100644
+index 0841ec8c5b..f3655a820f 100644
@@ -26 +27 @@
-@@ -1418,9 +1418,4 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw)
+@@ -1395,9 +1395,4 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw)
@@ -36 +37 @@
-@@ -1436,9 +1431,10 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw)
+@@ -1413,9 +1408,10 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw)
@@ -53 +54 @@
-index 3724ef33a8..64ed5e0f9b 100644
+index 1441b5f191..22ed09d2b1 100644
@@ -56 +57 @@
-@@ -39,4 +39,9 @@
+@@ -36,4 +36,9 @@



More information about the stable mailing list