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 05DD54297B; Tue, 18 Apr 2023 10:26:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB0A342D12; Tue, 18 Apr 2023 10:26:01 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2077.outbound.protection.outlook.com [40.107.96.77]) by mails.dpdk.org (Postfix) with ESMTP id EDAD740698 for ; Tue, 18 Apr 2023 10:25:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cOre72GcdbnsaTf7A5Rr+2BBTX5zqKM2CgL1uITz6wBajSKXl0MU6AQlpQXD1r4sAUt+6xdeSPNV8VUkKwMVUBIokQRAVcDEKSQmFNG8OnCc8uYry2JM/u/7R/d+0kkKTLLkY7ioq7cQKPDHlspeaVNIOU+Fi+R0DMqUPOzYV1o//Y1sQfLtUnylltRmEk5PygFER18T2KUt84WDoJmYwjU2MNeNDNDgdMrfx7Vhyf4kxtH2paF4bIKUa2HXD8gJ8G+47ZAjQ8K0WZSCfT5yvHp+yIrY7oAi6Hai2rtJyp5ohkUPVCL/N/tdNrOthHVJVnb+U6p+Z5mQff8vA4xhCw== 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=/47gIOdB443xbyKMCwhRGd49jCfvw7aIQx2/gaXe+A8=; b=dpGsSg5/klFWH1h9J8Hi8U91Ujqj9onpetS0DvyfBDrKeKbXaKo7txP1DO941Lr2lf4LFwAIXIZV7PB8tsnASr/kzrFbigCoehx8UyeTC1De/Q+3yQ+yHYEPFQivZ2uLsUO0xmngEtslTxZwosfesw5Xd2Ii314P+lqGukfQVNeQjj0lQhYfFb9VwA3gBs8vEKv3hcst7/wQb8dV2xDUnOl2tZrTKbV42EqUtW1ZoblIzr5OF3iXmhQVv5UBz5xiOzNBewf9lCdoll0wkeBLP4Co4tZZg57XWxlLaYPhmbkkwKWSLeJTQvu4gvxVBX01O6M/SPxojqHVI+rKoq950A== 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=/47gIOdB443xbyKMCwhRGd49jCfvw7aIQx2/gaXe+A8=; b=p8b7d4jtI7gZ3CaVkbCXbq8W9Wfxr7GeyBVA1O1trfMd+UQS7NUVB0GEU6Qaf5hnbG2jxaC88VmKkndMjspWn5p1lya564eDa8/RGWST38nstnDSb1towj/VGSxglzOSa1DXR4aJgRwY7A/qBjtknUqHUVKJ9XYCs13muiIkq+8= Received: from BN9PR03CA0272.namprd03.prod.outlook.com (2603:10b6:408:f5::7) by DM6PR12MB4895.namprd12.prod.outlook.com (2603:10b6:5:1bc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 08:25:56 +0000 Received: from BN8NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f5:cafe::d0) by BN9PR03CA0272.outlook.office365.com (2603:10b6:408:f5::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.47 via Frontend Transport; Tue, 18 Apr 2023 08:25:56 +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 BN8NAM11FT053.mail.protection.outlook.com (10.13.177.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6319.20 via Frontend Transport; Tue, 18 Apr 2023 08:25:56 +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.2375.34; Tue, 18 Apr 2023 03:25:52 -0500 From: Sivaprasad Tummala To: CC: , , Subject: [PATCH v4 3/4] eal: removed unnecessary checks in x86 power monitor APIs Date: Tue, 18 Apr 2023 01:25:28 -0700 Message-ID: <20230418082529.544777-4-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230418082529.544777-1-sivaprasad.tummala@amd.com> References: <20230417043136.470110-1-sivaprasad.tummala@amd.com> <20230418082529.544777-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: BN8NAM11FT053:EE_|DM6PR12MB4895:EE_ X-MS-Office365-Filtering-Correlation-Id: d3844ba9-b1ac-43ac-e921-08db3fe68861 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VosXStP5+aVO4Xe4UYOIWuHQo6O0iBQn2mdAvAxvE3N/bAy/SyopbtQAOVlnKH8zN4kUR3bq8kXeJB+2DPcCt4JhIpsVjwSeH3dp/TTB/wX/UwwFhKppUcoaEqSh8joypKVz5eE/ivhp3dADRpa7OnCRoxJD05V2x3wXNyU5uid8j1QjXPiItR2vfIPJ7ZAyZCoiN0Ffh5rSRdTt2yfC+zfcTBClam0+x9DNPXHrhIPWVcjtTyunAlRWQTPrMMxHJH5ALUwAmNp18IB1d8n6AzljHiBcc/eIEwNF9fkQuszehX3Hx6oTjeo+z4vo2Xl001e0EvImAPWr9od+cHn9myFNAWLBIlWvHXlRCtZXdYxo5uDdOj6jR7nt7OM4GYK9wGfGJB9XrXj5sbHnUlRECck/3J0EmCeFKjF7T2Rq7KMV0PMq8whaxpkwJWVyryzHo964cFgpOCZCVpup/wp7ci485prCK0NTnG4wEzUp8MfrR1QJYWqq89+tGT9QVc/5mXRh8N0QkIcw2KZ43Y5mtQ8yOdMs3RDpjzZ+V+ULyYD1caGPaEPd10U9Z0YChF6Y+sN3hKeSz9APXBIXwTTvVd/wOSBg3fLoCuHO4tLmVSygYJLgZhNcRV+rsWBWOUItBy1VeuwjzeruKKQt7OUP8vj/Z2EcK5Sy6p7IFaV36tofnh6V1c7qeC0Ku7Es5EKD2M7km5VPFl4CIr11MC+vpDQSPouNTmpq1mcVXp+58Hs= 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:(13230028)(4636009)(346002)(136003)(376002)(39860400002)(396003)(451199021)(36840700001)(40470700004)(46966006)(36756003)(8936002)(8676002)(40460700003)(44832011)(5660300002)(2906002)(82310400005)(86362001)(40480700001)(478600001)(7696005)(6666004)(54906003)(16526019)(186003)(2616005)(36860700001)(1076003)(70586007)(70206006)(26005)(41300700001)(356005)(82740400003)(316002)(83380400001)(81166007)(6916009)(4326008)(47076005)(426003)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2023 08:25:56.5734 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3844ba9-b1ac-43ac-e921-08db3fe68861 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: BN8NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4895 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 --- 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