]> git.proxmox.com Git - mirror_ovs.git/blob - lib/dpctl.man
cirrus: Use FreeBSD 12.2.
[mirror_ovs.git] / lib / dpctl.man
1 Do not use commands to add or remove or modify datapaths if
2 \fBovs\-vswitchd\fR is running because this interferes with
3 \fBovs\-vswitchd\fR's own datapath management.
4 .TP
5 \*(DX\fBadd\-dp \fIdp\fR [\fInetdev\fR[\fB,\fIoption\fR]...]
6 Creates datapath \fIdp\fR, with a local port also named \fIdp\fR.
7 This will fail if a network device \fIdp\fR already exists.
8 .IP
9 If \fInetdev\fRs are specified, \fB\*(PN\fR adds them to the
10 new datapath, just as if \fBadd\-if\fR was specified.
11 .
12 .TP
13 \*(DX\fBdel\-dp \fIdp\fR
14 Deletes datapath \fIdp\fR. If \fIdp\fR is associated with any network
15 devices, they are automatically removed.
16 .
17 .TP
18 \*(DX\fBadd\-if \fIdp netdev\fR[\fB,\fIoption\fR]...
19 Adds each \fInetdev\fR to the set of network devices datapath
20 \fIdp\fR monitors, where \fIdp\fR is the name of an existing
21 datapath, and \fInetdev\fR is the name of one of the host's
22 network devices, e.g. \fBeth0\fR. Once a network device has been added
23 to a datapath, the datapath has complete ownership of the network device's
24 traffic and the network device appears silent to the rest of the
25 system.
26 .IP
27 A \fInetdev\fR may be followed by a comma-separated list of options.
28 The following options are currently supported:
29 .
30 .RS
31 .IP "\fBtype=\fItype\fR"
32 Specifies the type of port to add. The default type is \fBsystem\fR.
33 .IP "\fBport_no=\fIport\fR"
34 Requests a specific port number within the datapath. If this option is
35 not specified then one will be automatically assigned.
36 .IP "\fIkey\fB=\fIvalue\fR"
37 Adds an arbitrary key-value option to the port's configuration.
38 .RE
39 .IP
40 \fBovs\-vswitchd.conf.db\fR(5) documents the available port types and
41 options.
42 .
43 .IP "\*(DX\fBset\-if \fIdp port\fR[\fB,\fIoption\fR]..."
44 Reconfigures each \fIport\fR in \fIdp\fR as specified. An
45 \fIoption\fR of the form \fIkey\fB=\fIvalue\fR adds the specified
46 key-value option to the port or overrides an existing key's value. An
47 \fIoption\fR of the form \fIkey\fB=\fR, that is, without a value,
48 deletes the key-value named \fIkey\fR. The type and port number of a
49 port cannot be changed, so \fBtype\fR and \fBport_no\fR are only allowed if
50 they match the existing configuration.
51 .TP
52 \*(DX\fBdel\-if \fIdp netdev\fR...
53 Removes each \fInetdev\fR from the list of network devices datapath
54 \fIdp\fR monitors.
55 .
56 .TP
57 \*(DX\fBdump\-dps\fR
58 Prints the name of each configured datapath on a separate line.
59 .
60 .TP
61 .DO "[\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBshow" "\fR[\fIdp\fR...]"
62 Prints a summary of configured datapaths, including their datapath
63 numbers and a list of ports connected to each datapath. (The local
64 port is identified as port 0.) If \fB\-s\fR or \fB\-\-statistics\fR
65 is specified, then packet and byte counters are also printed for each
66 port.
67 .IP
68 The datapath numbers consists of flow stats and mega flow mask stats.
69 .IP
70 The "lookups" row displays three stats related to flow lookup triggered
71 by processing incoming packets in the datapath. "hit" displays number
72 of packets matches existing flows. "missed" displays the number of
73 packets not matching any existing flow and require user space processing.
74 "lost" displays number of packets destined for user space process but
75 subsequently dropped before reaching userspace. The sum of "hit" and "miss"
76 equals to the total number of packets datapath processed.
77 .IP
78 The "flows" row displays the number of flows in datapath.
79 .IP
80 The "masks" row displays the mega flow mask stats. This row is omitted
81 for datapath not implementing mega flow. "hit" displays the total number
82 of masks visited for matching incoming packets. "total" displays number of
83 masks in the datapath. "hit/pkt" displays the average number of masks
84 visited per packet; the ratio between "hit" and total number of
85 packets processed by the datapath.
86 .IP
87 If one or more datapaths are specified, information on only those
88 datapaths are displayed. Otherwise, \fB\*(PN\fR displays information
89 about all configured datapaths.
90 .SS "DATAPATH FLOW TABLE DEBUGGING COMMANDS"
91 The following commands are primarily useful for debugging Open
92 vSwitch. The flow table entries (both matches and actions) that they
93 work with are not OpenFlow flow entries. Instead, they are different
94 and considerably simpler flows maintained by the Open vSwitch kernel
95 module. Do not use commands to add or remove or modify datapath flows
96 if \fBovs\-vswitchd\fR is running because it interferes with
97 \fBovs\-vswitchd\fR's own datapath flow management. Use
98 \fBovs\-ofctl\fR(8), instead, to work with OpenFlow flow entries.
99 .
100 .PP
101 The \fIdp\fR argument to each of these commands is optional when
102 exactly one datapath exists, in which case that datapath is the
103 default. When multiple datapaths exist, then a datapath name is
104 required.
105 .
106 .TP
107 .DO "[\fB\-m \fR| \fB\-\-more\fR] [\fB\-\-names \fR| \fB\-\-no\-names\fR]" \*(DX\fBdump\-flows\fR "[\fIdp\fR] [\fBfilter=\fIfilter\fR] [\fBtype=\fItype\fR] [\fBpmd=\fIpmd\fR]"
108 Prints to the console all flow entries in datapath \fIdp\fR's flow
109 table. Without \fB\-m\fR or \fB\-\-more\fR, output omits match fields
110 that a flow wildcards entirely; with \fB\-m\fR or \fB\-\-more\fR,
111 output includes all wildcarded fields.
112 .IP
113 If \fBfilter=\fIfilter\fR is specified, only displays the flows
114 that match the \fIfilter\fR. \fIfilter\fR is a flow in the form similiar
115 to that accepted by \fBovs\-ofctl\fR(8)'s \fBadd\-flow\fR command. (This is
116 not an OpenFlow flow: besides other differences, it never contains wildcards.)
117 The \fIfilter\fR is also useful to match wildcarded fields in the datapath
118 flow. As an example, \fBfilter='tcp,tp_src=100'\fR will match the
119 datapath flow containing '\fBtcp(src=80/0xff00,dst=8080/0xff)\fR'.
120 .IP
121 If \fBpmd=\fIpmd\fR is specified, only displays flows of the specified pmd.
122 Using \fBpmd=\fI-1\fR will restrict the dump to flows from the main thread.
123 This option is only supported by the \fBuserspace datapath\fR.
124 .IP
125 If \fBtype=\fItype\fR is specified, only displays flows of the specified types.
126 This option supported only for \fBovs\-appctl dpctl/dump\-flows\fR.
127 \fItype\fR is a comma separated list, which can contain any of the following:
128 .
129 \fBovs\fR - displays flows handled in the ovs dp
130 \fBtc\fR - displays flows handled in the tc dp
131 \fBdpdk\fR - displays flows fully offloaded by dpdk
132 \fBoffloaded\fR - displays flows offloaded to the HW
133 \fBnon-offloaded\fR - displays flows not offloaded to the HW
134 \fBpartially-offloaded\fR - displays flows where only part of their proccessing is done in HW
135 \fBall\fR - displays all the types of flows
136 .IP
137 By default all the types of flows are displayed.
138 \fBovs\-dpctl\fR always acts as if the \fBtype\fR was \fIovs\fR.
139 .
140 .IP "\*(DX\fBadd\-flow\fR [\fIdp\fR] \fIflow actions\fR"
141 .TP
142 .DO "[\fB\-\-clear\fR] [\fB\-\-may-create\fR] [\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBmod\-flow\fR" "[\fIdp\fR] \fIflow actions\fR"
143 Adds or modifies a flow in \fIdp\fR's flow table that, when a packet
144 matching \fIflow\fR arrives, causes \fIactions\fR to be executed.
145 .IP
146 The \fBadd\-flow\fR command succeeds only if \fIflow\fR does not
147 already exist in \fIdp\fR. Contrariwise, \fBmod\-flow\fR without
148 \fB\-\-may\-create\fR only modifies the actions for an existing flow.
149 With \fB\-\-may\-create\fR, \fBmod\-flow\fR will add a new flow or
150 modify an existing one.
151 .IP
152 If \fB\-s\fR or \fB\-\-statistics\fR is specified, then
153 \fBmod\-flow\fR prints the modified flow's statistics. A flow's
154 statistics are the number of packets and bytes that have passed
155 through the flow, the elapsed time since the flow last processed a
156 packet (if ever), and (for TCP flows) the union of the TCP flags
157 processed through the flow.
158 .IP
159 With \fB\-\-clear\fR, \fBmod\-flow\fR zeros out the flow's
160 statistics. The statistics printed if \fB\-s\fR or
161 \fB\-\-statistics\fR is also specified are those from just before
162 clearing the statistics.
163 .IP
164 NOTE:
165 \fIflow\fR and \fIactions\fR do not match the syntax used with
166 \fBovs\-ofctl\fR(8)'s \fBadd\-flow\fR command.
167 .
168 .IP
169 \fBUsage Examples\fR
170 .
171 .RS
172 .PP
173 Forward ARP between ports 1 and 2 on datapath myDP:
174 .IP
175 ovs-dpctl add-flow myDP \\
176 .
177 "in_port(1),eth(),eth_type(0x0806),arp()" 2
178 .
179 .IP
180 ovs-dpctl add-flow myDP \\
181 .
182 "in_port(2),eth(),eth_type(0x0806),arp()" 1
183 .
184 .PP
185 Forward all IPv4 traffic between two addresses on ports 1 and 2:
186 .
187 .IP
188 ovs-dpctl add-flow myDP \\
189 .
190 "in_port(1),eth(),eth_type(0x800),\\
191 ipv4(src=172.31.110.4,dst=172.31.110.5)" 2
192 .
193 .IP
194 ovs-dpctl add-flow myDP \\
195 .
196 "in_port(2),eth(),eth_type(0x800),\\
197 ipv4(src=172.31.110.5,dst=172.31.110.4)" 1
198 .
199 .RE
200 .TP
201 \*(DX\fBadd\-flows\fR [\fIdp\fR] \fIfile\fR
202 .TQ
203 \*(DX\fBmod\-flows\fR [\fIdp\fR] \fIfile\fR
204 .TQ
205 \*(DX\fBdel\-flows\fR [\fIdp\fR] \fIfile\fR
206 Reads flow entries from \fIfile\fR (or \fBstdin\fR if \fIfile\fR is
207 \fB\-\fR) and adds, modifies, or deletes each entry to the datapath.
208 .
209 Each flow specification (e.g., each line in \fIfile\fR) may start with
210 \fBadd\fR, \fBmodify\fR, or \fBdelete\fR keyword to specify whether a
211 flow is to be added, modified, or deleted. A flow specification without
212 one of these keywords is treated based on the used command. All flow
213 modifications are executed as individual transactions in the order
214 specified.
215 .
216 .TP
217 .DO "[\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBdel\-flow\fR" "[\fIdp\fR] \fIflow\fR"
218 Deletes the flow from \fIdp\fR's flow table that matches \fIflow\fR.
219 If \fB\-s\fR or \fB\-\-statistics\fR is specified, then
220 \fBdel\-flow\fR prints the deleted flow's statistics.
221 .
222 .TP
223 .DO "[\fB\-m \fR| \fB\-\-more\fR] [\fB\-\-names \fR| \fB\-\-no\-names\fR]" "\*(DX\fBget\-flow\fR [\fIdp\fR] ufid:\fIufid\fR"
224 Fetches the flow from \fIdp\fR's flow table with unique identifier \fIufid\fR.
225 \fIufid\fR must be specified as a string of 32 hexadecimal characters.
226 .
227 .IP "\*(DX\fBdel\-flows\fR [\fIdp\fR]"
228 Deletes all flow entries from datapath \fIdp\fR's flow table.
229 .SS "CONNECTION TRACKING TABLE COMMANDS"
230 The following commands are useful for debugging and configuring
231 the connection tracking table in the datapath.
232 .
233 .PP
234 The \fIdp\fR argument to each of these commands is optional when
235 exactly one datapath exists, in which case that datapath is the
236 default. When multiple datapaths exist, then a datapath name is
237 required.
238 .
239 .PP
240 \fBN.B.\fR(Linux specific): the \fIsystem\fR datapaths (i.e. the Linux
241 kernel module Open vSwitch datapaths) share a single connection tracking
242 table (which is also used by other kernel subsystems, such as iptables,
243 nftables and the regular host stack). Therefore, the following commands
244 do not apply specifically to one datapath.
245 .
246 .TP
247 \*(DX\fBipf\-set\-enabled\fR [\fIdp\fR] \fBv4\fR|\fBv6\fR
248 .TQ
249 \*(DX\fBipf\-set\-disabled\fR [\fIdp\fR] \fBv4\fR|\fBv6\fR
250 Enables or disables IP fragmentation handling for the userspace
251 connection tracker. Either \fBv4\fR or \fBv6\fR must be specified.
252 Both IPv4 and IPv6 fragment reassembly are enabled by default. Only
253 supported for the userspace datapath.
254 .
255 .TP
256 \*(DX\fBipf\-set\-min\-frag\fR [\fIdp\fR] \fBv4\fR|\fBv6\fR \fIminfrag\fR
257 Sets the minimum fragment size (L3 header and data) for non-final fragments to
258 \fIminfrag\fR. Either \fBv4\fR or \fBv6\fR must be specified. For
259 enhanced DOS security, higher minimum fragment sizes can usually be used.
260 The default IPv4 value is 1200 and the clamped minimum is 400. The default
261 IPv6 value is 1280, with a clamped minimum of 400, for testing
262 flexibility. The maximum fragment size is not clamped, however, setting
263 this value too high might result in valid fragments being dropped. Only
264 supported for userspace datapath.
265 .
266 .TP
267 \*(DX\fBipf\-set\-max\-nfrags\fR [\fIdp\fR] \fImaxfrags\fR
268 Sets the maximum number of fragments tracked by the userspace datapath
269 connection tracker to \fImaxfrags\fR. The default value is 1000 and the
270 clamped maximum is 5000. Note that packet buffers can be held by the
271 fragmentation module while fragments are incomplete, but will timeout
272 after 15 seconds. Memory pool sizing should be set accordingly when
273 fragmentation is enabled. Only supported for userspace datapath.
274 .
275 .TP
276 .DO "[\fB\-m\fR | \fB\-\-more\fR]" "\*(DX\fBipf\-get\-status\fR [\fIdp\fR]"
277 Gets the configuration settings and fragment counters associated with the
278 fragmentation handling of the userspace datapath connection tracker.
279 With \fB\-m\fR or \fB\-\-more\fR, also dumps the IP fragment lists.
280 Only supported for userspace datapath.
281 .
282 .TP
283 .DO "[\fB\-m\fR | \fB\-\-more\fR] [\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBdump\-conntrack\fR" "[\fIdp\fR] [\fBzone=\fIzone\fR]"
284 Prints to the console all the connection entries in the tracker used by
285 \fIdp\fR. If \fBzone=\fIzone\fR is specified, only shows the connections
286 in \fIzone\fR. With \fB\-\-more\fR, some implementation specific details
287 are included. With \fB\-\-statistics\fR timeouts and timestamps are
288 added to the output.
289 .
290 .TP
291 \*(DX\fBflush\-conntrack\fR [\fIdp\fR] [\fBzone=\fIzone\fR] [\fIct-tuple\fR]
292 Flushes the connection entries in the tracker used by \fIdp\fR based on
293 \fIzone\fR and connection tracking tuple \fIct-tuple\fR.
294 If \fIct-tuple\fR is not provided, flushes all the connection entries.
295 If \fBzone\fR=\fIzone\fR is specified, only flushes the connections in
296 \fIzone\fR.
297 .IP
298 If \fIct-tuple\fR is provided, flushes the connection entry specified by
299 \fIct-tuple\fR in \fIzone\fR. The zone defaults to 0 if it is not provided.
300 The userspace connection tracker requires flushing with the original pre-NATed
301 tuple and a warning log will be otherwise generated.
302 An example of an IPv4 ICMP \fIct-tuple\fR:
303 .IP
304 "ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=1,icmp_type=8,icmp_code=0,icmp_id=10"
305 .IP
306 An example of an IPv6 TCP \fIct-tuple\fR:
307 .IP
308 "ct_ipv6_src=fc00::1,ct_ipv6_dst=fc00::2,ct_nw_proto=6,ct_tp_src=1,ct_tp_dst=2"
309 .
310 .TP
311 .DO "[\fB\-m\fR | \fB\-\-more\fR]" "\*(DX\fBct\-stats\-show\fR [\fIdp\fR] [\fBzone=\fIzone\fR]"
312 Displays the number of connections grouped by protocol used by \fIdp\fR.
313 If \fBzone=\fIzone\fR is specified, numbers refer to the connections in
314 \fIzone\fR. With \fB\-\-more\fR, groups by connection state for each
315 protocol.
316 .
317 .TP
318 \*(DX\fBct\-bkts\fR [\fIdp\fR] [\fBgt=\fIthreshold\fR]
319 For each conntrack bucket, displays the number of connections used
320 by \fIdp\fR.
321 If \fBgt=\fIthreshold\fR is specified, bucket numbers are displayed when
322 the number of connections in a bucket is greater than \fIthreshold\fR.
323 .
324 .TP
325 \*(DX\fBct\-set\-maxconns\fR [\fIdp\fR] \fImaxconns\fR
326 Sets the maximum limit of connection tracker entries to \fImaxconns\fR
327 on \fIdp\fR. This can be used to reduce the processing load on the
328 system due to connection tracking or simply limiting connection
329 tracking. If the number of connections is already over the new maximum
330 limit request then the new maximum limit will be enforced when the
331 number of connections decreases to that limit, which normally happens
332 due to connection expiry. Only supported for userspace datapath.
333 .
334 .TP
335 \*(DX\fBct\-get\-maxconns\fR [\fIdp\fR]
336 Prints the maximum limit of connection tracker entries on \fIdp\fR.
337 Only supported for userspace datapath.
338 .
339 .TP
340 \*(DX\fBct\-get\-nconns\fR [\fIdp\fR]
341 Prints the current number of connection tracker entries on \fIdp\fR.
342 Only supported for userspace datapath.
343 .
344 .TP
345 \*(DX\fBct\-enable\-tcp\-seq\-chk\fR [\fIdp\fR]
346 .TQ
347 \*(DX\fBct\-disable\-tcp\-seq\-chk\fR [\fIdp\fR]
348 Enables or disables TCP sequence checking. When set to disabled, all sequence
349 number verification is disabled, including for TCP resets. This is
350 similar, but not the same as 'be_liberal' mode, as in Netfilter. Disabling
351 sequence number verification is not an optimization in itself, but is needed
352 for some hardware offload support which might offer some performance
353 advantage. Sequence number checking is enabled by default to enforce better
354 security and should only be disabled if required for hardware offload support.
355 This command is only supported for the userspace datapath.
356 .
357 .TP
358 \*(DX\fBct\-get\-tcp\-seq\-chk\fR [\fIdp\fR]
359 Prints whether TCP sequence checking is enabled or disabled on \fIdp\fR. Only
360 supported for the userspace datapath.
361 .
362 .TP
363 \*(DX\fBct\-set\-limits\fR [\fIdp\fR] [\fBdefault=\fIdefault_limit\fR] [\fBzone=\fIzone\fR,\fBlimit=\fIlimit\fR]...
364 Sets the maximum allowed number of connections in a connection tracking
365 zone. A specific \fIzone\fR may be set to \fIlimit\fR, and multiple zones
366 may be specified with a comma-separated list. If a per-zone limit for a
367 particular zone is not specified in the datapath, it defaults to the
368 default per-zone limit. A default zone may be specified with the
369 \fBdefault=\fIdefault_limit\fR argument. Initially, the default
370 per-zone limit is unlimited. An unlimited number of entries may be set
371 with \fB0\fR limit.
372 .
373 .TP
374 \*(DX\fBct\-del\-limits\fR [\fIdp\fR] \fBzone=\fIzone[,zone]\fR...
375 Deletes the connection tracking limit for \fIzone\fR. Multiple zones may
376 be specified with a comma-separated list.
377 .
378 .TP
379 \*(DX\fBct\-get\-limits\fR [\fIdp\fR] [\fBzone=\fIzone\fR[\fB,\fIzone\fR]...]
380 Retrieves the maximum allowed number of connections and current
381 counts per-zone. If \fIzone\fR is given, only the specified zone(s) are
382 printed. If no zones are specified, all the zone limits and counts are
383 provided. The command always displays the default zone limit.