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 5C0CC45665; Sat, 20 Jul 2024 18:51:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C75E4068E; Sat, 20 Jul 2024 18:51:12 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2057.outbound.protection.outlook.com [40.107.94.57]) by mails.dpdk.org (Postfix) with ESMTP id 4EBD040A7A for ; Sat, 20 Jul 2024 18:51:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ATlIGhddxlDt2PkRqyW7jPZCkU811wbwCmdNK6v6zwgu9NbDwKBA8PNwJkbvhFSvaY3/0dYmCZRgHZbYjoCuj39xgZ1b7kHbw2VqvpkcXeUYSQghNJYAD7a+vIEhykuD+rA85i3m/hRedIQFpmHEK0rUtc5BpBEAtlPp2297/OxKK1LVaj0dzQPrhgAOGn/aWJifd7DVVpmNSq0MfzI5eU7Tql4EtLVw1khmuJPXvmjyHwy+23p8BR6Miip+fz82XqkS5Jt3YXdAAgooxD3isqiPU22MRBHl06xktWq73Lc3Xq4zaOVBsaw1gt71p9vdIcoI1sMDHuZHGycQlcf3jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=KMdti4oCWIaejQ5mitD0EbyTSmeiPTSYYMMIhC2j45s=; b=knBDa7pYblZt/OKsLQP2ri6t9Ls3+MRzO1whp0AIjNQFhWBR69C9anoMNzkN1dysWcAsyL1DNV0b7Ht0QC6x1ADlD5BwCkj42pWNSkcDEjzekOhSc77F0KKNtWShqiM6Tye0MDMv9aPOkOiVPQjif7fBIkO7WIU6jQsPeLHNkuVOtYSaPYJV1RPNOdE7hta5K6PZOsWY2YbyDJnfrDCywrXNl39xkFHD+lGCgWnQeRHdwUTeBLDsAEgG6+j+WXvWWMLGRhEOjYcwgABh3kZDM+AHtzemOdbTATvSB1DzijgOJPQD4+x1Jupx5fuYB5l3gy3hlR7uQAV8Jz0UqUoyFA== 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 (0) 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=KMdti4oCWIaejQ5mitD0EbyTSmeiPTSYYMMIhC2j45s=; b=eyLL/TWUFbTMNYTfD6zvQv2Ue5zzF6y/bn3hzW01gVmxIe8indjLO9FRhGelX485EODOta5aKW71Nq86EsztiPtHTyv8rWTijiP9Urqojwh6EJ1T3qVaAJA7T7NMMSP2XJweBlM4+aTXgb2HKnxCHnNnDF2WLHRW0WvY6wj0YYg= Received: from MN2PR18CA0016.namprd18.prod.outlook.com (2603:10b6:208:23c::21) by SJ0PR12MB6807.namprd12.prod.outlook.com (2603:10b6:a03:479::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Sat, 20 Jul 2024 16:51:04 +0000 Received: from BL6PEPF0001AB59.namprd02.prod.outlook.com (2603:10b6:208:23c:cafe::70) by MN2PR18CA0016.outlook.office365.com (2603:10b6:208:23c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20 via Frontend Transport; Sat, 20 Jul 2024 16:51: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 BL6PEPF0001AB59.mail.protection.outlook.com (10.167.241.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7784.11 via Frontend Transport; Sat, 20 Jul 2024 16:51:03 +0000 Received: from jfw9ny3-os.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.39; Sat, 20 Jul 2024 11:51:00 -0500 From: Sivaprasad Tummala To: , , , , , , CC: Subject: [PATCH v1 3/4] test/power: removed function pointer validations Date: Sat, 20 Jul 2024 16:50:28 +0000 Message-ID: <20240720165030.246294-4-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240720165030.246294-1-sivaprasad.tummala@amd.com> References: <20240220153326.6236-1-sivaprasad.tummala@amd.com> <20240720165030.246294-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: BL6PEPF0001AB59:EE_|SJ0PR12MB6807:EE_ X-MS-Office365-Filtering-Correlation-Id: 38f59ae8-8e19-40a2-bbb9-08dca8dc2435 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ZXTH0SHah8PLUD7fek3BsdUvSMgdOTURLD9z2HbvWp+usYb+bouAHS2xzEIj?= =?us-ascii?Q?DZr9mTeuhdQG6h7oEsndA+tas5Kz0ORrRfH/T5llIp2iY7K41SXpqKAQDh9M?= =?us-ascii?Q?TmAMRR1zh/oSwYL6pBiMrQmD3Jye9kfWcT/XybHUbS8Qy6W7J+6s4YE18uwY?= =?us-ascii?Q?boQedDLlTQdKbqq4/EaljEAiJ0WURjyuavhARSGk8J5qR/khT7KViv7N+Vet?= =?us-ascii?Q?6mVi5ZvY23tE4FvTE8H89HmVBw8TxTThWWroa2EBotrglOkY9YOiNQGCYkEn?= =?us-ascii?Q?c/V5qa84X1IE3vTxHT4H3WoMRqIJZPQlkNH6btOiSBDOtjbaVPU20rpX8tTg?= =?us-ascii?Q?ua3bbGe6elPaTAqKOmGjnRvow1+0h496XS4CX/TDa3b6sXFeP/JSnrDQyx1y?= =?us-ascii?Q?ZaGWcl6PPuhKRAVJOQ1KZq2wS1Hg4sUDJnTifj9gaXOcqUUYdKLjIKbfasUB?= =?us-ascii?Q?9cIG/KoCo1b7KsDpc32sd+q0pOkIg19H2ycL2vYoNykM8O5M+FGgmxfQjONh?= =?us-ascii?Q?13RlaMLx9TVSVXJDP6OCQgsY4oEiNa7J46XsE2/v4CbtGU7xSrJOzSWwexWO?= =?us-ascii?Q?oTnO8MQiD8lB8u33+dkpvwE789U+8v8ZVJNcR/5Rt2BUSfNS4sctN8q7ghLe?= =?us-ascii?Q?9I0tRMpui8ViJ28ZqAKKlleUxH14EMEwCy7MGRwsn1vJn8vsWqo+dFIpRNm+?= =?us-ascii?Q?cBmiKFV01deBJQdqzfNf20+iQohRA3rMxg+xZkqjOF2nFv65K8JEfb9Y1hgT?= =?us-ascii?Q?uPS+1BZBCm0/E9lzsTiT1fjcKQijqCgC6UgeUIA5djUPwatB5cdRhpwayeNt?= =?us-ascii?Q?vdDlgEwgnSevuj5WoQDl3UNOlk+foNekU5KGXbtYJLxGTUaM82YTfqFQN3HM?= =?us-ascii?Q?7hqRMHQUrSuP7dKmarsblozWQDuZucBQ4Tu2HmB0BAJJ68Fu7DFSgKs3BjqC?= =?us-ascii?Q?UKVT8KcwjhUFyfFg3Q0Thde4HA/Xc3e+r5DwIS4eVZoFsTskwmRBJWcRVB6a?= =?us-ascii?Q?9xzOUgjyJ8u3LZOKO6aHHDqrslJ2gJPlW49Dz/IYxykdRlTI9AWpSZply4Wr?= =?us-ascii?Q?hcw056QsvdLt6Jw1tRRJZY1uUwa4dJBy4GffQArWLZntlwTpL79QjX1bYr4R?= =?us-ascii?Q?INHXCClZx5t8KdL3vFZRSh7YoxTB8H6LcutRkQcaeDJr6Dzv5nXA83YvwAOE?= =?us-ascii?Q?z2OH4fKwSAFbQlozn9D8LtCif6Nq/qYh9br5el7Ig03KvPx1pBsoQhE/CvGp?= =?us-ascii?Q?CEdCBS0E88vNdt62AJrmld+lvEMt0X6KV1vSaNJFqyXOEWdFei5fCr3E9/a9?= =?us-ascii?Q?kPZlv9mh4QytO3xcR0jq9i/pLnJHrTjZSJ6DKPNmbKKxyaK74MYjBlmi8a9n?= =?us-ascii?Q?243HYwCjqtxu2Kf9JTdCPoY3NSConY/S9RKU1dOStk1i5jZEVikN6zc0mvfo?= =?us-ascii?Q?ZFaouIdg3RERRttDY6wxiUtmPvVJFZ1I?= 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:(13230040)(1800799024)(36860700013)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2024 16:51:03.2915 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38f59ae8-8e19-40a2-bbb9-08dca8dc2435 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: BL6PEPF0001AB59.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6807 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 After refactoring the power library, power management operations are now consistently supported regardless of the operating environment, making function pointer checks unnecessary and thus removed from applications. Signed-off-by: Sivaprasad Tummala --- app/test/test_power.c | 95 ----------------------------------- app/test/test_power_cpufreq.c | 52 ------------------- app/test/test_power_kvm_vm.c | 36 ------------- 3 files changed, 183 deletions(-) diff --git a/app/test/test_power.c b/app/test/test_power.c index 403adc22d6..5df5848c70 100644 --- a/app/test/test_power.c +++ b/app/test/test_power.c @@ -24,86 +24,6 @@ test_power(void) #include -static int -check_function_ptrs(void) -{ - enum power_management_env env = rte_power_get_env(); - - const bool not_null_expected = !(env == PM_ENV_NOT_SET); - - const char *inject_not_string1 = not_null_expected ? " not" : ""; - const char *inject_not_string2 = not_null_expected ? "" : " not"; - - if ((rte_power_freqs == NULL) == not_null_expected) { - printf("rte_power_freqs should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - if ((rte_power_get_freq == NULL) == not_null_expected) { - printf("rte_power_get_freq should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - if ((rte_power_set_freq == NULL) == not_null_expected) { - printf("rte_power_set_freq should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - if ((rte_power_freq_up == NULL) == not_null_expected) { - printf("rte_power_freq_up should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - if ((rte_power_freq_down == NULL) == not_null_expected) { - printf("rte_power_freq_down should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - if ((rte_power_freq_max == NULL) == not_null_expected) { - printf("rte_power_freq_max should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - if ((rte_power_freq_min == NULL) == not_null_expected) { - printf("rte_power_freq_min should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - if ((rte_power_turbo_status == NULL) == not_null_expected) { - printf("rte_power_turbo_status should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - if ((rte_power_freq_enable_turbo == NULL) == not_null_expected) { - printf("rte_power_freq_enable_turbo should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - if ((rte_power_freq_disable_turbo == NULL) == not_null_expected) { - printf("rte_power_freq_disable_turbo should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - if ((rte_power_get_capabilities == NULL) == not_null_expected) { - printf("rte_power_get_capabilities should%s be NULL, environment has%s been " - "initialised\n", inject_not_string1, - inject_not_string2); - return -1; - } - - return 0; -} - static int test_power(void) { @@ -124,10 +44,6 @@ test_power(void) return -1; } - /* Verify that function pointers are NULL */ - if (check_function_ptrs() < 0) - goto fail_all; - rte_power_unset_env(); /* Perform tests for valid environments.*/ @@ -154,22 +70,11 @@ test_power(void) return -1; } - /* Verify that function pointers are NOT NULL */ - if (check_function_ptrs() < 0) - goto fail_all; - rte_power_unset_env(); - /* Verify that function pointers are NULL */ - if (check_function_ptrs() < 0) - goto fail_all; - } return 0; -fail_all: - rte_power_unset_env(); - return -1; } #endif diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c index 619b2811c6..8cb67e662c 100644 --- a/app/test/test_power_cpufreq.c +++ b/app/test/test_power_cpufreq.c @@ -519,58 +519,6 @@ test_power_cpufreq(void) goto fail_all; } - /* verify that function pointers are not NULL */ - if (rte_power_freqs == NULL) { - printf("rte_power_freqs should not be NULL, environment has not been " - "initialised\n"); - goto fail_all; - } - if (rte_power_get_freq == NULL) { - printf("rte_power_get_freq should not be NULL, environment has not " - "been initialised\n"); - goto fail_all; - } - if (rte_power_set_freq == NULL) { - printf("rte_power_set_freq should not be NULL, environment has not " - "been initialised\n"); - goto fail_all; - } - if (rte_power_freq_up == NULL) { - printf("rte_power_freq_up should not be NULL, environment has not " - "been initialised\n"); - goto fail_all; - } - if (rte_power_freq_down == NULL) { - printf("rte_power_freq_down should not be NULL, environment has not " - "been initialised\n"); - goto fail_all; - } - if (rte_power_freq_max == NULL) { - printf("rte_power_freq_max should not be NULL, environment has not " - "been initialised\n"); - goto fail_all; - } - if (rte_power_freq_min == NULL) { - printf("rte_power_freq_min should not be NULL, environment has not " - "been initialised\n"); - goto fail_all; - } - if (rte_power_turbo_status == NULL) { - printf("rte_power_turbo_status should not be NULL, environment has not " - "been initialised\n"); - goto fail_all; - } - if (rte_power_freq_enable_turbo == NULL) { - printf("rte_power_freq_enable_turbo should not be NULL, environment has not " - "been initialised\n"); - goto fail_all; - } - if (rte_power_freq_disable_turbo == NULL) { - printf("rte_power_freq_disable_turbo should not be NULL, environment has not " - "been initialised\n"); - goto fail_all; - } - ret = rte_power_exit(TEST_POWER_LCORE_ID); if (ret < 0) { printf("Cannot exit power management for lcore %u\n", diff --git a/app/test/test_power_kvm_vm.c b/app/test/test_power_kvm_vm.c index 464e06002e..a7d104e973 100644 --- a/app/test/test_power_kvm_vm.c +++ b/app/test/test_power_kvm_vm.c @@ -47,42 +47,6 @@ test_power_kvm_vm(void) return -1; } - /* verify that function pointers are not NULL */ - if (rte_power_freqs == NULL) { - printf("rte_power_freqs should not be NULL, environment has not been " - "initialised\n"); - return -1; - } - if (rte_power_get_freq == NULL) { - printf("rte_power_get_freq should not be NULL, environment has not " - "been initialised\n"); - return -1; - } - if (rte_power_set_freq == NULL) { - printf("rte_power_set_freq should not be NULL, environment has not " - "been initialised\n"); - return -1; - } - if (rte_power_freq_up == NULL) { - printf("rte_power_freq_up should not be NULL, environment has not " - "been initialised\n"); - return -1; - } - if (rte_power_freq_down == NULL) { - printf("rte_power_freq_down should not be NULL, environment has not " - "been initialised\n"); - return -1; - } - if (rte_power_freq_max == NULL) { - printf("rte_power_freq_max should not be NULL, environment has not " - "been initialised\n"); - return -1; - } - if (rte_power_freq_min == NULL) { - printf("rte_power_freq_min should not be NULL, environment has not " - "been initialised\n"); - return -1; - } /* Test initialisation of an out of bounds lcore */ ret = rte_power_init(TEST_POWER_VM_LCORE_OUT_OF_BOUNDS); if (ret != -1) { -- 2.34.1