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 44DC842967; Mon, 17 Apr 2023 06:33:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 34DB6410EA; Mon, 17 Apr 2023 06:33:54 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2067.outbound.protection.outlook.com [40.107.237.67]) by mails.dpdk.org (Postfix) with ESMTP id 039C440DFB for ; Mon, 17 Apr 2023 06:33:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E3oSQGUC5qZRSySzuSctGluaYPhqLnLxOVcKrfSTCJ131NVvJSnUWEd1XuIqPU83YJ6kArss30wGrlAxRPwqNiygR39u5RaWPiQE+F93j/1W/mgMJpJSDGb7jBxMyy8wKnJk/RLaRMxxEW1rsRSp/j85ttU/vCAH0HhiIpcsGrdYq1pnd1JPcPcLe3J9kIn7mfWS/IUoYX8N7c00lCgbjALZUIlp2AtJqH9jvRI3sqasms7/I/bJE6+8rMeGUmn+/+XoPCFFkZlP96pC60WMeTzoxQ4Pqdqn7CwJukHG+2REI3v4O8/9lgR80cyM+vEiT8UhuZdbu3wFR5pMaTQ8zQ== 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=BScFHtcvPmQPU3hVqgm5m/vGm+GaQdpJ4QdYxik463k7NCFrr79wfgER1uLZDGULLoguq8b7G0IeRz8wFbbL5e+Y2YijbHQ6zNR4C4zFA7cPMbE18mSqquorh7TddAF97PmD+hGCk/AURIO3CwXlHCLLIfdp2oWYUjJxWh9W0p6gG/tNu9p15qOUPc1hAw9agqY1bnHLXN+xEKKxRj4dUeObUZ8KpM0uk0bwyZWAvvk1ypEYlizq+yWyTWlTwIzphzX4ikzU9ZK5DLNK5xEP5bV4/Jc9j5FeoznYe74S792Y1oShtxgupX9NAatDWImm5pjFaNZGWnLSzugRd0g1rw== 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=0ESnyLr8VXSfz5MdduwWph+I+tqQ5Nl27yYXoOQ8DydiE1clYTUKpcijbsSMhrPgD07czjlVuB8tjxjEanchtDcTja9LHX7jAVtmN425fmEMYuoNhTjfdzml4mkXE+UFVO6jzNodW2H69sfqKxleTSXIPklmetYEdb6XW0BhUMc= Received: from DS7PR05CA0096.namprd05.prod.outlook.com (2603:10b6:8:56::28) by PH0PR12MB5466.namprd12.prod.outlook.com (2603:10b6:510:d7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Mon, 17 Apr 2023 04:33:48 +0000 Received: from DM6NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:8:56:cafe::68) by DS7PR05CA0096.outlook.office365.com (2603:10b6:8:56::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.19 via Frontend Transport; Mon, 17 Apr 2023 04:33:47 +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 DM6NAM11FT064.mail.protection.outlook.com (10.13.172.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6319.19 via Frontend Transport; Mon, 17 Apr 2023 04:33:47 +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; Sun, 16 Apr 2023 23:33:46 -0500 From: Sivaprasad Tummala To: CC: Subject: [PATCH v3 3/4] eal: removed unnecessary checks in x86 power monitor APIs Date: Sun, 16 Apr 2023 21:33:33 -0700 Message-ID: <20230417043333.470153-1-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 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: DM6NAM11FT064:EE_|PH0PR12MB5466:EE_ X-MS-Office365-Filtering-Correlation-Id: 563964f6-34c7-4a41-2dc0-08db3efcefc2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l+kKWm86oS45zlfakMMcP89ffOZjD9/079dSjXjwKSAGVHxA8uVksKypBLlj1REZoiWZIQ3xtS/VdWpG8TesglQG46OsWYWh0Sn5i/rMmTwa4Q0eqd7Fyxr0N5g/+uVS7MHTqWWOM7RUNrH3TANpCaEObG1MMMKPRQaEay6CHDG0bkbjbAmpoWdissfJKp6D8P3kC4EfG4iyYyBaAv+ml8T3wnhfEtbGfMDalmKmGh0W9qdKIxy7HkmVbUBrc/q3G4nsimamvuw49ucXK7GmbCGdcoqKeK5FFgJM41JJ8EZGAsKKC2766a0vUd9jgyu/e+oIT+elTJpdqC0LPW8wCUamrxoSmFb9MK4bL72kXXh/uXj04Cfkia90yRIubCk9+fcWDu339UazwU0gN7sWkmYkzMMGYHr6aKzZ5XK5ePbXE8GbmZVQkP66B+sVN9C8yI/aQf9pkySKmUJ/6eTkuK//aVM6AyDW7Evdktvdw/ZVKKMmTxV+ZF8pY80h8+SjgS8uo6LyrcmoHWBoI46Y4/SUxe+2HGpS51bnZ9OXDLapuqBlH0t6Q4c4D6lA5i3tqw53yPCndyZSEGOVFMiVURkN5A4+HGHU1KUde/pjn8ndm2kyUFLjpuCJrezC1b7cfGlCXhrBva45C2+kMdxhOEppwHRqgdWZ1V7TmWEkJHjX2QHUgUtMFqdAL4IlsuPVHvKlBRBnehv0qL8DRKSlpJvZRULpXuTpBH30u9NA3X8= 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)(396003)(376002)(136003)(39860400002)(346002)(451199021)(46966006)(40470700004)(36840700001)(36860700001)(2616005)(26005)(1076003)(478600001)(82740400003)(70206006)(70586007)(47076005)(83380400001)(316002)(7696005)(6666004)(186003)(16526019)(336012)(426003)(6916009)(4326008)(8676002)(356005)(41300700001)(8936002)(5660300002)(2906002)(81166007)(44832011)(36756003)(82310400005)(40460700003)(40480700001)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2023 04:33:47.7436 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 563964f6-34c7-4a41-2dc0-08db3efcefc2 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: DM6NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5466 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