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 19B11A0A0E for ; Mon, 10 May 2021 18:15:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C21B40140; Mon, 10 May 2021 18:15:54 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770077.outbound.protection.outlook.com [40.107.77.77]) by mails.dpdk.org (Postfix) with ESMTP id 53C9640140 for ; Mon, 10 May 2021 18:15:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bUKG9VuYOusIZA50K1uxl63whrXhob4Lb3onmBrNyDCu8nbQYeNHh7iBc+t4BSJNG/qwkPGgoNSNAerGzC/k8o+xhhe54anzZJ2FUqM99wwLvRT9SNeikZlt24byhqkDsgshMXw5slGBaswCGWo4+ZoqvCrXuanPqeWGqJ/H74l+6gb1HneWzEy6fg71QO2BMlET7eSLy3QzfRA9rNfI6qMvdnJ29dWr3azqaTHqAXSgpuhoSssppMx/cXbVdwpY3c1Tk5AHf9RDSkzyPm1VPXc96rUQdayCPxQa7Dc6Lg5EQ8pvfEpBFnUJKTJJ+o9m7CVOD93gu7hjtUwpXFchXQ== 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=O/lMmJ18+wuSsPCBvOA4Ve6++xfCj9LkzHLrc9rrXe4=; b=XILY0zvs6lxuuZtB/fAYWg7tGi/RWUCGCzTOHC8IXAOHcGboNut4LqMjumaqyRHqcb45BPDHkhfwwx4VxfmbcsDJ9gH5QUebegs/NS8Mdprhb3yw2as3z1gIWSkQ5YG00g6PQhJYxe7uYaonGPxDGnxIlaRsc5ppH9XGpTuWacmyX2ZMI1aL+RZB7fywrIAzNK8RZBxf/tNS0vyaZ1z1svvaD0qQPHXHjXtCgfnsMsGVlIME20nVEsw+paQAjyAW50X5CtpevhxKTBBHmOYsuRz3kdp0cT20mzfQfmEBlykEVQdHiOBMGJIuWxLmNBxB9a9LeRGkQ2j++Z5GslxMWQ== 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=O/lMmJ18+wuSsPCBvOA4Ve6++xfCj9LkzHLrc9rrXe4=; b=as42zswpn3vYHD/UzOSZPC4/7ENZPkndqFZUlx7Hodtdc9hg1RlkO7q0Um8ZTvbzx6qFEdk3dlzUW0tGyWCvDoNZ2b6YXNCB/Tzu+r2uwguu8DGRN3vKXZxigI5WTk7aMIYf1IdKg1z/xeYYXiL8t6g9xyshJgwtVr1gvOxUEyoKciOpNEKRABvVf5aUdzFsTRheuZb/KEEMqCopKLHKvvmsjHCZ5j8NFj/XEnUdyin5DX1h1H2PSCtESTb3ZH5DRRekd63Cl5+WAFidUb/HMnzyE/aI3v22iKX2Ig6SaamTtmlTP/c6iHgTB57PnZ0+k80Iym6ES/wEsEVqtHOSqA== Received: from DM5PR11CA0016.namprd11.prod.outlook.com (2603:10b6:3:115::26) by BY5PR12MB3857.namprd12.prod.outlook.com (2603:10b6:a03:196::28) 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:15:51 +0000 Received: from DM6NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:3:115:cafe::36) by DM5PR11CA0016.outlook.office365.com (2603:10b6:3:115::26) 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:15:51 +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 DM6NAM11FT058.mail.protection.outlook.com (10.13.172.216) 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:15:51 +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:15:48 +0000 From: Xueming Li To: Anatoly Burakov CC: Luca Boccassi , Reshma Pattan , dpdk stable Date: Tue, 11 May 2021 00:01:16 +0800 Message-ID: <20210510160258.30982-127-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: 336a102a-a0d5-4ec0-a8e4-08d913cee141 X-MS-TrafficTypeDiagnostic: BY5PR12MB3857: 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: olNj0M1p5j4L4GVjX3BD9oP3HscCUP0mc6wZsn1sF0mzEQmwtLSr7/PRlJVdIY7Snnh0UwrFSiJ6a9E/hMrYZwCdo8vyga2jeVGo6q7u4aQsZE9Y7N1Gnwn1RCdyndx9V+h1sHQzyWFlubuRwBgq5jidEhxtsqI6OvNI2KC3jP33HderMhWPt0jl6LwlEmpsPyWH1ZuTsxwpWUnWg3rgZngYkVLj/i12bvr1tavsQaw6OZMJ7AmLUqwM5MjgbcIkGaYTI2V8Wg1hPFcrsx6TFItiRvlha/jWdYqGWzv64bX299w4Z8rSum3qcEEY+xTrHr/KHs+Cd8p3Jymelkz1ROKf0w98/4Sj4Xhhkooe9zPEq0LuTCp0GCz0A0SP+Gl2g+GwobpwnKrLefZvaKextCXAU1La41zcjdUMpJYEf0IVihvEI6Cb+XNiclgWrExitiB5pMHiMSxTG8XQjYlHUKU9XKm+Gu/jlcCZD8jBz+j1nOBeQWfUwryybt5WvHwKDMX0ABTgMLnMgAb6WpoEdYNE4ItPAxnGjZVu6BP8YU0Re0mK09dmYYJnxAE3imaiPzLSVPOVAGlNJI/Y1K0QKCi9nlKVhfa/Uwu1xACjJrFpCgy/6V4AC5gUQOqVckyt5L3dJT4McXj0RiyNiuXA6/Q/5AycdSVITtMEiXS/6QoAiWRFzjh9KZPeOpD1OKVSTvtw9Q0JtJrg63w/C0ZLju50+z7sW1zys+Ny8Wu89E/jLG/zoAS8ODTbK7F8pilOs9n6S9SzQ8ClLbsRPE1/gQ== 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)(376002)(396003)(136003)(39860400002)(346002)(46966006)(36840700001)(54906003)(6666004)(70586007)(47076005)(53546011)(2906002)(16526019)(83380400001)(70206006)(5660300002)(1076003)(4326008)(316002)(82310400003)(8936002)(8676002)(186003)(55016002)(86362001)(7696005)(478600001)(36756003)(26005)(426003)(2616005)(82740400003)(6916009)(7636003)(966005)(36860700001)(6286002)(36906005)(356005)(336012); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:15:51.1733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 336a102a-a0d5-4ec0-a8e4-08d913cee141 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: DM6NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3857 Subject: [dpdk-stable] patch 'power: do not skip saving original P-state governor' 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/8ee0fdee90d5f1b0ac9f398a6dd9ae872f44fa03 Thanks. Xueming Li --- >From 8ee0fdee90d5f1b0ac9f398a6dd9ae872f44fa03 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Fri, 2 Apr 2021 09:26:45 +0000 Subject: [PATCH] power: do not skip saving original P-state governor Cc: Luca Boccassi [ upstream commit 190f38773acffc5cc822f4347b38ce04257cd044 ] Currently, when we set the pstate governor to "performance", we check if it is already set to this value, and if it is, we skip setting it. However, we never save this value anywhere, so that next time we come back and request the governor to be set to its original value, the original value is empty. Fix it by saving the original pstate governor first. While we're at it, replace `strlcpy` with `rte_strscpy`. Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility") Signed-off-by: Anatoly Burakov Acked-by: Reshma Pattan --- lib/librte_power/power_pstate_cpufreq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c index edf6328e5f..dff9857713 100644 --- a/lib/librte_power/power_pstate_cpufreq.c +++ b/lib/librte_power/power_pstate_cpufreq.c @@ -350,6 +350,9 @@ power_set_governor_performance(struct pstate_power_info *pi) /* Strip off terminating '\n' */ strtok(buf, "\n"); + /* Save the original governor */ + rte_strscpy(pi->governor_ori, buf, sizeof(pi->governor_ori)); + /* Check if current governor is performance */ if (strncmp(buf, POWER_GOVERNOR_PERF, sizeof(POWER_GOVERNOR_PERF)) == 0) { @@ -358,8 +361,6 @@ power_set_governor_performance(struct pstate_power_info *pi) "already performance\n", pi->lcore_id); goto out; } - /* Save the original governor */ - strlcpy(pi->governor_ori, buf, sizeof(pi->governor_ori)); /* Write 'performance' to the governor */ val = fseek(f, 0, SEEK_SET); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:29.890837800 +0800 +++ 0128-power-do-not-skip-saving-original-P-state-governor.patch 2021-05-10 23:59:26.520000000 +0800 @@ -1 +1 @@ -From 190f38773acffc5cc822f4347b38ce04257cd044 Mon Sep 17 00:00:00 2001 +From 8ee0fdee90d5f1b0ac9f398a6dd9ae872f44fa03 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 190f38773acffc5cc822f4347b38ce04257cd044 ] @@ -17 +19,0 @@ -Cc: stable@dpdk.org @@ -26 +28 @@ -index c4639e4b8a..1cb0e4d917 100644 +index edf6328e5f..dff9857713 100644 @@ -29 +31 @@ -@@ -382,6 +382,9 @@ power_set_governor_performance(struct pstate_power_info *pi) +@@ -350,6 +350,9 @@ power_set_governor_performance(struct pstate_power_info *pi) @@ -39 +41 @@ -@@ -390,8 +393,6 @@ power_set_governor_performance(struct pstate_power_info *pi) +@@ -358,8 +361,6 @@ power_set_governor_performance(struct pstate_power_info *pi)