]> git.proxmox.com Git - mirror_ovs.git/blob - lib/dpctl.man
ofp-ed-props: Fix using uninitialized padding for NSH encap actions.
[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]"
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 \fBtype=\fItype\fR is specified, only displays flows of the specified types.
122 This option supported only for \fBovs\-appctl dpctl/dump\-flows\fR.
123 \fItype\fR is a comma separated list, which can contain any of the following:
124 .
125 \fBovs\fR - displays flows handled in the ovs dp
126 \fBtc\fR - displays flows handled in the tc dp
127 \fBdpdk\fR - displays flows fully offloaded by dpdk
128 \fBoffloaded\fR - displays flows offloaded to the HW
129 \fBnon-offloaded\fR - displays flows not offloaded to the HW
130 \fBpartially-offloaded\fR - displays flows where only part of their proccessing is done in HW
131 \fBall\fR - displays all the types of flows
132 .IP
133 By default all the types of flows are displayed.
134 \fBovs\-dpctl\fR always acts as if the \fBtype\fR was \fIovs\fR.
135 .
136 .IP "\*(DX\fBadd\-flow\fR [\fIdp\fR] \fIflow actions\fR"
137 .TP
138 .DO "[\fB\-\-clear\fR] [\fB\-\-may-create\fR] [\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBmod\-flow\fR" "[\fIdp\fR] \fIflow actions\fR"
139 Adds or modifies a flow in \fIdp\fR's flow table that, when a packet
140 matching \fIflow\fR arrives, causes \fIactions\fR to be executed.
141 .IP
142 The \fBadd\-flow\fR command succeeds only if \fIflow\fR does not
143 already exist in \fIdp\fR. Contrariwise, \fBmod\-flow\fR without
144 \fB\-\-may\-create\fR only modifies the actions for an existing flow.
145 With \fB\-\-may\-create\fR, \fBmod\-flow\fR will add a new flow or
146 modify an existing one.
147 .IP
148 If \fB\-s\fR or \fB\-\-statistics\fR is specified, then
149 \fBmod\-flow\fR prints the modified flow's statistics. A flow's
150 statistics are the number of packets and bytes that have passed
151 through the flow, the elapsed time since the flow last processed a
152 packet (if ever), and (for TCP flows) the union of the TCP flags
153 processed through the flow.
154 .IP
155 With \fB\-\-clear\fR, \fBmod\-flow\fR zeros out the flow's
156 statistics. The statistics printed if \fB\-s\fR or
157 \fB\-\-statistics\fR is also specified are those from just before
158 clearing the statistics.
159 .IP
160 NOTE:
161 \fIflow\fR and \fIactions\fR do not match the syntax used with
162 \fBovs\-ofctl\fR(8)'s \fBadd\-flow\fR command.
163 .
164 .IP
165 \fBUsage Examples\fR
166 .
167 .RS
168 .PP
169 Forward ARP between ports 1 and 2 on datapath myDP:
170 .IP
171 ovs-dpctl add-flow myDP \\
172 .
173 "in_port(1),eth(),eth_type(0x0806),arp()" 2
174 .
175 .IP
176 ovs-dpctl add-flow myDP \\
177 .
178 "in_port(2),eth(),eth_type(0x0806),arp()" 1
179 .
180 .PP
181 Forward all IPv4 traffic between two addresses on ports 1 and 2:
182 .
183 .IP
184 ovs-dpctl add-flow myDP \\
185 .
186 "in_port(1),eth(),eth_type(0x800),\\
187 ipv4(src=172.31.110.4,dst=172.31.110.5)" 2
188 .
189 .IP
190 ovs-dpctl add-flow myDP \\
191 .
192 "in_port(2),eth(),eth_type(0x800),\\
193 ipv4(src=172.31.110.5,dst=172.31.110.4)" 1
194 .
195 .RE
196 .TP
197 .DO "[\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBdel\-flow\fR" "[\fIdp\fR] \fIflow\fR"
198 Deletes the flow from \fIdp\fR's flow table that matches \fIflow\fR.
199 If \fB\-s\fR or \fB\-\-statistics\fR is specified, then
200 \fBdel\-flow\fR prints the deleted flow's statistics.
201 .
202 .TP
203 .DO "[\fB\-m \fR| \fB\-\-more\fR] [\fB\-\-names \fR| \fB\-\-no\-names\fR]" "\*(DX\fBget\-flow\fR [\fIdp\fR] ufid:\fIufid\fR"
204 Fetches the flow from \fIdp\fR's flow table with unique identifier \fIufid\fR.
205 \fIufid\fR must be specified as a string of 32 hexadecimal characters.
206 .
207 .IP "\*(DX\fBdel\-flows\fR [\fIdp\fR]"
208 Deletes all flow entries from datapath \fIdp\fR's flow table.
209 .SS "CONNECTION TRACKING TABLE COMMANDS"
210 The following commands are useful for debugging and configuring
211 the connection tracking table in the datapath.
212 .
213 .PP
214 The \fIdp\fR argument to each of these commands is optional when
215 exactly one datapath exists, in which case that datapath is the
216 default. When multiple datapaths exist, then a datapath name is
217 required.
218 .
219 .PP
220 \fBN.B.\fR(Linux specific): the \fIsystem\fR datapaths (i.e. the Linux
221 kernel module Open vSwitch datapaths) share a single connection tracking
222 table (which is also used by other kernel subsystems, such as iptables,
223 nftables and the regular host stack). Therefore, the following commands
224 do not apply specifically to one datapath.
225 .
226 .TP
227 \*(DX\fBipf\-set\-enabled\fR [\fIdp\fR] \fBv4\fR|\fBv6\fR
228 .TQ
229 \*(DX\fBipf\-set\-disabled\fR [\fIdp\fR] \fBv4\fR|\fBv6\fR
230 Enables or disables IP fragmentation handling for the userspace
231 connection tracker. Either \fBv4\fR or \fBv6\fR must be specified.
232 Both IPv4 and IPv6 fragment reassembly are enabled by default. Only
233 supported for the userspace datapath.
234 .
235 .TP
236 \*(DX\fBipf\-set\-min\-frag\fR [\fIdp\fR] \fBv4\fR|\fBv6\fR \fIminfrag\fR
237 Sets the minimum fragment size (L3 header and data) for non-final fragments to
238 \fIminfrag\fR. Either \fBv4\fR or \fBv6\fR must be specified. For
239 enhanced DOS security, higher minimum fragment sizes can usually be used.
240 The default IPv4 value is 1200 and the clamped minimum is 400. The default
241 IPv6 value is 1280, with a clamped minimum of 400, for testing
242 flexibility. The maximum fragment size is not clamped, however, setting
243 this value too high might result in valid fragments being dropped. Only
244 supported for userspace datapath.
245 .
246 .TP
247 \*(DX\fBipf\-set\-max\-nfrags\fR [\fIdp\fR] \fImaxfrags\fR
248 Sets the maximum number of fragments tracked by the userspace datapath
249 connection tracker to \fImaxfrags\fR. The default value is 1000 and the
250 clamped maximum is 5000. Note that packet buffers can be held by the
251 fragmentation module while fragments are incomplete, but will timeout
252 after 15 seconds. Memory pool sizing should be set accordingly when
253 fragmentation is enabled. Only supported for userspace datapath.
254 .
255 .TP
256 .DO "[\fB\-m\fR | \fB\-\-more\fR]" "\*(DX\fBipf\-get\-status\fR [\fIdp\fR]"
257 Gets the configuration settings and fragment counters associated with the
258 fragmentation handling of the userspace datapath connection tracker.
259 With \fB\-m\fR or \fB\-\-more\fR, also dumps the IP fragment lists.
260 Only supported for userspace datapath.
261 .
262 .TP
263 .DO "[\fB\-m\fR | \fB\-\-more\fR] [\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBdump\-conntrack\fR" "[\fIdp\fR] [\fBzone=\fIzone\fR]"
264 Prints to the console all the connection entries in the tracker used by
265 \fIdp\fR. If \fBzone=\fIzone\fR is specified, only shows the connections
266 in \fIzone\fR. With \fB\-\-more\fR, some implementation specific details
267 are included. With \fB\-\-statistics\fR timeouts and timestamps are
268 added to the output.
269 .
270 .TP
271 \*(DX\fBflush\-conntrack\fR [\fIdp\fR] [\fBzone=\fIzone\fR] [\fIct-tuple\fR]
272 Flushes the connection entries in the tracker used by \fIdp\fR based on
273 \fIzone\fR and connection tracking tuple \fIct-tuple\fR.
274 If \fIct-tuple\fR is not provided, flushes all the connection entries.
275 If \fBzone\fR=\fIzone\fR is specified, only flushes the connections in
276 \fIzone\fR.
277 .IP
278 If \fIct-tuple\fR is provided, flushes the connection entry specified by
279 \fIct-tuple\fR in \fIzone\fR. The zone defaults to 0 if it is not provided.
280 The userspace connection tracker requires flushing with the original pre-NATed
281 tuple and a warning log will be otherwise generated.
282 An example of an IPv4 ICMP \fIct-tuple\fR:
283 .IP
284 "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"
285 .IP
286 An example of an IPv6 TCP \fIct-tuple\fR:
287 .IP
288 "ct_ipv6_src=fc00::1,ct_ipv6_dst=fc00::2,ct_nw_proto=6,ct_tp_src=1,ct_tp_dst=2"
289 .
290 .TP
291 .DO "[\fB\-m\fR | \fB\-\-more\fR]" "\*(DX\fBct\-stats\-show\fR [\fIdp\fR] [\fBzone=\fIzone\fR]"
292 Displays the number of connections grouped by protocol used by \fIdp\fR.
293 If \fBzone=\fIzone\fR is specified, numbers refer to the connections in
294 \fIzone\fR. With \fB\-\-more\fR, groups by connection state for each
295 protocol.
296 .
297 .TP
298 \*(DX\fBct\-bkts\fR [\fIdp\fR] [\fBgt=\fIthreshold\fR]
299 For each conntrack bucket, displays the number of connections used
300 by \fIdp\fR.
301 If \fBgt=\fIthreshold\fR is specified, bucket numbers are displayed when
302 the number of connections in a bucket is greater than \fIthreshold\fR.
303 .
304 .TP
305 \*(DX\fBct\-set\-maxconns\fR [\fIdp\fR] \fImaxconns\fR
306 Sets the maximum limit of connection tracker entries to \fImaxconns\fR
307 on \fIdp\fR. This can be used to reduce the processing load on the
308 system due to connection tracking or simply limiting connection
309 tracking. If the number of connections is already over the new maximum
310 limit request then the new maximum limit will be enforced when the
311 number of connections decreases to that limit, which normally happens
312 due to connection expiry. Only supported for userspace datapath.
313 .
314 .TP
315 \*(DX\fBct\-get\-maxconns\fR [\fIdp\fR]
316 Prints the maximum limit of connection tracker entries on \fIdp\fR.
317 Only supported for userspace datapath.
318 .
319 .TP
320 \*(DX\fBct\-get\-nconns\fR [\fIdp\fR]
321 Prints the current number of connection tracker entries on \fIdp\fR.
322 Only supported for userspace datapath.
323 .
324 .TP
325 \*(DX\fBct\-enable\-tcp\-seq\-chk\fR [\fIdp\fR]
326 .TQ
327 \*(DX\fBct\-disable\-tcp\-seq\-chk\fR [\fIdp\fR]
328 Enables or disables TCP sequence checking. When set to disabled, all sequence
329 number verification is disabled, including for TCP resets. This is
330 similar, but not the same as 'be_liberal' mode, as in Netfilter. Disabling
331 sequence number verification is not an optimization in itself, but is needed
332 for some hardware offload support which might offer some performance
333 advantage. Sequence number checking is enabled by default to enforce better
334 security and should only be disabled if required for hardware offload support.
335 This command is only supported for the userspace datapath.
336 .
337 .TP
338 \*(DX\fBct\-get\-tcp\-seq\-chk\fR [\fIdp\fR]
339 Prints whether TCP sequence checking is enabled or disabled on \fIdp\fR. Only
340 supported for the userspace datapath.
341 .
342 .TP
343 \*(DX\fBct\-set\-limits\fR [\fIdp\fR] [\fBdefault=\fIdefault_limit\fR] [\fBzone=\fIzone\fR,\fBlimit=\fIlimit\fR]...
344 Sets the maximum allowed number of connections in a connection tracking
345 zone. A specific \fIzone\fR may be set to \fIlimit\fR, and multiple zones
346 may be specified with a comma-separated list. If a per-zone limit for a
347 particular zone is not specified in the datapath, it defaults to the
348 default per-zone limit. A default zone may be specified with the
349 \fBdefault=\fIdefault_limit\fR argument. Initially, the default
350 per-zone limit is unlimited. An unlimited number of entries may be set
351 with \fB0\fR limit.
352 .
353 .TP
354 \*(DX\fBct\-del\-limits\fR [\fIdp\fR] \fBzone=\fIzone[,zone]\fR...
355 Deletes the connection tracking limit for \fIzone\fR. Multiple zones may
356 be specified with a comma-separated list.
357 .
358 .TP
359 \*(DX\fBct\-get\-limits\fR [\fIdp\fR] [\fBzone=\fIzone\fR[\fB,\fIzone\fR]...]
360 Retrieves the maximum allowed number of connections and current
361 counts per-zone. If \fIzone\fR is given, only the specified zone(s) are
362 printed. If no zones are specified, all the zone limits and counts are
363 provided. The command always displays the default zone limit.