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 3FBC143085; Wed, 16 Aug 2023 21:00:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DDE542B8B; Wed, 16 Aug 2023 21:00:20 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) by mails.dpdk.org (Postfix) with ESMTP id EB34440693 for ; Wed, 16 Aug 2023 21:00:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MwUBgtOAvoyXxCHLV7NttoaKfUVHP9O2BrfjORAt1Hcy5r1OytG7WbUUnrnLTyVz/Y+weOhEkfYOLDhuYXuEBsySqy67hAbTFY6ucupkdspnEFXaJj62kgLPC4HJGwUTBBXlrC8MGQFlTWAN77uSSmM14eR66Rht3nnt1lK/p46RHo0jcfF+LP8Wn+TTNNZC4DBSXrYkG87HJ+Btswwj4AcfP8tl3jp4B2Befmhr/KQDE3m3s+lQsK6SvAbCtOVBTa6YzAqZCTKHfO0/PJQaED1nZNuAYMFxDh954kTvz2oKxEUOuM5IC7jydqMh++SfcGURfegy5iWt14NvRj3ofQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6E75zxbZI689GNE6cU6vqc1HTgyJeinwG5rHUIHrMrI=; b=LfdSywgIRXSec50wOHoiwXh7eaPDFm7zXmoS63xUSzO09lRVZI2zZtivOwjLlCKr5pLEb3Gw62rmQSmr5AnohUDjbW17olYkbGsjOSKG48WoYVTy3n51cqHXrtrkSIybkBHRNcTlW1T1WTAodJQWr8ECF2eQ9E5awv48xitc0HMMOFy94/PKPz2IExc/43XkJtyMBFhpOIzsXc23Ee1krTettLaDL6bmj9LTvmDVEU3KitEUwv7pT1UQQCi07PZ/MPkobQvT7br5tJYBwR6RxZf8qWj3/PeEaGsbZAdqW11D5OcyGhw8X2xaj++3F1vIEiefmVhLrxyMi0RJGSshUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6E75zxbZI689GNE6cU6vqc1HTgyJeinwG5rHUIHrMrI=; b=v9+SRQkgPoEPaOnCB1W4HfrPEUZJHldWfX5D2B6dvye+36X254f0XyTqbRwGM4tU0zsjRwa0A7u9AZmTrMrrmKQZ/xqdqwAU/08GMJoWDnBZDIV+lsiw81ecdf/pBpcNwnAvGbnHdv3R8jZx8Eh+NAmVQb49l9wDpHGLKfvnqEg= Received: from PH0P220CA0004.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:d3::22) by CYXPR12MB9425.namprd12.prod.outlook.com (2603:10b6:930:dc::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.30; Wed, 16 Aug 2023 19:00:16 +0000 Received: from SN1PEPF000252A2.namprd05.prod.outlook.com (2603:10b6:510:d3:cafe::fb) by PH0P220CA0004.outlook.office365.com (2603:10b6:510:d3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Wed, 16 Aug 2023 19:00:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF000252A2.mail.protection.outlook.com (10.167.242.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.15 via Frontend Transport; Wed, 16 Aug 2023 19:00:16 +0000 Received: from telco-siena.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 16 Aug 2023 14:00:14 -0500 From: Sivaprasad Tummala To: , , , , CC: Subject: [PATCH v5 2/3] eal: removed unnecessary checks in x86 power monitor APIs Date: Wed, 16 Aug 2023 11:59:58 -0700 Message-ID: <20230816185959.1331336-2-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230816185959.1331336-1-sivaprasad.tummala@amd.com> References: <20230418082529.544777-2-sivaprasad.tummala@amd.com> <20230816185959.1331336-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A2:EE_|CYXPR12MB9425:EE_ X-MS-Office365-Filtering-Correlation-Id: 42e0a458-6a29-4506-08e6-08db9e8b0739 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hn1XuwllJ7HVV41/HPB6Z7Ic8RBtY3OoVKaikF9ojpUIWGgm+z71oiN5j5ijgb0w3gtvS5o9rWPpGO6e/gD5qpF5sJ2lxN3B6hNOyBHkK9reuTAwvrXoM/+DnRFzBHjEKt1dCjHqkVSSYM1azf/K7KZrc9FXjuLZjxG9ZZXIl/Jkv8NyJdUGD0SX1HQJSVmdL8kNgIQE6YSD5H/nk+nEAAq0PEt6nRJKXVbo0tA7kE7p1Tvw9CiKHBa7N7tC7szYRTaVDvbV5NYk6uEY035GAKqzH5J8sFrWad4Kt6ZXfspT6UvnIEvAYTx1t49sG2bGbiujiemmOEzJnUIQFWMZxAYZAxwVmt6NNgT6KCWCisrIZuv5uFRBqs4/OYmes8/oTDmsxfoh+qA56xQuLc+w4LPIbayVg/3+ZSPYYl88mtYcnLgN8Ve2eG/thGRPpAM9WoUzIXfEaWJ7bOJ07ALpFni/cAZk1ZpEa/OoW47Dr7mt6sxAQayYB2Fs+Y4SKRhY5UIaSEwFJsPFanI7PNGQHCAqKeOA9pWbw7Ht9TIQ7qWtT8mL5uEFW9BjDIN0TiKfwE20NvlPoi9H88AUEssNJoMKsmL69baiTUGiEgmT32CRwGEVnsucc4+BOfZcUlEVxzxXxTNT/JKFGzxzmFtrtMo/Bc2XuFXvPX+K0zUCqPzpjrzJPYmobhMaibsDmekSylHnXOnGKX++64MzTsfwdj03Z/MAD8+c8ZMMO75/fruL9Q+ewoV1H8fKhiZY+tKwC3eAPYMs9Ct12nP/aiO+Uw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(376002)(39860400002)(346002)(396003)(136003)(451199024)(1800799009)(186009)(82310400011)(40470700004)(36840700001)(46966006)(316002)(356005)(82740400003)(81166007)(110136005)(70586007)(70206006)(5660300002)(41300700001)(36860700001)(44832011)(47076005)(8676002)(4326008)(8936002)(2906002)(40460700003)(83380400001)(26005)(16526019)(40480700001)(478600001)(426003)(336012)(86362001)(7696005)(36756003)(6666004)(1076003)(2616005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 19:00:16.1409 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 42e0a458-6a29-4506-08e6-08db9e8b0739 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9425 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org current x86 power monitor implementation fails on platforms with only monitor supported and not power_pause. Signed-off-by: Sivaprasad Tummala Acked-by: Anatoly Burakov --- lib/eal/x86/rte_power_intrinsics.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/eal/x86/rte_power_intrinsics.c b/lib/eal/x86/rte_power_intrinsics.c index f749da9b85..6eb9e50807 100644 --- a/lib/eal/x86/rte_power_intrinsics.c +++ b/lib/eal/x86/rte_power_intrinsics.c @@ -30,6 +30,7 @@ __umwait_wakeup(volatile void *addr) static bool wait_supported; static bool wait_multi_supported; +static bool monitor_supported; static inline uint64_t __get_umwait_val(const volatile void *p, const uint8_t sz) @@ -81,7 +82,7 @@ rte_power_monitor(const struct rte_power_monitor_cond *pmc, uint64_t cur_value; /* prevent user from running this instruction if it's not supported */ - if (!wait_supported) + if (!monitor_supported) return -ENOTSUP; /* prevent non-EAL thread from using this API */ @@ -170,6 +171,8 @@ RTE_INIT(rte_power_intrinsics_init) { wait_supported = 1; if (i.power_monitor_multi) wait_multi_supported = 1; + if (i.power_monitor) + monitor_supported = 1; } int @@ -178,7 +181,7 @@ rte_power_monitor_wakeup(const unsigned int lcore_id) struct power_wait_status *s; /* prevent user from running this instruction if it's not supported */ - if (!wait_supported) + if (!monitor_supported) return -ENOTSUP; /* prevent buffer overrun */ -- 2.34.1