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 C6E82A0A0E for ; Mon, 10 May 2021 18:24:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C10F44003E; Mon, 10 May 2021 18:24:02 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2055.outbound.protection.outlook.com [40.107.223.55]) by mails.dpdk.org (Postfix) with ESMTP id 0FFDD410E3 for ; Mon, 10 May 2021 18:24:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cUyFZ9o8hjpu7M3MRz1wWmqdSNxdcRyr5qRrhpSSnsgtTOgB4V0VEvllDBp/3oSKvsdtfg7df9ZVt0DSk38HSRjqN05sTxYYSowTONTfFRXszY88wZeYDc9YFRl6LnVeyacSIiGi9pJjtGYVgVd5Q2DZPY/8xogbB7Nsg9e5TazwdQYgjfzMHuWc0mHxz2CVCYJRnX3TH4+QjYHlY/rYPWgJY+PobHKv1FYIH0pZjY9sjmqOgHUree3+mbudCvlBYNVIV8glZa2PwutFgPNdvmMLz82F3h7foCiLMDAefe2EyI8LGVrsVpjGIMh07X7Dlew5TrvledZUFguU9J9vXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9sgvp689bu3StA5SrzSExN8WfhSJ1ilqR+/K39YZ7b4=; b=ns9wtH6oHE413xFf7l0I/r71UXt/1P5r0+HJGBgZhqXnLoxbnZkxx7aN5W0TaOg7YZesbgfSZTtC+CMSDYxoxlA22XitlEncsbMae+sNXhXkYBA2mxgCQHUTKq7jKYa/kI8MBUlRiLTPeYrU6R8RFJU99zjsTvEUhoaVC0Hsr6bHfdPsaD9BCWunUCkHHbRwRIoiaH4iopYWlvr4dt5lVOM8GV3YPea+90erUQWhkkBn7TUcAj6/Aa2Kb+MOfyxdtYEzXOsuIF4lSyNGPKewPlitteBLCiUfzkMGAu1/aDRGskk4QjQ7zYaT6IwUPBj5eUmTFjeZYhlPR+fCcVFyJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9sgvp689bu3StA5SrzSExN8WfhSJ1ilqR+/K39YZ7b4=; b=mhvLF6rWthjmL57qL4KkSCrkL0nLj8UsHtxyrXelTpZ/NGPaUj1ik0dmL9rIEjBx0BdFS33hzN3EPBT5gF+CIlXgM2j8RRfYpdZuZ/8wyOLrurAm8QH7YZv2Ln0MAoNNPMDgbQWlkrN9dCHC+Cl5f1yLVxN+xQ0/w1XJnX3OdLoqsji+GsBM6084x9diaUggRSGBJ5HDtHPx9rjIFY2yOlzHd5dTFS1nig3MZRAZGCdG0gUjXDEl0YtiNjTSSxFuqDIyHqLd5UJ1bsJqkGyLcV+1hC3FdVQBSKPCB83/XdYdpiRAxfEYzHHoQQA0Lgb9sWwhM+LIMmCyShz6Hry8Rw== Received: from BN0PR03CA0007.namprd03.prod.outlook.com (2603:10b6:408:e6::12) by SA0PR12MB4574.namprd12.prod.outlook.com (2603:10b6:806:94::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 16:23:59 +0000 Received: from BN8NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e6:cafe::25) by BN0PR03CA0007.outlook.office365.com (2603:10b6:408:e6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:23:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT042.mail.protection.outlook.com (10.13.177.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:23:58 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:23:56 +0000 From: Xueming Li To: Richael Zhuang CC: Luca Boccassi , David Hunt , dpdk stable Date: Tue, 11 May 2021 00:02:39 +0800 Message-ID: <20210510160258.30982-210-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5c6579e-2318-4ddd-14f4-08d913d003ec X-MS-TrafficTypeDiagnostic: SA0PR12MB4574: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:883; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gV+N/mU/bc02sQobbvZ3tnf5gy9Pt734yoll65tS+DfNPO5Kz4+baAeVnarf8zIKkkUSMbGVLaoUQI9dM4Tkx767df2/Pz725+AMUG6WCm54mKWlIrzuVKY01N86wakwT2nZ4fLlh9I51IpCPLOgFxaDc8Q3ze5T7xX+hhNCIIUNN8d75sy1jJiKTVBWZ6UYfH7dsAOliniQbpkG6HioY1K5/QoQZKtymUPHNeYXT1ApWDN4i4s/BXh8wc8KMCRLsvTdpaovWXdqBXDOJsoDcnCVJnC3UONBopGhREh52VWU1X77PL8Fab9VH1h3r7n+zK3zfrX3M+z7N4VJZ5Pmk2RW1ghg7zdBscvp1FJW2IXbMAhCKPKxoN3q2qfnnqxWNkf94C6nxMbzHS1Xaprn+mvQV74SlkDV2oLOkUu2ZAs6YyYrer1MLVvfdIZkML/p214GAnnJLhL2TfCnx3xT0XS5mwrUVsKZ8F8ksa5tsHuicwrjDnvSMeNvN7qBNT4Pdny4LhFFInSdTDfyYfL8AXupDEc332ZYVLxoOZa2qQb7fAPGFhfYW9uhmebgiFwxrYTM1z6K9xvAv4MFNRuP61bzgG1V5ZusinyQa76sueYpOKXwwVRJjROq7aez5okX9Q+XalazhxIhZ9BN37s0OWOsLEcLr1Cq5z9wEHJi/eJsMQxvYKZn9jCAVQyAiyvooXtOvgoYhDFfrW5salYm2CLxa8Nt1cxDIbiPaExgaONijq2bBynS//dNVdhBJWqEBnTkmMcJTlbettHRK29UMg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(396003)(136003)(376002)(39860400002)(346002)(46966006)(36840700001)(6286002)(1076003)(54906003)(316002)(6916009)(47076005)(966005)(36756003)(4326008)(36906005)(5660300002)(478600001)(36860700001)(336012)(7696005)(426003)(2616005)(53546011)(83380400001)(26005)(86362001)(356005)(7636003)(186003)(16526019)(6666004)(70586007)(70206006)(55016002)(82740400003)(8936002)(8676002)(82310400003)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:23:58.7715 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5c6579e-2318-4ddd-14f4-08d913d003ec X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4574 Subject: [dpdk-stable] patch 'test/power: add delay before checking CPU frequency' has been queued to stable release 20.11.2 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 20.11.2 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/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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/2266f65a23e33ca9487f6ba0cd92c43d8e7b8e1c our Thanks. Xueming Li --- >From 2266f65a23e33ca9487f6ba0cd92c43d8e7b8e1c Mon Sep 17 00:00:00 2001 From: Richael Zhuang Date: Thu, 15 Apr 2021 13:59:29 +0800 Subject: [PATCH] test/power: add delay before checking CPU frequency Cc: Luca Boccassi [ upstream commit 00456850be40d8b663d1066763ddedffe4346585 ] For some platforms the newly-set frequency may not be effective immediately. If we didn't get the right value from cpuinfo_cur_freq immediately, add 10ms delay each time before rechecking until timeout. >From our test, for some arm platforms, it requires up to 700ms when going from a minimum to a maximum frequency. And it's not the driver/software issue. Fixes: ed7c51a6a680 ("app/test: vm power management") Signed-off-by: Richael Zhuang Reviewed-by: David Hunt --- app/test/test_power_cpufreq.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c index 731c6b4dc8..d47b3e0a1a 100644 --- a/app/test/test_power_cpufreq.c +++ b/app/test/test_power_cpufreq.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "test.h" @@ -44,11 +45,13 @@ static int check_cur_freq(unsigned lcore_id, uint32_t idx) { #define TEST_POWER_CONVERT_TO_DECIMAL 10 +#define MAX_LOOP 100 FILE *f; char fullpath[PATH_MAX]; char buf[BUFSIZ]; uint32_t cur_freq; int ret = -1; + int i; if (snprintf(fullpath, sizeof(fullpath), TEST_POWER_SYSFILE_CUR_FREQ, lcore_id) < 0) { @@ -58,13 +61,27 @@ check_cur_freq(unsigned lcore_id, uint32_t idx) if (f == NULL) { return 0; } - if (fgets(buf, sizeof(buf), f) == NULL) { - goto fail_get_cur_freq; + for (i = 0; i < MAX_LOOP; i++) { + fflush(f); + if (fgets(buf, sizeof(buf), f) == NULL) + goto fail_all; + + cur_freq = strtoul(buf, NULL, TEST_POWER_CONVERT_TO_DECIMAL); + ret = (freqs[idx] == cur_freq ? 0 : -1); + + if (ret == 0) + break; + + if (fseek(f, 0, SEEK_SET) < 0) { + printf("Fail to set file position indicator to 0\n"); + goto fail_all; + } + + /* wait for the value to be updated */ + rte_delay_ms(10); } - cur_freq = strtoul(buf, NULL, TEST_POWER_CONVERT_TO_DECIMAL); - ret = (freqs[idx] == cur_freq ? 0 : -1); -fail_get_cur_freq: +fail_all: fclose(f); return ret; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:31.994200400 +0800 +++ 0211-test-power-add-delay-before-checking-CPU-frequency.patch 2021-05-10 23:59:26.670000000 +0800 @@ -1 +1 @@ -From 00456850be40d8b663d1066763ddedffe4346585 Mon Sep 17 00:00:00 2001 +From 2266f65a23e33ca9487f6ba0cd92c43d8e7b8e1c Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 00456850be40d8b663d1066763ddedffe4346585 ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org