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 17480A0567; Wed, 10 Mar 2021 14:54:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A46522A55C; Wed, 10 Mar 2021 14:54:14 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) by mails.dpdk.org (Postfix) with ESMTP id B893222A536 for ; Wed, 10 Mar 2021 14:54:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jCbTs1vdBzY6cH875rgLtk0oldyp1JE3cRrkmScVYztFR3ransaCq21dQgxHCC0YtMAxwa6xhkt+yVQZb4vGeFfmZnPvW/Bq6AfMgAbHdjqZwkMsyAyxo31ssHS4yY5t2Pha/eZyYwhk1XahdyXVFGtuValXVgXOtaN4iUuZWb7FwnKeb178AGmyw8l58YG0vo+tjE2giVwgBaJg0rEtwez+1sqQHt0fm6tjBk1TgCTjhBIFZIR5/cSzhs2g+lpTgfXptbqqVZQiyevmw2js4J8C7S592ai8udRBJpM2vo2suhv6youYbaYt3TnxqcdxJ6VSrSN3+dikWSmNkgFV3g== 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=eymMdvCgjvPw8Op08sjuX6xioJ8pG0JJnnRXt1X6d2xczWzF6d0KBa5nwx7Foe2IcuoC7pGVNnpjON8ILfxlexG+ZkQZkXm4Tj503TpxMOrnqy0P1IDtTvP4j34IEWEWiM9rUj658lD+T11o2bXHvpohNVx/gXfAW8FP+QwFitWMIqWmnaRTRNja86fpvqX5F40j0IZwwM2Ut9vSHfIJCVb1PA3lo1KmbkYm3zemtsGJWHslMzrZRQ8pHIJ87OPHoDN91pjsoA/j7EdX1foUtWyuSiWeydtbO6/gwVOYdpV5Vy9ug6yrzQgaY3OtbV2JD0+Z5vfEc3u9r7XcONGntA== 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=etrQWla9bltfW7W+SJ/KjmuZZz0PYLJIAXHW57XcXRrOkTdOOU0JXvfcdIrtfJrpOu3Wb9/rY0M2VCzowwvrzwPXQqtNAP4gUzAjAhHeBnu/XfCrCQ2rXYBbWN6b2hf+Fr51h83P71eSEaX63PH92TA1bh76MDHYnxFY/u6p/X32xuaeXJUzFYBAAiFKwKBNxB+RaLU6A+3PehB9802rTY20tr+H7TPMCM6V4L+TJ2NdR0Q0d7wO3SjJ0iOAjKmgVTL77w3CDA2cYggclKucFLFHs+m4o2CB8NLQalntCkfQb4LDrbGvn2kUt1kh5OJMpHp9hO4ZzVpVPBSKbR+sUQ== Received: from BN9PR03CA0799.namprd03.prod.outlook.com (2603:10b6:408:13f::24) by DM5PR12MB1275.namprd12.prod.outlook.com (2603:10b6:3:75::14) 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:54:10 +0000 Received: from BN8NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13f:cafe::7d) by BN9PR03CA0799.outlook.office365.com (2603:10b6:408:13f::24) 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:54:10 +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 BN8NAM11FT035.mail.protection.outlook.com (10.13.177.116) 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:54:10 +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:54:08 +0000 From: Wisam Jaddo To: , , , , Date: Wed, 10 Mar 2021 15:53:47 +0200 Message-ID: <20210310135353.8429-2-wisamm@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210310135353.8429-1-wisamm@nvidia.com> References: <20210310134858.8104-2-wisamm@nvidia.com> <20210310135353.8429-1-wisamm@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 470d8db8-351c-45c7-e2c5-08d8e3cbfb2e X-MS-TrafficTypeDiagnostic: DM5PR12MB1275: 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: ZL7mC9sMsuotw7BVZJb8UM+3Br0QiUpr5aD0QjRioEDLag79XTTsq7Pqz1VpXjhw2pyfa6pjlPirz7HzP/IFtKmbp+roysOdtTb7KR4LBT7aw+qO0mGotMAlMh0jXzylJHLWi8/aiNoTc4GM8SDItruJztjPKWmfpka371sBl6Uetnw/OhTnM34029Vn5VDseIadIncHBNAU6QhOpaUrqon4sV6Ck7RoFPeM9/rr1gYyHNvwkD3rrJGC1OIHtiH4w7KtglkXSE4qpdYz7Ql/nn7usaAi3Q84Vxuxj9esFalZ0eq9o6Uo4ywU0gp76VGVHfYykl8ni+mecR/Zb82BjNtwim7ff4Pw4/KjVst2B/Xe9u1j61m0tC/0LsGc4G4/Ry/htgmMn3L1IE0dqTHhPX+BZnPp8g1B7j9h+AYw5TSuqr6zdjv75Qo9+bDNOsTVCnzbNKXuQFsfaLQkgwPgV+GJdgyG5A7ykjeHdVG8ZWd6HwAcwlmkavHZmW4qi4HCsv0clqEWoQmJCZ28Xic3hOFPKH5aw0JyWL/jkIExEtao1d693HDDBHhMLm94Qj/ex6t0KQNLAT3wYP5LO8Yv9mvkRp2++Ia7yvwwQ9WB1RiM+gHjkovlURHdEuYKeiN4FbqOvRiiCl2ew0nW4vAttjtMPAfuLAva+BhfsnIGD8Hu1j+JQha8jOyCwtNnst67K0k6siBnYsCgYw1IkCJcjg== 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)(346002)(39860400002)(396003)(136003)(376002)(46966006)(36840700001)(7636003)(47076005)(2906002)(110136005)(36906005)(83380400001)(6286002)(316002)(186003)(55016002)(7696005)(16526019)(8936002)(8676002)(356005)(5660300002)(82310400003)(36756003)(34020700004)(82740400003)(70586007)(70206006)(1076003)(36860700001)(86362001)(426003)(478600001)(6666004)(26005)(2616005)(336012)(41533002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 13:54:10.3316 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 470d8db8-351c-45c7-e2c5-08d8e3cbfb2e 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: BN8NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1275 Subject: [dpdk-dev] [PATCH v3 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