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 B627DA0567; Wed, 10 Mar 2021 14:46:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E6C022A615; Wed, 10 Mar 2021 14:46:16 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2086.outbound.protection.outlook.com [40.107.220.86]) by mails.dpdk.org (Postfix) with ESMTP id 6B67822A607 for ; Wed, 10 Mar 2021 14:46:14 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m1GD3U8KdL4aKDN8STWyORkr1GuhNhlBuuY4g747ZNZz4SRECgGzUWB+AMX9Zh1JFHair7wC3sGD6HM4dwlcGUUX7EkxR0LRCDEYImIVpQh3B0flIxi+1RMXtbJt1BloLaSB8PJaHnyJp3xRGHQut9gqWC+nFonG9OVAJeT/xo4R6ccLRdY57GHjs1iZFnYMLD+xN93C153XHMo2nZNgihXEGLcgloeUDNhjshvHPuj8Rq2IDMeNP9UttUckCljlf8GXVpCH02nwAqrfkFm9vBDHNCkbZEj+q4+qRygG7iDIrEFa5P+nps8qU0EUFvhsjwSdgkOTPbXBrJWqlL7G5A== 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=SlGXriE8UJCv+tEAk9MyZmJrU2gZu0qVn/KqfHeOCoJVpnxNo6gKeBvk72iGm6aheKG7wR7PlNi+5N2d7z20TeomDmG3NMlKZbTri/6Uf/Nvowr9tARxh5l1hsrS/M5BMEFmoyHA2MZ6MvBFSWsX7zyo08sDu2FzBBGj/iW60uYxkcs7QBixu3yvHZDOyHrMVCyF7IQgBfaI595pA81dhaI0Ft8Eicwjv2aSoEY3cV7PXZIMBaKwEeKUu3TpLAEPDRth4tep46t7QfWxFpf04ncnMv08OXbn3F1xqpesv2y6h4NjdjUht+eKCAnaiv+gsK//8Ln/6x3KgqoDpimQLQ== 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=my3gmyP3avagy6VO3Jf+Gf9rSIMu4ybrAP6zOYHZzGt8GjPNyinZfdTpHt+QRs8KhSSlX0sp593sWJsNedJiG2eOIwc54E/7nMxbl5oD/wMacCNyZxrjUiYrHAl8F6muBfCUjc+iW59nGSrKzMhklp5/jcNW+DUjgfKoKlokBU044IUH7N7yQS6U3l0IbJufvoLsu9F+YfKdMFv/Ha6BzXMF2l1ehdXcoE5t/gj1gnEcjlhOjhiYW3n3Yqy4dg8mV6wlZtZLtMIg20TJNn+H5hNBlrv5kD01ef/f6evCc2IhJV+RrFtXyOVXCFQsVEOOL4FAqWmh7r7/mB3/0oFRmg== Received: from DM3PR12CA0119.namprd12.prod.outlook.com (2603:10b6:0:51::15) by DM5PR12MB1595.namprd12.prod.outlook.com (2603:10b6:4:3::15) 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:46:12 +0000 Received: from DM6NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:0:51:cafe::cc) by DM3PR12CA0119.outlook.office365.com (2603:10b6:0:51::15) 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:46:12 +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 DM6NAM11FT049.mail.protection.outlook.com (10.13.172.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.3933.31 via Frontend Transport; Wed, 10 Mar 2021 13:46:12 +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:46:09 +0000 From: Wisam Jaddo To: , , , , Date: Wed, 10 Mar 2021 15:45:48 +0200 Message-ID: <20210310134554.7948-2-wisamm@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210310134554.7948-1-wisamm@nvidia.com> References: <20210307091202.586-2-wisamm@nvidia.com> <20210310134554.7948-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: 04b12f0e-6965-41a5-b731-08d8e3cade43 X-MS-TrafficTypeDiagnostic: DM5PR12MB1595: 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: S20jRNG7WIWxmdP6go71eX8Es4Yyb3hrl4gr0jV9kwruEgDZQ9MkaGtFkJhfK5G2EXqID04xm4zD4WnTlhPNgnSRkzrtEXHxN8iavg2CZ0El5R+XEXDTNpLKIFQ9cT9riZ0Wj04sPJt7ZNf1VzdX/UfKLtZOhcXaYWbGRtdYU/dElIAUBV3AbOw6CaqUaBY258NJ00qsFxHnL+dZEi7+BxhIR1XucxOwwLUCvZthleIFfhmcyQvOxuvNx6lHSA0UyBwcspxekwhNpU6lptisQ3nXvCC+1inxU22SKe5Ve0MsGTOSHsgU5MCGQlD1yXrEX4tVl5VuOKelqeDdTO/FfJtrZN4aVei+DtdL6W1CMqdYvbxwVCPmBf7XfOvaxJomkwdPxNxF6SyUfy3zcrn3QN5u7WY0FZm5CRY30YOkxRGCDfKpu2SWWFoSDh/MkUeNSbu344crY+c/Y4tzHrLivuCV/mILtemuwKdoFDXNAmBKR7zc1QKQX3DZA7/lVZhhq6Cvf1Po4i3jjq2DOUBlFAs4gKjgnLgut5eyY9QFUIsJs1a/nZIWOURKVMw9e6HscLtCw6QQmlv84Okuc+rc6cGRLljZkuO/Z3jnicjirdjkRjdgs0oeA8mCTK1WpXPhh2cbHB+tGGK4txxbTgFRFE9lo/SM0A+BAMbL1gX9cImGGGltCEpM1geEWy8tgNU8teGsxrozH7QQMjbxyKeZlg== 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)(376002)(346002)(136003)(396003)(36840700001)(46966006)(36860700001)(47076005)(55016002)(26005)(2616005)(70206006)(8936002)(70586007)(426003)(86362001)(186003)(16526019)(316002)(7696005)(1076003)(110136005)(36906005)(34020700004)(36756003)(82310400003)(83380400001)(7636003)(356005)(6286002)(6666004)(8676002)(478600001)(5660300002)(336012)(82740400003)(2906002)(41533002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 13:46:12.3614 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04b12f0e-6965-41a5-b731-08d8e3cade43 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: DM6NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1595 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