From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8D5E242CBC for ; Thu, 15 Jun 2023 03:36:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 875BE42D6C; Thu, 15 Jun 2023 03:36:03 +0200 (CEST) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mails.dpdk.org (Postfix) with ESMTP id 006A842D4B for ; Thu, 15 Jun 2023 03:36:01 +0200 (CEST) Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3094910b150so7280061f8f.0 for ; Wed, 14 Jun 2023 18:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686792961; x=1689384961; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CuWtiSbEsCG5/VyF89D6Q/eWu+HxS6bgFlIB3rgOHXI=; b=BeJhUt5NULQM1i0+PF4RBTb/4FFnro35RDfoiPbO9IgNutrWPogZiQ2ewn9Dwh0Jd4 InhALf2SPtKFx9wB+MCuMrl314FM/NAtQxrvftDTKD+TZResx5PT/mlMkyR1Z35K0/pw yS7IeOU5vMZ2/lDfOcSj/FSTtsx2hrGYV6P/HKltNkhfbJp/2U5P65pdFsNgffZd/DiY 1b3Dp/wcKCT/6vzuWG+ddDBHCFR/MR+vm6PdsmB1pFzuF1cqmADkjlClsrFL/z53FfXP V3B1xGjBol6FyfXBBUNG28KkhM3s0V5HHoJemlidgvk9yUTqfBJ92A2Ntlx1l/pP2Kpp AWJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686792961; x=1689384961; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CuWtiSbEsCG5/VyF89D6Q/eWu+HxS6bgFlIB3rgOHXI=; b=fu17S3NQlnX1nsKbTAjFx0C+sXKvmZygUJS2MokiHJpRfZu6XJexNYqOmGj3cIm33E FpabU8tbvtBpO9MpGfy8MeTliVAXlxUoIq8CHuWbk1d1qQOUqfOaKpjEjC3O+TRDpsFs VgUK9JGtixhDHk+c0QDmJ9zb24jKJcWuYFWvsxGRI1fjTj+BJpbTRb+F64e9BgV3XlBE 0nbEWqX1cBnpduh4Rj9/sk1Q0ChvbQkq8wEPM8JN1LkUs/Ra/Szd0bkkSSR3vS+8wo2u ES7d+oBX6x7smajlwd5piGNNDXwAhN1MBu3nUTmEsNmID+cCpYTtbkCQnJY5jJkUMGXm KcVA== X-Gm-Message-State: AC+VfDwgEot4yqDqSEfgxZ81DycgD2eNVuJrwURjdtIDh2hJqyjTEHVt DifoYtwAiulcdVESfH8L7CmXZ+qRViuXrwNB X-Google-Smtp-Source: ACHHUZ5a6HfwLrXgcJF2w6Q6/d9yMbqSPvh0c4YNSDlnaSZNa9s7Z3IaNgJNHBb0hXCKBjo1XSmodQ== X-Received: by 2002:adf:e612:0:b0:30f:c56c:b5a7 with SMTP id p18-20020adfe612000000b0030fc56cb5a7mr7308510wrm.4.1686792961648; Wed, 14 Jun 2023 18:36:01 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id 14-20020a05600c024e00b003f8044b3448sm18534357wmj.9.2023.06.14.18.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 18:36:01 -0700 (PDT) From: luca.boccassi@gmail.com To: Qiming Yang Cc: Vignesh Sridhar , Qi Zhang , dpdk stable Subject: patch 'net/ice/base: remove unreachable code' has been queued to stable release 20.11.9 Date: Thu, 15 Jun 2023 02:32:53 +0100 Message-Id: <20230615013258.1439718-58-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230615013258.1439718-1-luca.boccassi@gmail.com> References: <20230615013258.1439718-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/17/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/8ecef29eea9b7f0758b6de199866b7a997556bec Thanks. Luca Boccassi --- >From 8ecef29eea9b7f0758b6de199866b7a997556bec Mon Sep 17 00:00:00 2001 From: Qiming Yang 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 Signed-off-by: Qiming Yang Acked-by: Qi Zhang --- 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 9196628cf1..89d32a6bae 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -1370,11 +1370,6 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) clk_src = (val & GLGEN_CLKSTAT_SRC_PSM_CLK_SRC_M) >> 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: hw->psm_clk_freq = ICE_PSM_CLK_367MHZ_IN_HZ; @@ -1388,11 +1383,12 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) case PSM_CLK_SRC_390_MHZ: 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 8b275637a4..b49390f2c8 100644 --- a/drivers/net/ice/base/ice_sched.h +++ b/drivers/net/ice/base/ice_sched.h @@ -35,6 +35,11 @@ #define ICE_PSM_CLK_446MHZ_IN_HZ 446428571 #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 */ u16 rl_multiplier; -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-15 01:56:37.610869024 +0100 +++ 0058-net-ice-base-remove-unreachable-code.patch 2023-06-15 01:56:34.719544625 +0100 @@ -1 +1 @@ -From ca2011635fa38c71f47933d77ee618ca4d4f640f Mon Sep 17 00:00:00 2001 +From 8ecef29eea9b7f0758b6de199866b7a997556bec Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ca2011635fa38c71f47933d77ee618ca4d4f640f ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index a526c8f32c..b16b27dcbf 100644 +index 9196628cf1..89d32a6bae 100644 @@ -26 +27 @@ -@@ -1417,11 +1417,6 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) +@@ -1370,11 +1370,6 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) @@ -38 +39 @@ -@@ -1435,11 +1430,12 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) +@@ -1388,11 +1383,12 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) @@ -57 +58 @@ -index 3724ef33a8..64ed5e0f9b 100644 +index 8b275637a4..b49390f2c8 100644 @@ -60 +61 @@ -@@ -38,6 +38,11 @@ +@@ -35,6 +35,11 @@