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 E7F5CA0C47 for ; Tue, 10 Aug 2021 17:43:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E007F411C5; Tue, 10 Aug 2021 17:43:30 +0200 (CEST) Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) by mails.dpdk.org (Postfix) with ESMTP id ABB89411CA for ; Tue, 10 Aug 2021 17:43:29 +0200 (CEST) Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id 8A3D23F0A1 for ; Tue, 10 Aug 2021 15:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628610209; bh=rRl9WFE1XiZaxGxk82KiWapmwzDeNZPqpxXRZZUea24=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lgLaoaP2O5m0sAXCXAivoaSt7cSxfnFUYDXQmkAts344MMEQPcRgthl4cOnT5wXgC /B9ftYyc53erXIG5Qmg2QHJXwGU7+NMwqaCFmwsdOebAZrRjZX0CiffCdk/rmR4g7w hy0rIeag1HFojkqv0Zj1fptlXOWIUd4BBBW5q7ve/yiGuQ8UTYlqcXVCcq4sOvhkz4 G+mYNbeGz/NQ3EVZPc0ZDLUuCQBxyw8dwcEemZajCNQs8wyMfblJEER40cLqF3pBux 81bL3anxZzYzGtq5uC2mqZzdNzDffOEouaJUXouTYTqROUIIsu8STnvrWPByi/uAlx 1Zzc8cDxySqLQ== Received: by mail-ej1-f72.google.com with SMTP id gg35-20020a17090689a3b0290580ff45a075so135968ejc.20 for ; Tue, 10 Aug 2021 08:43:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rRl9WFE1XiZaxGxk82KiWapmwzDeNZPqpxXRZZUea24=; b=nFnXl6KswnkrlrlL+AaIA90cNJcaBkTJqAYpCqCBICtnrUrVygxhhWlAW6lD5EtJot 2/vCQhn5fKZM6kcZrhjJx/NoklkRVKllAJR0B4AdzYAp9GC+leBbDJJuIRMB6L8HBpVy EtGRIfpjHsQ5eu9wn3ZespAVbBeW5DBRZFIVDw9DFGq0bNLmWyRzDME6Ff+j71Qom3My G6hVBPNn6z+1j4TivmutMJIFOvn6QjdN8Ie8zkbIgiUks8v+nmZ0NfAxc85DUoXC3rWV 2nZBsyWo/xdMT5rbrPw7aXUDgt1SPES0NSNXK90S7gz0RkxrorAXMl67+J+1/8wK68vu Apaw== X-Gm-Message-State: AOAM533SMbIYtJ2WJ92kmi6NRIuaRu9M6srWXq5vI08y+0NXxqOIds5h CxqEO256w/GYmviuRHoStdilj3dzTijhiw6Yz7SDKHRuE3CgY2ck3bOE6h7sp6mdfQFTY1UsBk4 t8FbHJPQ2vWN2dgVrZveVyU2M X-Received: by 2002:a05:6402:3552:: with SMTP id f18mr5576571edd.82.1628610209304; Tue, 10 Aug 2021 08:43:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt/huODrRzEC1+aILLgNbIAve0JSQCi5mt0h2Zs1i7ggRHogDmgsjkIAyFI/d5eOSJRETv1g== X-Received: by 2002:a05:6402:3552:: with SMTP id f18mr5576555edd.82.1628610209147; Tue, 10 Aug 2021 08:43:29 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id v13sm6996976ejh.62.2021.08.10.08.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 08:43:28 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Richael Zhuang Cc: David Hunt , dpdk stable Date: Tue, 10 Aug 2021 17:39:40 +0200 Message-Id: <20210810154022.749358-60-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810154022.749358-1-christian.ehrhardt@canonical.com> References: <20210810154022.749358-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'test/power: fix CPU frequency when turbo enabled' has been queued to stable release 19.11.10 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/4da3e8a9f04a9c2f820b8270b25b09cca79ed739 Thanks. Christian Ehrhardt --- >From 4da3e8a9f04a9c2f820b8270b25b09cca79ed739 Mon Sep 17 00:00:00 2001 From: Richael Zhuang Date: Fri, 9 Jul 2021 18:55:48 +0800 Subject: [PATCH] test/power: fix CPU frequency when turbo enabled [ upstream commit 29343b9030e38e8c3519ba01cb66724d45b13dc8 ] On arm platform, the value in "/sys/.../cpuinfo_cur_freq" may not be exactly the same as what was set when using CPPC cpufreq driver. For other cpufreq driver, no need to round it currently, or else this check will fail with turbo enabled. For example, with acpi_cpufreq, cpuinfo_cur_freq can be 2401000 which is equal to freqs[0].It should not be rounded to 2400000. Fixes: 606a234c6d360 ("test/power: round CPU frequency to check") Signed-off-by: Richael Zhuang Acked-by: David Hunt --- app/test/test_power_cpufreq.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c index d0c7e60ca5..e5bf3b3367 100644 --- a/app/test/test_power_cpufreq.c +++ b/app/test/test_power_cpufreq.c @@ -55,7 +55,9 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo) FILE *f; char fullpath[PATH_MAX]; char buf[BUFSIZ]; + enum power_management_env env; uint32_t cur_freq; + uint32_t freq_conv; int ret = -1; int i; @@ -80,15 +82,18 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo) goto fail_all; cur_freq = strtoul(buf, NULL, TEST_POWER_CONVERT_TO_DECIMAL); - - /* convert the frequency to nearest 100000 value - * Ex: if cur_freq=1396789 then freq_conv=1400000 - * Ex: if cur_freq=800030 then freq_conv=800000 - */ - unsigned int freq_conv = 0; - freq_conv = (cur_freq + TEST_FREQ_ROUNDING_DELTA) - / TEST_ROUND_FREQ_TO_N_100000; - freq_conv = freq_conv * TEST_ROUND_FREQ_TO_N_100000; + freq_conv = cur_freq; + + env = rte_power_get_env(); + if (env == PM_ENV_CPPC_CPUFREQ) { + /* convert the frequency to nearest 100000 value + * Ex: if cur_freq=1396789 then freq_conv=1400000 + * Ex: if cur_freq=800030 then freq_conv=800000 + */ + freq_conv = (cur_freq + TEST_FREQ_ROUNDING_DELTA) + / TEST_ROUND_FREQ_TO_N_100000; + freq_conv = freq_conv * TEST_ROUND_FREQ_TO_N_100000; + } if (turbo) ret = (freqs[idx] <= freq_conv ? 0 : -1); -- 2.32.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-10 15:11:15.364486251 +0200 +++ 0060-test-power-fix-CPU-frequency-when-turbo-enabled.patch 2021-08-10 15:11:13.054638359 +0200 @@ -1 +1 @@ -From 29343b9030e38e8c3519ba01cb66724d45b13dc8 Mon Sep 17 00:00:00 2001 +From 4da3e8a9f04a9c2f820b8270b25b09cca79ed739 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 29343b9030e38e8c3519ba01cb66724d45b13dc8 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 8516df4ca6..b8fc53925c 100644 +index d0c7e60ca5..e5bf3b3367 100644