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 AE6284233C; Mon, 9 Oct 2023 16:06:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56C2940A76; Mon, 9 Oct 2023 16:06:09 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2071.outbound.protection.outlook.com [40.107.243.71]) by mails.dpdk.org (Postfix) with ESMTP id 116B940282 for ; Mon, 9 Oct 2023 16:06:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JF0jNOMKv4RxSku2VFOH82ohshoT4iSuFiHaXCVvhQ+CKHBvzkXbL2Gt65t1lVrbJuvpizqfF93pRDqM0twPFyJ/MWimPMG0HmcvY00mNE5q3pEdlVVFTbe9cwofroIg7i3EzrhStrX/wRlvSPogVWvxGN0BDMeCGGCUzrkf0rSzCSKqxXDSgrpWKyr6BCmBuvqy6K7H4cXuoMoUfkZ4AFJjGpPbSSC2dI00ngwRJbRb2piqKpnbHcoE2kxCk0MOJGPwViJPwA7WDX5mnHvkIjB8qjZcuuoc+USnplW48an18tJeGRMddCXmS+XDyQrRHT22jKx2TnuvpcqnMKw3fA== 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=vocRWzP8WIs+96eRyvcwmPHHOywPGqQgeuhFZ9r+jlU=; b=jr4wucUUjR0lJZ9IzcPkWaqZTKbWwzw642u1XVnpcATG7oqWvHuIfyGiJ2rG7+H6eYEvmf/il6J/nu1gIv1tZapg/2adq0Qyx5XeEjFsP0dUdWQfu/ItxXe2VuyV+xX8uhD9pmBCtIyr0QNNdOpRjLowr9LdTtmUG0/tQf3PJ1vRTFbkrHhdFg6mTle9QjHV+fjNaawd8nQJxWERiQZVAvsaWgX1T+lt601/7xO2w82nnRnPk2TXM3aYOHMiAhhYKN7YugtxA+Fo9flWEGtf0yxk20mCPjQob5f6iBmtx0LA3Dsnb4ljO3M1ToiIl/aM4fMoDzL0PJF/6BHOspSOHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=vocRWzP8WIs+96eRyvcwmPHHOywPGqQgeuhFZ9r+jlU=; b=U8YC3cJ4M0PsxkUQoN3u24KUkRYUrBS1j0H5Y0Ypk/6cuTpD8n64t41/QDb0ewSXeB2Vqeu8SHZ9/T631l2zHrWW1JGgJdjYhWLUiQ2AQkoxrJsWQr6dYxWDyRLEM9m+GXhjAyAE0sxxhaxnLWvuwoVrsmIgQnASyTEeOu2nJDw= Received: from DM5PR08CA0047.namprd08.prod.outlook.com (2603:10b6:4:60::36) by BN9PR12MB5276.namprd12.prod.outlook.com (2603:10b6:408:101::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Mon, 9 Oct 2023 14:06:04 +0000 Received: from DS2PEPF00003445.namprd04.prod.outlook.com (2603:10b6:4:60:cafe::e) by DM5PR08CA0047.outlook.office365.com (2603:10b6:4:60::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36 via Frontend Transport; Mon, 9 Oct 2023 14:06:03 +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 DS2PEPF00003445.mail.protection.outlook.com (10.167.17.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 9 Oct 2023 14:06:03 +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; Mon, 9 Oct 2023 09:06:02 -0500 From: Sivaprasad Tummala To: CC: , , , , , , Subject: [PATCH v6 2/3] eal: removed unnecessary checks in x86 power monitor APIs Date: Mon, 9 Oct 2023 07:05:45 -0700 Message-ID: <20231009140546.862553-2-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231009140546.862553-1-sivaprasad.tummala@amd.com> References: <20230816185959.1331336-3-sivaprasad.tummala@amd.com> <20231009140546.862553-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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003445:EE_|BN9PR12MB5276:EE_ X-MS-Office365-Filtering-Correlation-Id: 38c68856-c5d9-4d9f-afa1-08dbc8d0dffa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4dQ9sV6K3nFpn2TkT0IIzsf1qucJ5pgQV5BRwEewpmPPuHdoGiCKGnncNpeFGanZ/zHa8oyTbWqzhUU+fJsDWR5pRb14iv4+PfHqmztHnyK9YGPqKwrRYVnEj3AgKJu9SH4YLsMzNUuOsXr4bYs34lEvvqzV2Tm7kdwC2YMQWo4RiBNQm/HbQP3HjInk4jI2nXaSFkC39OhRRcYl9JoQDWSM9Cwz17+uBGCQAg8dBV5I9erH5nstzAy7uT6IGd2L0nhxD2tGVvKz6ucGg39CpjtRnCBGoALFsy9xFnkZ3s/7juXHFQp6xLovdBqxZ6AbWLu5465K9ZH9J19guNjw5qzIgcxQU1MM7+EHACqrgYIr+6x21eh1yli0kJqbky83OEiD1h3KQMnUzN0I9ik1Z7kJ5qtd+crO1PDUFK6KVJ+idEgq4gipgjEfxPE00lAijf241U68Famz4D7e8NilWE187BOp87ZWG5lINCAN5gqjaGT60KtrGSycJ6yztHtw0yW8i76AlKuNuuVhXoAYTSzP2EHelwiZPQjwbKEM9XGqTjNsoHr6rcUapXk54g83X1sdCv+9GDPbUweQXWIW5dpu6xJYPE8kq4STB6mPUqdXMEtufClazmvfrbc1NpHb/Otzc8QnKRv5tkj0AiIOJPaaqF8undFx0bExVkrY4m8CI8p7N6vkoSlJNkX6clKx6uxcJcStCtggg0UFGeifkRCfD+ipq3Hox7HEv2mZtKoD79b+uO6UQ/Y16b3284v+Tj42+jtZc/aGpy0yU/jFzA== 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)(346002)(39860400002)(376002)(136003)(396003)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(82310400011)(36840700001)(46966006)(40470700004)(81166007)(356005)(86362001)(36756003)(40480700001)(2906002)(82740400003)(478600001)(41300700001)(44832011)(8936002)(7696005)(5660300002)(4326008)(8676002)(6666004)(83380400001)(336012)(426003)(2616005)(1076003)(40460700003)(36860700001)(70586007)(6916009)(54906003)(70206006)(16526019)(26005)(316002)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:06:03.8620 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38c68856-c5d9-4d9f-afa1-08dbc8d0dffa 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: DS2PEPF00003445.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5276 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 1467a32cb3..664cde01e9 100644 --- a/lib/eal/x86/rte_power_intrinsics.c +++ b/lib/eal/x86/rte_power_intrinsics.c @@ -31,6 +31,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) @@ -82,7 +83,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 */ @@ -183,6 +184,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 @@ -191,7 +194,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