From patchwork Thu Oct 11 12:06:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 982446 X-Patchwork-Delegate: ian.stokes@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="GMU29mij"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42W8ld12mbz9sjF for ; Thu, 11 Oct 2018 23:04:28 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 51AFFE2C; Thu, 11 Oct 2018 12:04:26 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 9BB5DDC3 for ; Thu, 11 Oct 2018 12:04:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 40A34D0 for ; Thu, 11 Oct 2018 12:04:24 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181011120422euoutp02f286d30880a3838b94e418a4c54270fb~cjFNX3JBk1138111381euoutp02P; Thu, 11 Oct 2018 12:04:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181011120422euoutp02f286d30880a3838b94e418a4c54270fb~cjFNX3JBk1138111381euoutp02P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539259462; bh=vXmhFWQfqIzuNpd5tx25J3SDGVQO30M426xWeej4rsA=; h=From:To:Cc:Subject:Date:References:From; b=GMU29mijz68XNh6Rx88QDnzyTswK8kkdxLs+nkQCJbGZNeDA16GDX1dFJN385V9Fa L+bHfI8xjNyUACnsmFkvnkT7BjuSrfjUJtOhA75aR5OKjowdFK643KeZTPWnsVuGpl /vYA//ujcyYzlNFak0JkK43wKegV9MiwxylKMeuA= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181011120421eucas1p1c2c81f686c1944b2d33a1588ba175190~cjFM3uLN-1254612546eucas1p1U; Thu, 11 Oct 2018 12:04:21 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id FC.FE.04806.54C3FBB5; Thu, 11 Oct 2018 13:04:21 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181011120420eucas1p26f2488c0f64917d0522aebd562e4a732~cjFL9hn630539805398eucas1p2-; Thu, 11 Oct 2018 12:04:20 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-ca-5bbf3c45e959 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 18.AA.04284.44C3FBB5; Thu, 11 Oct 2018 13:04:20 +0100 (BST) Received: from imaximets.rnd.samsung.ru ([106.109.129.180]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGF00BBLO734W70@eusync3.samsung.com>; Thu, 11 Oct 2018 13:04:20 +0100 (BST) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Thu, 11 Oct 2018 15:06:44 +0300 Message-id: <20181011120644.19071-1-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRmVeSWpSXmKPExsWy7djPc7quNvujDU7tE7fYMm0yq8WV9p/s FhsfnmW1OPL9NKPF3E/PGS3eNX1kd2DzmHX/LJvHr69X2TwW73nJ5PHs5n9Gj74tqxg9/jdf ZQ1gi+KySUnNySxLLdK3S+DK+P1wFWPBV7uKDx2tLA2M/7S7GDk5JARMJBp/dTCB2EICKxgl uha5dDFyAdmfGSXmHOth7WLkACv6PFULIr6MUeLM4yY2CKeZSWLn11vMIN1sAjoSp1YfYQSx RQSkJV73vmEFKWIWOMcocf3+eRaQhLCAvcTkRceYQaayCKhK/O5mBDF5Bawlmu/bQhwkL7F6 wwFmkFYJgZesEm3zrzFDJFwkDr1fwQ5hC0u8Or4FypaR6Ow4yARh10vcb3nJCNHcwSgx/dA/ qIS9xJbX58AamAX4JCZtm84M8RmvREebEESJh8TGw0dZICERK9G68CT7BEaJBYwMqxjFU0uL c9NTi43zUsv1ihNzi0vz0vWS83M3MQKj7PS/4193MO77k3SIUYCDUYmH94fUvmgh1sSy4src Q4wSHMxKIrz6M4BCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeZfN2xgtJJCeWJKanZpakFoEk2Xi 4JRqYMzLNG/oWstkuOZPSIXvyRUK8zx2r5rnH99ygnWC7MlFq/u/mSuHy04JZJ7ze19Ndlxc xNcqtvBbFiv+P7Len9IT1v7p+lTH7VYbNys8L9+/lL85tXH9zoZL9iGODCysebIZbk+nsB79 oWBhYXrzY9i5zcy93/YdnLTwfKrJ7TMSEis8ZZevPqXEUpyRaKjFXFScCAC5PXA5rgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLJMWRmVeSWpSXmKPExsVy+t/xq7ouNvujDbavELfYMm0yq8WV9p/s FhsfnmW1OPL9NKPF3E/PGS3eNX1kd2DzmHX/LJvHr69X2TwW73nJ5PHs5n9Gj74tqxg9/jdf ZQ1gi+KySUnNySxLLdK3S+DK+P1wFWPBV7uKDx2tLA2M/7S7GDk4JARMJD5P1epi5OIQEljC KHFs6V1WCKeVSaLn9S4gh5ODTUBH4tTqI4wgtoiAtMTr3jdgcWaBC4wSczeGgtjCAvYSkxcd YwYZyiKgKvG7mxHE5BWwlmi+bwtSISEgL7F6wwHmCYxcCxgZVjGKpJYW56bnFhvqFSfmFpfm pesl5+duYgQGwrZjPzfvYLy0MfgQowAHoxIP7w+pfdFCrIllxZW5hxglOJiVRHj1ZwCFeFMS K6tSi/Lji0pzUosPMUpzsCiJ8543qIwSEkhPLEnNTk0tSC2CyTJxcEo1MDJx/80/sUtx4v4/ ShzlJT8OKkhVSsY9/CTaH9+pry1THap8sl90R9aceF6nSdUbLTTPmB5csODcBtEVx3v+ix27 /dXqxPWDYl+6pDQ+OX54tWyOUgBXerxie8jN5cfNbdaaFZbd2LygqeGb8DaDEBMHvVWuE/ke nrqh23ZB6+J0O4fbIY0yv5VYijMSDbWYi4oTAZTLEEUAAgAA X-CMS-MailID: 20181011120420eucas1p26f2488c0f64917d0522aebd562e4a732 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181011120420eucas1p26f2488c0f64917d0522aebd562e4a732 References: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ilya Maximets , Shahaji Bhosle , Flavio Leitner Subject: [ovs-dev] [PATCH v2] dpif-netdev-perf: Clarify frequency number. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 'dpif-netdev/pmd-perf-show' command prints the frequency number calculated from the total number of cycles spent for iterations for the measured period. This number could be confusing, because users may think that it should be equal to CPU frequency, especially on non-x86 systems where TSC frequency likely does not match with CPU one. Moreover, counted TSC cycles could differ from the HW TSC cycles in case of a large number of PMD reloads, because cycles spent outside of the main polling loop are not taken into account anywhere. In this case the frequency will not match even TSC frequency. Let's clarify the meaning in order to avoid this misunderstanding. 'Cycles' replaced with 'Used TSC cycles', which describes how many TSC cycles consumed by the main polling loop. % of the total TSC cycles now printed instead of GHz frequency, because GHz is unclear for understanding, especially without knowing the exact TSC frequency. Signed-off-by: Ilya Maximets --- Version 2: * Fixed OSX manpage build failure due to missing of .EX and .EE. lib/dpif-netdev-perf.c | 36 ++++++++++++++++++------------------ lib/dpif-netdev-unixctl.man | 28 +++++++++++++++------------- manpages.mk | 2 ++ vswitchd/ovs-vswitchd.8.in | 6 +----- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/lib/dpif-netdev-perf.c b/lib/dpif-netdev-perf.c index 13f1010c9..8ff4091e5 100644 --- a/lib/dpif-netdev-perf.c +++ b/lib/dpif-netdev-perf.c @@ -170,7 +170,8 @@ pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s, double duration) { uint64_t stats[PMD_N_STATS]; - double us_per_cycle = 1000000.0 / get_tsc_hz(); + uint64_t tsc_hz = get_tsc_hz(); + double us_per_cycle = 1000000.0 / tsc_hz; if (duration == 0) { return; @@ -191,25 +192,25 @@ pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s, uint64_t busy_iter = tot_iter >= idle_iter ? tot_iter - idle_iter : 0; ds_put_format(str, - " Cycles: %12"PRIu64" (%.2f GHz)\n" - " Iterations: %12"PRIu64" (%.2f us/it)\n" - " - idle: %12"PRIu64" (%4.1f %% cycles)\n" - " - busy: %12"PRIu64" (%4.1f %% cycles)\n", - tot_cycles, (tot_cycles / duration) / 1E9, + " Iterations: %12"PRIu64" (%.2f us/it)\n" + " - Used TSC cycles: %12"PRIu64" (%5.1f %% of total cycles)\n" + " - idle iterations: %12"PRIu64" (%5.1f %% of used cycles)\n" + " - busy iterations: %12"PRIu64" (%5.1f %% of used cycles)\n", tot_iter, tot_cycles * us_per_cycle / tot_iter, + tot_cycles, 100.0 * (tot_cycles / duration) / tsc_hz, idle_iter, 100.0 * stats[PMD_CYCLES_ITER_IDLE] / tot_cycles, busy_iter, 100.0 * stats[PMD_CYCLES_ITER_BUSY] / tot_cycles); if (rx_packets > 0) { ds_put_format(str, - " Rx packets: %12"PRIu64" (%.0f Kpps, %.0f cycles/pkt)\n" - " Datapath passes: %12"PRIu64" (%.2f passes/pkt)\n" - " - EMC hits: %12"PRIu64" (%4.1f %%)\n" - " - Megaflow hits: %12"PRIu64" (%4.1f %%, %.2f subtbl lookups/" - "hit)\n" - " - Upcalls: %12"PRIu64" (%4.1f %%, %.1f us/upcall)\n" - " - Lost upcalls: %12"PRIu64" (%4.1f %%)\n", + " Rx packets: %12"PRIu64" (%.0f Kpps, %.0f cycles/pkt)\n" + " Datapath passes: %12"PRIu64" (%.2f passes/pkt)\n" + " - EMC hits: %12"PRIu64" (%5.1f %%)\n" + " - Megaflow hits: %12"PRIu64" (%5.1f %%, %.2f " + "subtbl lookups/hit)\n" + " - Upcalls: %12"PRIu64" (%5.1f %%, %.1f us/upcall)\n" + " - Lost upcalls: %12"PRIu64" (%5.1f %%)\n", rx_packets, (rx_packets / duration) / 1000, 1.0 * stats[PMD_CYCLES_ITER_BUSY] / rx_packets, passes, rx_packets ? 1.0 * passes / rx_packets : 0, @@ -225,17 +226,16 @@ pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s, stats[PMD_STAT_LOST], 100.0 * stats[PMD_STAT_LOST] / passes); } else { - ds_put_format(str, " Rx packets: %12d\n", 0); + ds_put_format(str, " Rx packets: %12d\n", 0); } if (tx_packets > 0) { ds_put_format(str, - " Tx packets: %12"PRIu64" (%.0f Kpps)\n" - " Tx batches: %12"PRIu64" (%.2f pkts/batch)" - "\n", + " Tx packets: %12"PRIu64" (%.0f Kpps)\n" + " Tx batches: %12"PRIu64" (%.2f pkts/batch)\n", tx_packets, (tx_packets / duration) / 1000, tx_batches, 1.0 * tx_packets / tx_batches); } else { - ds_put_format(str, " Tx packets: %12d\n\n", 0); + ds_put_format(str, " Tx packets: %12d\n\n", 0); } } diff --git a/lib/dpif-netdev-unixctl.man b/lib/dpif-netdev-unixctl.man index ab8619e41..53f33d83f 100644 --- a/lib/dpif-netdev-unixctl.man +++ b/lib/dpif-netdev-unixctl.man @@ -123,23 +123,25 @@ Display the last ms_len millisecond stats The output always contains the following global PMD statistics: .RS .IP -Time: 15:24:55.270 .br +.EX +Time: 15:24:55.270 Measurement duration: 1.008 s pmd thread numa_id 0 core_id 1: - Cycles: 2419034712 (2.40 GHz) - Iterations: 572817 (1.76 us/it) - - idle: 486808 (15.9 % cycles) - - busy: 86009 (84.1 % cycles) - Rx packets: 2399607 (2381 Kpps, 848 cycles/pkt) - Datapath passes: 3599415 (1.50 passes/pkt) - - EMC hits: 336472 ( 9.3 %) - - Megaflow hits: 3262943 (90.7 %, 1.00 subtbl lookups/hit) - - Upcalls: 0 ( 0.0 %, 0.0 us/upcall) - - Lost upcalls: 0 ( 0.0 %) - Tx packets: 2399607 (2381 Kpps) - Tx batches: 171400 (14.00 pkts/batch) + Iterations: 572817 (1.76 us/it) + - Used TSC cycles: 2419034712 ( 99.9 % of total cycles) + - idle iterations: 486808 ( 15.9 % of used cycles) + - busy iterations: 86009 ( 84.1 % of used cycles) + Rx packets: 2399607 (2381 Kpps, 848 cycles/pkt) + Datapath passes: 3599415 (1.50 passes/pkt) + - EMC hits: 336472 ( 9.3 %) + - Megaflow hits: 3262943 ( 90.7 %, 1.00 subtbl lookups/hit) + - Upcalls: 0 ( 0.0 %, 0.0 us/upcall) + - Lost upcalls: 0 ( 0.0 %) + Tx packets: 2399607 (2381 Kpps) + Tx batches: 171400 (14.00 pkts/batch) +.EE .RE .IP Here "Rx packets" actually reflects the number of packets forwarded by the diff --git a/manpages.mk b/manpages.mk index 6ebcf6b70..0fd986e00 100644 --- a/manpages.mk +++ b/manpages.mk @@ -255,6 +255,7 @@ vswitchd/ovs-vswitchd.8: \ lib/dpif-netdev-unixctl.man \ lib/memory-unixctl.man \ lib/netdev-dpdk-unixctl.man \ + lib/ovs.tmac \ lib/service.man \ lib/ssl-bootstrap.man \ lib/ssl-peer-ca-cert.man \ @@ -273,6 +274,7 @@ lib/dpctl.man: lib/dpif-netdev-unixctl.man: lib/memory-unixctl.man: lib/netdev-dpdk-unixctl.man: +lib/ovs.tmac: lib/service.man: lib/ssl-bootstrap.man: lib/ssl-peer-ca-cert.man: diff --git a/vswitchd/ovs-vswitchd.8.in b/vswitchd/ovs-vswitchd.8.in index e39d158d5..901f75e6f 100644 --- a/vswitchd/ovs-vswitchd.8.in +++ b/vswitchd/ovs-vswitchd.8.in @@ -1,9 +1,5 @@ .\" -*- nroff -*- -.de IQ -. br -. ns -. IP "\\$1" -.. +.so lib/ovs.tmac .TH ovs\-vswitchd 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual" .\" This program's name: .ds PN ovs\-vswitchd