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 F3D39A0A0E for ; Mon, 10 May 2021 18:24:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EDA314003E; Mon, 10 May 2021 18:24:21 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2083.outbound.protection.outlook.com [40.107.237.83]) by mails.dpdk.org (Postfix) with ESMTP id 6DBBF4003E for ; Mon, 10 May 2021 18:24:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W77K+WmPTBnVWyKmI9IdGtucXcLPE56GJ8QGlD6beqFOjM+X5MyzcASIp7kMwMR7MA5nkdx6tDvVN0nh4W/CbDO9n6Ph5g0574LYDfBn8XnXla15kJxR+OewpAswjCZ1Wm26n5Ahj0sj/pdYKanzXlMgTrRE6AsqMfopfpR4FFnCVr01s3LTP14RdLo7ANxyit3hn9zsVLEv/7/qFUqw077V2YmQvAhz0E4+mML9txXXGShKxL1eCM+REL4ybJGL5klAGTlxpjwsTR5cgXa9G6iX3PeDYRCWMpMmN/52YP24yixqcmhn7ZKv5zirFzQF8JB1ag3uDr/Oz7kspLImgg== 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=EkyFnm/Cp1Mt+VZ3tdMyEPH4/4qTD/dVtMNTcy4bDus=; b=HqFFs58YhIooa/gxhLMJhokAR0pGmq8G3MceHctCWsPllz7IqTM9lPkxJycYW/1v+1MnP9EY3C/nTHG1zRPBvSw/Kexu2AasZZU+3tE0NSkjEO0DNdBRcEL4JZXXWVU8R5sNK12a15nsGBiJVcTPNvLNzH0jWi4Upb2v5pQZ8VvJEf1un5xhwXurQSK1lVxI+etxMbaDiV4AEmBMmgKOfSM+xup1Xv4i4OPsOBxLk8tDMyTZ7Jl/33Mp9XFULYvZnB1l1L3LbhThuAq5QO9G3nqaF3fL48Q9q12ukgwtWx2/PkRoe6LwVAPunlkFQU4r+QJqY0S299mEHgwl+kFujg== 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=EkyFnm/Cp1Mt+VZ3tdMyEPH4/4qTD/dVtMNTcy4bDus=; b=XgQ3OUJHkuAAR1xGXWlebYv2slETYHr4Fb3MsRXB+Gde1rpCjVsz/TzHDlXYwNB6P+bZOD/a8KKhp38ZOB/zkyEpuAB93wssMmOX0sffEnpL7AqF01WWu6oDtQNonyqiEcd4LnH+u58mpHRVS/SPSRtWxsTq/UUvbTraBsZjL4kcMjR4RA26bZ7HHvsFSX/+sUKGkNEDCSEclwJlaolZR9WlyzYErvupkIcyMjnDxzatcy8QyaI5Wo0D+o6OSgLJEcv5MM2mz1U4lILQA65KXN8tDYyJiy4IKzhOkBa953ADtzJxmq5v+GXOOM4SIKgA/tBPI7kZRRysU9PRUoCJ4g== Received: from BN6PR1101CA0001.namprd11.prod.outlook.com (2603:10b6:405:4a::11) by BN8PR12MB3395.namprd12.prod.outlook.com (2603:10b6:408:43::18) 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:24:19 +0000 Received: from BN8NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:405:4a:cafe::b0) by BN6PR1101CA0001.outlook.office365.com (2603:10b6:405:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Mon, 10 May 2021 16:24:19 +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 BN8NAM11FT003.mail.protection.outlook.com (10.13.177.90) 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:24:19 +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:24:16 +0000 From: Xueming Li To: Richael Zhuang CC: Luca Boccassi , David Hunt , dpdk stable Date: Tue, 11 May 2021 00:02:40 +0800 Message-ID: <20210510160258.30982-211-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: 9d41b519-e476-4702-c015-08d913d01049 X-MS-TrafficTypeDiagnostic: BN8PR12MB3395: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7FXl8cZ4H2pGWLl9+m9mRre+r0Kr5rk673mLi+u2O5dRgXWdDCXy35nlBjmhzKNZFJFpgW6npeU/P4Cy3i/oCc/9SnxQ6WbMrYSmcYkQxzx0PDqq4S4Xjbb3x4EedvOzy+biggyJN2lv4z0hT2RDdUXRJA61cLCmlglosMyo0EPmoT7h0DptseGFBQy0oCbhbQoSj17f4q68OTqil5n6sxTEx0x+vm9TBeCXQkaQZNSF7LJ5egtncN6zTWCxT2vcdp7kPmaxqMnzRVKalPPI5/wbu0RFpzGCH1gbnFTPMeBXH4lnZe+WK0n/8B/jEilImougG0CMqbp5aqLLmiao2QSlTREGgBI/8U1MtsGHmvNj/NuwBH4Dj6LWwgRQn6hMaEQF+1sc3u4Q0o9s4lSIyRMYcISZpIos7NSP+ogObz69vw4RnSzjsIBibA8iZ6wa7uix15BvwxyFcTb5yg6F94+1syao2cJJQ7lGnHPU0u/4DkrlleYZ0iNUYXy6HR3r76kPPd4OjM69JHgnHMPKFEF7vjUNe+2oEXaiAPzLPhteCXjQC1gy0ag5GigJYsH7BeLXpz2O+IyVXy+s3ACyfzNxKzEX/zftRUtci6yblRlRUmKn7/SyeGBOpZgVTu/BNTRg3Ey3FuRGf5h+IxVDz/MqZbf335Je9i/7/Th8lLD6aPTz+cJPhhAbutFN6C9M0k7/Skq9de0munOHjiNbml1NofbClHUvScreyxNfTgu5vx5C8pTUaF3tutGW64Kqjm2Ys4UmlSchHN0rUET2gA== 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)(136003)(376002)(396003)(39860400002)(346002)(36840700001)(46966006)(36756003)(36906005)(82310400003)(55016002)(2906002)(316002)(6916009)(7636003)(6666004)(70586007)(26005)(186003)(36860700001)(54906003)(1076003)(83380400001)(5660300002)(47076005)(8676002)(86362001)(336012)(53546011)(2616005)(4326008)(82740400003)(8936002)(966005)(70206006)(7696005)(478600001)(16526019)(426003)(356005)(6286002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:24:19.4821 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d41b519-e476-4702-c015-08d913d01049 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: BN8NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3395 Subject: [dpdk-stable] patch 'test/power: round CPU frequency to check' 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/8347ba1646e41c9ccb2a5addc30b8996f487c142 Thanks. Xueming Li --- >From 8347ba1646e41c9ccb2a5addc30b8996f487c142 Mon Sep 17 00:00:00 2001 From: Richael Zhuang Date: Thu, 15 Apr 2021 13:59:30 +0800 Subject: [PATCH] test/power: round CPU frequency to check Cc: Luca Boccassi [ upstream commit 606a234c6d3607c93a0426bdccdbf9aaa2b8e5f6 ] The value in "/sys/.../cpuinfo_cur_freq" may not be exactly the same as what was set. For example, if "2400000" is written to "/sys/.../cpufreq/scaling_setspeed" to set the frequency, then the value in "/sys/.../cpuinfo_cur_freq" may be "2401222". So need to round the value. Fixes: ed7c51a6a680 ("app/test: vm power management") Signed-off-by: Richael Zhuang Reviewed-by: David Hunt --- app/test/test_power_cpufreq.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c index d47b3e0a1a..f753d24ac5 100644 --- a/app/test/test_power_cpufreq.c +++ b/app/test/test_power_cpufreq.c @@ -35,6 +35,10 @@ test_power_caps(void) #define TEST_POWER_LCORE_INVALID ((unsigned)RTE_MAX_LCORE) #define TEST_POWER_FREQS_NUM_MAX ((unsigned)RTE_MAX_LCORE_FREQS) +/* macros used for rounding frequency to nearest 100000 */ +#define TEST_FREQ_ROUNDING_DELTA 50000 +#define TEST_ROUND_FREQ_TO_N_100000 100000 + #define TEST_POWER_SYSFILE_CUR_FREQ \ "/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_cur_freq" @@ -67,7 +71,17 @@ check_cur_freq(unsigned lcore_id, uint32_t idx) goto fail_all; cur_freq = strtoul(buf, NULL, TEST_POWER_CONVERT_TO_DECIMAL); - ret = (freqs[idx] == cur_freq ? 0 : -1); + + /* 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; + + ret = (freqs[idx] == freq_conv ? 0 : -1); if (ret == 0) break; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:32.017043100 +0800 +++ 0212-test-power-round-CPU-frequency-to-check.patch 2021-05-10 23:59:26.670000000 +0800 @@ -1 +1 @@ -From 606a234c6d3607c93a0426bdccdbf9aaa2b8e5f6 Mon Sep 17 00:00:00 2001 +From 8347ba1646e41c9ccb2a5addc30b8996f487c142 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 606a234c6d3607c93a0426bdccdbf9aaa2b8e5f6 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org