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 8CF6CA0567; Wed, 10 Mar 2021 14:49:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC48722A65D; Wed, 10 Mar 2021 14:49:22 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770053.outbound.protection.outlook.com [40.107.77.53]) by mails.dpdk.org (Postfix) with ESMTP id 4BA1F40687 for ; Wed, 10 Mar 2021 14:49:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MN9YS0S7Np623Vkp68n55UP9kKidwL0jP4LHnl/a0Ka/DLIUIG3oFMSydRi4GSV+tFlmDrpatN22C9foxr+ZCGCBtBvKvfD0q96iQmSOmCIqNswRwyjNVS/VdhQElICIL9MVptG1lETja4dk9s5Q3OGxkvjU4wl2XNdZMAdms66Q6ahWvda15IvUh3273WlOTxO8cbO4JWlffqKxL/cyhIPBhozXOzcZmL1y9+IzDdl198B2tmNlxBKTEg+mXoSp36IZRpAiQNxJkOR9yieVtK53lwIqSm+tEh6Zeu6x4Wr5C0s0di0+PUHoNGISXR3PAsnyN7sGa4RXyHoHLktwqg== 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-SenderADCheck; bh=kHzuYpqhDFPLbS8TFa0kQ2R70un0RICthcjLlHQinYQ=; b=aO5EYGrTxiWNNoc7S6B88cBaRFI5qoCiwqJ1fw6W3pxo63Z5lIpq0cqaDeF+sD+J7XHMVjOtotAp6L9h1cL/dlBly7iexbsY/MgaOmfMeJN2+6E2HkoqMsfwjZkOmK7Hko2YpV1YtWsDTm3JNK3xmyg4yIJoPbNMH+x0NoDhQ34dVaOByBx3ROsxkYlhfJI0wssuMEzkomzZThy9av0FlA5KQXH3oMRTpRKTEDR2ZZ2LuSLSPZPZwDGKnQ3TSyoJA8kBANpNgYHYIPiC+vGcyf9/BJt6WYNJEiSiiP9ymRtTzUTZ0Vs2q5QRkHGxirsIfOUih1NZn6ZH5iR67KOlpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kHzuYpqhDFPLbS8TFa0kQ2R70un0RICthcjLlHQinYQ=; b=V2h5Q9bSdFINTPmdDZIHILcVESSZseQh7AEq7ulBU5NJxpHcHtqeTAmZm/zq/lWReU6efm6J6Byu7I8Tdnt11jQQqenBPT+T25SnX9YgJD4JWghF+JV/Wsb0Q191YrRqictsifqprwiainDdeks4flG0A4gRRZcu+qn/5gXYlzb7AsKoNuBV7v6ZKOdA59WSl8RabtJTej7Di+xWZZ7tIlfpGB9un1Ka5o/O3hCgLy+HCSJJFumn4l9K322OmI/vDRGkKSLXoEORioKxiJcEQTEG1nWFccuy+Oxes55AlxeScrSN2cFaxa76qUx59WP3ZLxR38AsH596sQr9fSlayA== Received: from MW4PR03CA0052.namprd03.prod.outlook.com (2603:10b6:303:8e::27) by BN7PR12MB2755.namprd12.prod.outlook.com (2603:10b6:408:32::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 10 Mar 2021 13:49:17 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::f0) by MW4PR03CA0052.outlook.office365.com (2603:10b6:303:8e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 13:49:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 13:49:17 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 10 Mar 2021 13:49:15 +0000 From: Wisam Jaddo To: , , , , Date: Wed, 10 Mar 2021 15:48:52 +0200 Message-ID: <20210310134858.8104-2-wisamm@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210310134858.8104-1-wisamm@nvidia.com> References: <20210307091202.586-2-wisamm@nvidia.com> <20210310134858.8104-1-wisamm@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 321786b1-e4da-4017-b8d1-08d8e3cb4c8f X-MS-TrafficTypeDiagnostic: BN7PR12MB2755: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1051; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JrOtbLq4DWJmPYumuPkBjotwJ0E2ocuCQebrgXHQF+2D3HOjyLkjynKIW+l0YK2JTxE885AXoMK6Vm+f9XQIhJnj7qMhklPSxcqjzg9O9aNFVLH9gYQrYNIijCv7NRfhPTmQueRuErYNJQ+S6IgGwOmor7PNm3FbrdEIhd2OSgZOpCSGyp+I60N0XDaejU8iDd491RB7uZM3BfkWrOWOTvX7cursIgOgaoU3ZbLRS4ornjehvWlqGUfu0h54xOcbYiTrehCOhuuS8ofoERt6FMGYPhb9s3u6LIkOtJiUaBzJiYZFurwHo0qkEgx+Nko5o0KMIJgF1cze9kP09FmyR7wxcreXQxFHpKlASBZgdz6WQOQC/2fDTf/xbFXOaqa2XXBeY6l64vRC+pJIjrcuaEBjy01iFO7sQZCEDnyCNGwFyotZ6/VWCD9i6Zb75LKG3cgCfeFmbrvmTQQnYMxt1w2ty0Xg7NFpC3L5BtJDnRPNCX2bRlNUu6dGUsHXGayqBVOXeoV2X8A7BNE/rL/AzIaObGQr/4Xwz9szlPjY6MK9FGOKnk8ISTbol5ItPNx2yMZeqf7y7z7pxcwZutORZRYXgJe4A4vp8vvf+ixGRAqDlXFkTQYE7G1p6YHmQqjUZYlP8BBRuYV22bsrRk0GJRVO6CmXi3/M3SEa3WQ/sw6Bi+qWU+vV/JLNUq0K3PV6yNEPXBTSyyN3xQucQtkwiQ== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(39860400002)(136003)(346002)(396003)(376002)(36840700001)(46966006)(336012)(5660300002)(55016002)(1076003)(36756003)(34020700004)(82310400003)(36906005)(6666004)(8676002)(86362001)(16526019)(8936002)(83380400001)(110136005)(356005)(70206006)(26005)(426003)(6286002)(478600001)(7696005)(82740400003)(186003)(36860700001)(316002)(7636003)(2906002)(2616005)(70586007)(47076005)(41533002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 13:49:17.4139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 321786b1-e4da-4017-b8d1-08d8e3cb4c8f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2755 Subject: [dpdk-dev] [PATCH v2 1/7] app/flow-perf: start using more generic wrapper for cycles 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 Sender: "dev" rdtsc() is x86 related, while this might fail for other archs, so it's better to use more generic API for cycles measurement. Signed-off-by: Wisam Jaddo --- app/test-flow-perf/main.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 99d0463456..8b5a11c15e 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -969,7 +969,7 @@ meters_handler(int port_id, uint8_t core_id, uint8_t ops) end_counter = (core_id + 1) * rules_count_per_core; cpu_time_used = 0; - start_batch = rte_rdtsc(); + start_batch = rte_get_timer_cycles(); for (counter = start_counter; counter < end_counter; counter++) { if (ops == METER_CREATE) create_meter_rule(port_id, counter); @@ -984,10 +984,10 @@ meters_handler(int port_id, uint8_t core_id, uint8_t ops) if (!((counter + 1) % rules_batch)) { rules_batch_idx = ((counter + 1) / rules_batch) - 1; cpu_time_per_batch[rules_batch_idx] = - ((double)(rte_rdtsc() - start_batch)) - / rte_get_tsc_hz(); + ((double)(rte_get_timer_cycles() - start_batch)) + / rte_get_timer_hz(); cpu_time_used += cpu_time_per_batch[rules_batch_idx]; - start_batch = rte_rdtsc(); + start_batch = rte_get_timer_cycles(); } } @@ -1089,7 +1089,7 @@ destroy_flows(int port_id, uint8_t core_id, struct rte_flow **flows_list) if (flow_group > 0 && core_id == 0) rules_count_per_core++; - start_batch = rte_rdtsc(); + start_batch = rte_get_timer_cycles(); for (i = 0; i < (uint32_t) rules_count_per_core; i++) { if (flows_list[i] == 0) break; @@ -1107,12 +1107,12 @@ destroy_flows(int port_id, uint8_t core_id, struct rte_flow **flows_list) * for this batch. */ if (!((i + 1) % rules_batch)) { - end_batch = rte_rdtsc(); + end_batch = rte_get_timer_cycles(); delta = (double) (end_batch - start_batch); rules_batch_idx = ((i + 1) / rules_batch) - 1; - cpu_time_per_batch[rules_batch_idx] = delta / rte_get_tsc_hz(); + cpu_time_per_batch[rules_batch_idx] = delta / rte_get_timer_hz(); cpu_time_used += cpu_time_per_batch[rules_batch_idx]; - start_batch = rte_rdtsc(); + start_batch = rte_get_timer_cycles(); } } @@ -1185,7 +1185,7 @@ insert_flows(int port_id, uint8_t core_id) flows_list[flow_index++] = flow; } - start_batch = rte_rdtsc(); + start_batch = rte_get_timer_cycles(); for (counter = start_counter; counter < end_counter; counter++) { flow = generate_flow(port_id, flow_group, flow_attrs, flow_items, flow_actions, @@ -1211,12 +1211,12 @@ insert_flows(int port_id, uint8_t core_id) * for this batch. */ if (!((counter + 1) % rules_batch)) { - end_batch = rte_rdtsc(); + end_batch = rte_get_timer_cycles(); delta = (double) (end_batch - start_batch); rules_batch_idx = ((counter + 1) / rules_batch) - 1; - cpu_time_per_batch[rules_batch_idx] = delta / rte_get_tsc_hz(); + cpu_time_per_batch[rules_batch_idx] = delta / rte_get_timer_hz(); cpu_time_used += cpu_time_per_batch[rules_batch_idx]; - start_batch = rte_rdtsc(); + start_batch = rte_get_timer_cycles(); } } -- 2.17.1