]> git.proxmox.com Git - mirror_ovs.git/commitdiff
dpif-netdev-perf: Clarify frequency number.
authorIlya Maximets <i.maximets@samsung.com>
Thu, 11 Oct 2018 12:06:44 +0000 (15:06 +0300)
committerIan Stokes <ian.stokes@intel.com>
Fri, 12 Oct 2018 14:22:54 +0000 (15:22 +0100)
'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 <i.maximets@samsung.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
lib/dpif-netdev-perf.c
lib/dpif-netdev-unixctl.man
manpages.mk
vswitchd/ovs-vswitchd.8.in

index 92ac38dab2843cd826014f64ad6bc48ac796118b..8f0c9bc4f515a603cc3368f9f037296cd986cc5b 100644 (file)
@@ -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,26 +192,26 @@ 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"
-            "  - SMC 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"
+            "  - SMC 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,
@@ -228,17 +229,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);
     }
 }
 
index 0705f1cfb7138cae5af071ac721d7256212df86a..6c54f6f9cc3b49be76be82acd27a19ab726a1c49 100644 (file)
@@ -123,24 +123,26 @@ 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 %)
-  - SMC hits:                 0  ( 0.0 %)
-  - 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 %)
+  - SMC hits:                   0  ( 0.0 %)
+  - 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
index 6ebcf6b704da659dd51f87cbc16ef9bc03181109..0fd986e004dbd6109cf1c424279975d0e4753a3f 100644 (file)
@@ -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:
index e39d158d5df6d360188acb29f502c142b3e7f9e0..901f75e6f300f874d0529f8c94dd29108c5325f3 100644 (file)
@@ -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