]> git.proxmox.com Git - mirror_ovs.git/blame - lib/dpif-netdev-unixctl.man
Revert "dpif-netdev: includes microsecond delta in meter bucket calculation".
[mirror_ovs.git] / lib / dpif-netdev-unixctl.man
CommitLineData
79f36875
JS
1.SS "DPIF-NETDEV COMMANDS"
2These commands are used to expose internal information (mostly statistics)
3about the "dpif-netdev" userspace datapath. If there is only one datapath
4(as is often the case, unless \fBdpctl/\fR commands are used), the \fIdp\fR
5argument can be omitted. By default the commands present data for all pmd
6threads in the datapath. By specifying the "-pmd Core" option one can filter
7the output for a single pmd in the datapath.
8.
9.IP "\fBdpif-netdev/pmd-stats-show\fR [\fB-pmd\fR \fIcore\fR] [\fIdp\fR]"
10Shows performance statistics for one or all pmd threads of the datapath
11\fIdp\fR. The special thread "main" sums up the statistics of every non pmd
12thread.
13
21e9b77b 14The sum of "emc hits", "smc hits", "megaflow hits" and "miss" is the number of
79f36875
JS
15packet lookups performed by the datapath. Beware that a recirculated packet
16experiences one additional lookup per recirculation, so there may be
17more lookups than forwarded packets in the datapath.
18
19Cycles are counted using the TSC or similar facilities (when available on
20the platform). The duration of one cycle depends on the processing platform.
21
22"idle cycles" refers to cycles spent in PMD iterations not forwarding any
23any packets. "processing cycles" refers to cycles spent in PMD iterations
24forwarding at least one packet, including the cost for polling, processing and
25transmitting said packets.
26
27To reset these counters use \fBdpif-netdev/pmd-stats-clear\fR.
28.
29.IP "\fBdpif-netdev/pmd-stats-clear\fR [\fIdp\fR]"
30Resets to zero the per pmd thread performance numbers shown by the
31\fBdpif-netdev/pmd-stats-show\fR and \fBdpif-netdev/pmd-perf-show\fR commands.
32It will NOT reset datapath or bridge statistics, only the values shown by
33the above commands.
34.
35.IP "\fBdpif-netdev/pmd-perf-show\fR [\fB-nh\fR] [\fB-it\fR \fIiter_len\fR] \
36[\fB-ms\fR \fIms_len\fR] [\fB-pmd\fR \fIcore\fR] [\fIdp\fR]"
37Shows detailed performance metrics for one or all pmds threads of the
38user space datapath.
39
40The collection of detailed statistics can be controlled by a new
41configuration parameter "other_config:pmd-perf-metrics". By default it
42is disabled. The run-time overhead, when enabled, is in the order of 1%.
43
44.RS
45.IP
46.PD .4v
47.IP \(em
48used cycles
49.IP \(em
50forwared packets
51.IP \(em
52number of rx batches
53.IP \(em
54packets/rx batch
55.IP \(em
56max. vhostuser queue fill level
57.IP \(em
58number of upcalls
59.IP \(em
60cycles spent in upcalls
61.PD
62.RE
63.IP
64This raw recorded data is used threefold:
65
66.RS
67.IP
68.PD .4v
69.IP 1.
70In histograms for each of the following metrics:
71.RS
72.IP \(em
73cycles/iteration (logarithmic)
74.IP \(em
75packets/iteration (logarithmic)
76.IP \(em
77cycles/packet
78.IP \(em
79packets/batch
80.IP \(em
81max. vhostuser qlen (logarithmic)
82.IP \(em
83upcalls
84.IP \(em
85cycles/upcall (logarithmic)
86The histograms bins are divided linear or logarithmic.
87.RE
88.IP 2.
89A cyclic history of the above metrics for 1024 iterations
90.IP 3.
91A cyclic history of the cummulative/average values per millisecond wall
92clock for the last 1024 milliseconds:
93.RS
94.IP \(em
95number of iterations
96.IP \(em
97avg. cycles/iteration
98.IP \(em
99packets (Kpps)
100.IP \(em
101avg. packets/batch
102.IP \(em
103avg. max vhost qlen
104.IP \(em
105upcalls
106.IP \(em
107avg. cycles/upcall
108.RE
109.PD
110.RE
111.IP
112.
113The command options are:
114.RS
115.IP "\fB-nh\fR"
116Suppress the histograms
117.IP "\fB-it\fR \fIiter_len\fR"
118Display the last iter_len iteration stats
119.IP "\fB-ms\fR \fIms_len\fR"
120Display the last ms_len millisecond stats
121.RE
122.IP
123The output always contains the following global PMD statistics:
124.RS
125.IP
6794be1d
IM
126.EX
127Time: 15:24:55.270
79f36875
JS
128Measurement duration: 1.008 s
129
130pmd thread numa_id 0 core_id 1:
131
6794be1d
IM
132 Iterations: 572817 (1.76 us/it)
133 - Used TSC cycles: 2419034712 ( 99.9 % of total cycles)
134 - idle iterations: 486808 ( 15.9 % of used cycles)
135 - busy iterations: 86009 ( 84.1 % of used cycles)
136 Rx packets: 2399607 (2381 Kpps, 848 cycles/pkt)
137 Datapath passes: 3599415 (1.50 passes/pkt)
138 - EMC hits: 336472 ( 9.3 %)
139 - SMC hits: 0 ( 0.0 %)
140 - Megaflow hits: 3262943 ( 90.7 %, 1.00 subtbl lookups/hit)
141 - Upcalls: 0 ( 0.0 %, 0.0 us/upcall)
142 - Lost upcalls: 0 ( 0.0 %)
143 Tx packets: 2399607 (2381 Kpps)
144 Tx batches: 171400 (14.00 pkts/batch)
145.EE
79f36875
JS
146.RE
147.IP
148Here "Rx packets" actually reflects the number of packets forwarded by the
149datapath. "Datapath passes" matches the number of packet lookups as
150reported by the \fBdpif-netdev/pmd-stats-show\fR command.
151
152To reset the counters and start a new measurement use
153\fBdpif-netdev/pmd-stats-clear\fR.
154.
7178fefb
JS
155.IP "\fBdpif-netdev/pmd-perf-log-set\fR \fBon\fR|\fBoff\fR \
156[\fB-b\fR \fIbefore\fR] [\fB-a\fR \fIafter\fR] [\fB-e\fR|\fB-ne\fR] \
157[\fB-us\fR \fIusec\fR] [\fB-q\fR \fIqlen\fR]"
158.
159The userspace "netdev" datapath is able to supervise the PMD performance
160metrics and detect iterations with suspicious statistics according to the
161following criteria:
162.RS
163.IP \(em
164The iteration lasts longer than \fIusec\fR microseconds (default 250).
165This can be used to capture events where a PMD is blocked or interrupted for
166such a period of time that there is a risk for dropped packets on any of its Rx
167queues.
168.IP \(em
169The max vhost qlen exceeds a threshold \fIqlen\fR (default 128). This can be
170used to infer virtio queue overruns and dropped packets inside a VM, which are
171not visible in OVS otherwise.
172.RE
173.IP
174Such suspicious iterations can be logged together with their iteration
175statistics in the \fBovs-vswitchd.log\fR to be able to correlate them to
176packet drop or other events outside OVS.
177
178The above command enables (\fBon\fR) or disables (\fBoff\fR) supervision and
179logging at run-time and can be used to adjust the above thresholds for
180detecting suspicious iterations. By default supervision and logging is
181disabled.
182
183The command options are:
184.RS
185.IP "\fB-b\fR \fIbefore\fR"
186The number of iterations before the suspicious iteration to be logged
187(default 5).
188.IP "\fB-a\fR \fIafter\fR"
189The number of iterations after the suspicious iteration to be logged
190(default 5).
191.IP "\fB-e\fR"
192Extend logging interval if another suspicious iteration is detected
193before logging occurs.
194.IP "\fB-ne\fR"
195Do not extend logging interval if another suspicious iteration is detected
196before logging occurs (default).
197.IP "\fB-q\fR \fIqlen\fR"
198Suspicious vhost queue fill level threshold. Increase this to 512 if the Qemu
199supports 1024 virtio queue length (default 128).
200.IP "\fB-us\fR \fIusec\fR"
201Change the duration threshold for a suspicious iteration (default 250 us).
202.RE
203
204Note: Logging of suspicious iterations itself consumes a considerable amount
205of processing cycles of a PMD which may be visible in the iteration history.
206In the worst case this can lead OVS to detect another suspicious iteration
207caused by logging.
208
209If more than 100 iterations around a suspicious iteration have been logged
210once, OVS falls back to the safe default values (-b 5 -a 5 -ne) to avoid
211that logging itself continuously causes logging of further suspicious
212iterations.
213.
79f36875
JS
214.IP "\fBdpif-netdev/pmd-rxq-show\fR [\fB-pmd\fR \fIcore\fR] [\fIdp\fR]"
215For one or all pmd threads of the datapath \fIdp\fR show the list of queue-ids
216with port names, which this thread polls.
217.
218.IP "\fBdpif-netdev/pmd-rxq-rebalance\fR [\fIdp\fR]"
219Reassigns rxqs to pmds in the datapath \fIdp\fR based on their current usage.
d4a12d87
AM
220.
221.IP "\fBdpif-netdev/bond-show\fR [\fIdp\fR]"
222When "other_config:lb-output-action" is set to "true", the userspace datapath
223handles the load balancing of bonds directly instead of depending on flow
224recirculation (only in balance-tcp mode).
225
226When this is the case, the above command prints the load-balancing information
227of the bonds configured in datapath \fIdp\fR showing the interface associated
228with each bucket (hash).