]> git.proxmox.com Git - mirror_ovs.git/blame - lib/dpctl.man
stopwatch: Remove tabs from output.
[mirror_ovs.git] / lib / dpctl.man
CommitLineData
f4b72cb4
BP
1Do 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.
fceef209
DDP
4.TP
5\*(DX\fBadd\-dp \fIdp\fR [\fInetdev\fR[\fB,\fIoption\fR]...]
6Creates datapath \fIdp\fR, with a local port also named \fIdp\fR.
7This will fail if a network device \fIdp\fR already exists.
8.IP
9If \fInetdev\fRs are specified, \fB\*(PN\fR adds them to the
10new datapath, just as if \fBadd\-if\fR was specified.
11.
12.TP
13\*(DX\fBdel\-dp \fIdp\fR
14Deletes datapath \fIdp\fR. If \fIdp\fR is associated with any network
15devices, they are automatically removed.
16.
17.TP
18\*(DX\fBadd\-if \fIdp netdev\fR[\fB,\fIoption\fR]...
19Adds each \fInetdev\fR to the set of network devices datapath
20\fIdp\fR monitors, where \fIdp\fR is the name of an existing
21datapath, and \fInetdev\fR is the name of one of the host's
22network devices, e.g. \fBeth0\fR. Once a network device has been added
23to a datapath, the datapath has complete ownership of the network device's
24traffic and the network device appears silent to the rest of the
25system.
26.IP
27A \fInetdev\fR may be followed by a comma-separated list of options.
28The following options are currently supported:
29.
30.RS
31.IP "\fBtype=\fItype\fR"
32Specifies the type of port to add. The default type is \fBsystem\fR.
33.IP "\fBport_no=\fIport\fR"
34Requests a specific port number within the datapath. If this option is
35not specified then one will be automatically assigned.
36.IP "\fIkey\fB=\fIvalue\fR"
37Adds 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
41options.
42.
43.IP "\*(DX\fBset\-if \fIdp port\fR[\fB,\fIoption\fR]..."
44Reconfigures each \fIport\fR in \fIdp\fR as specified. An
45\fIoption\fR of the form \fIkey\fB=\fIvalue\fR adds the specified
46key-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,
48deletes the key-value named \fIkey\fR. The type and port number of a
49port cannot be changed, so \fBtype\fR and \fBport_no\fR are only allowed if
50they match the existing configuration.
51.TP
52\*(DX\fBdel\-if \fIdp netdev\fR...
53Removes each \fInetdev\fR from the list of network devices datapath
54\fIdp\fR monitors.
55.
56.TP
57\*(DX\fBdump\-dps\fR
58Prints 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...]"
62Prints a summary of configured datapaths, including their datapath
63numbers and a list of ports connected to each datapath. (The local
64port is identified as port 0.) If \fB\-s\fR or \fB\-\-statistics\fR
65is specified, then packet and byte counters are also printed for each
66port.
67.IP
68The datapath numbers consists of flow stats and mega flow mask stats.
69.IP
70The "lookups" row displays three stats related to flow lookup triggered
71by processing incoming packets in the datapath. "hit" displays number
72of packets matches existing flows. "missed" displays the number of
73packets not matching any existing flow and require user space processing.
74"lost" displays number of packets destined for user space process but
75subsequently dropped before reaching userspace. The sum of "hit" and "miss"
76equals to the total number of packets datapath processed.
77.IP
78The "flows" row displays the number of flows in datapath.
79.IP
80The "masks" row displays the mega flow mask stats. This row is omitted
81for datapath not implementing mega flow. "hit" displays the total number
82of masks visited for matching incoming packets. "total" displays number of
83masks in the datapath. "hit/pkt" displays the average number of masks
84visited per packet; the ratio between "hit" and total number of
d1fd1ea9 85packets processed by the datapath.
fceef209
DDP
86.IP
87If one or more datapaths are specified, information on only those
88datapaths are displayed. Otherwise, \fB\*(PN\fR displays information
89about all configured datapaths.
90.SS "DATAPATH FLOW TABLE DEBUGGING COMMANDS"
91The following commands are primarily useful for debugging Open
92vSwitch. The flow table entries (both matches and actions) that they
93work with are not OpenFlow flow entries. Instead, they are different
94and considerably simpler flows maintained by the Open vSwitch kernel
f4b72cb4
BP
95module. Do not use commands to add or remove or modify datapath flows
96if \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.
fceef209
DDP
99.
100.PP
101The \fIdp\fR argument to each of these commands is optional when
102exactly one datapath exists, in which case that datapath is the
103default. When multiple datapaths exist, then a datapath name is
104required.
105.
106.TP
d1fd1ea9 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]"
fceef209
DDP
108Prints to the console all flow entries in datapath \fIdp\fR's flow
109table. Without \fB\-m\fR or \fB\-\-more\fR, output omits match fields
110that a flow wildcards entirely; with \fB\-m\fR or \fB\-\-more\fR,
111output includes all wildcarded fields.
112.IP
113If \fBfilter=\fIfilter\fR is specified, only displays the flows
114that match the \fIfilter\fR. \fIfilter\fR is a flow in the form similiar
115to that accepted by \fBovs\-ofctl\fR(8)'s \fBadd\-flow\fR command. (This is
116not an OpenFlow flow: besides other differences, it never contains wildcards.)
117The \fIfilter\fR is also useful to match wildcarded fields in the datapath
118flow. As an example, \fBfilter='tcp,tp_src=100'\fR will match the
119datapath flow containing '\fBtcp(src=80/0xff00,dst=8080/0xff)\fR'.
7e8b7199
PB
120.IP
121If \fBtype=\fItype\fR is specified, only displays flows of a specific type.
122\fItype\fR can be \fBoffloaded\fR to display only offloaded rules or \fBOVS\fR
123to display only non-offloaded rules.
124By default both offloaded and non-offloaded rules are displayed.
fceef209
DDP
125.
126.IP "\*(DX\fBadd\-flow\fR [\fIdp\fR] \fIflow actions\fR"
127.TP
128.DO "[\fB\-\-clear\fR] [\fB\-\-may-create\fR] [\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBmod\-flow\fR" "[\fIdp\fR] \fIflow actions\fR"
129Adds or modifies a flow in \fIdp\fR's flow table that, when a packet
130matching \fIflow\fR arrives, causes \fIactions\fR to be executed.
131.IP
132The \fBadd\-flow\fR command succeeds only if \fIflow\fR does not
133already exist in \fIdp\fR. Contrariwise, \fBmod\-flow\fR without
134\fB\-\-may\-create\fR only modifies the actions for an existing flow.
135With \fB\-\-may\-create\fR, \fBmod\-flow\fR will add a new flow or
136modify an existing one.
137.IP
138If \fB\-s\fR or \fB\-\-statistics\fR is specified, then
d0c4f1dc 139\fBmod\-flow\fR prints the modified flow's statistics. A flow's
fceef209
DDP
140statistics are the number of packets and bytes that have passed
141through the flow, the elapsed time since the flow last processed a
142packet (if ever), and (for TCP flows) the union of the TCP flags
143processed through the flow.
144.IP
d0c4f1dc 145With \fB\-\-clear\fR, \fBmod\-flow\fR zeros out the flow's
fceef209
DDP
146statistics. The statistics printed if \fB\-s\fR or
147\fB\-\-statistics\fR is also specified are those from just before
148clearing the statistics.
07e0337b
AC
149.IP
150NOTE:
151\fIflow\fR and \fIactions\fR do not match the syntax used with
152\fBovs\-ofctl\fR(8)'s \fBadd\-flow\fR command.
153.
154.IP
155\fBUsage Examples\fR
156.
157.RS
158.PP
159Forward ARP between ports 1 and 2 on datapath myDP:
160.IP
161ovs-dpctl add-flow myDP \\
162.
163 "in_port(1),eth(),eth_type(0x0806),arp()" 2
164.
165.IP
166ovs-dpctl add-flow myDP \\
fceef209 167.
07e0337b
AC
168 "in_port(2),eth(),eth_type(0x0806),arp()" 1
169.
170.PP
171Forward all IPv4 traffic between two addresses on ports 1 and 2:
172.
173.IP
174ovs-dpctl add-flow myDP \\
175.
176 "in_port(1),eth(),eth_type(0x800),\\
177 ipv4(src=172.31.110.4,dst=172.31.110.5)" 2
178.
179.IP
180ovs-dpctl add-flow myDP \\
181.
182 "in_port(2),eth(),eth_type(0x800),\\
183 ipv4(src=172.31.110.5,dst=172.31.110.4)" 1
184.
185.RE
fceef209
DDP
186.TP
187.DO "[\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBdel\-flow\fR" "[\fIdp\fR] \fIflow\fR"
188Deletes the flow from \fIdp\fR's flow table that matches \fIflow\fR.
189If \fB\-s\fR or \fB\-\-statistics\fR is specified, then
d0c4f1dc 190\fBdel\-flow\fR prints the deleted flow's statistics.
fceef209 191.
d1fd1ea9
BP
192.TP
193.DO "[\fB\-m \fR| \fB\-\-more\fR] [\fB\-\-names \fR| \fB\-\-no\-names\fR]" "\*(DX\fBget\-flow\fR [\fIdp\fR] ufid:\fIufid\fR"
818650e6
JS
194Fetches the flow from \fIdp\fR's flow table with unique identifier \fIufid\fR.
195\fIufid\fR must be specified as a string of 32 hexadecimal characters.
196.
fceef209
DDP
197.IP "\*(DX\fBdel\-flows\fR [\fIdp\fR]"
198Deletes all flow entries from datapath \fIdp\fR's flow table.
dffae65f
DDP
199.SS "CONNECTION TRACKING TABLE DEBUGGING COMMANDS"
200The following commands are primarily useful for debugging the connection
201tracking entries in the datapath.
202.
203.PP
204The \fIdp\fR argument to each of these commands is optional when
205exactly one datapath exists, in which case that datapath is the
206default. When multiple datapaths exist, then a datapath name is
207required.
208.
209.PP
210\fBN.B.\fR(Linux specific): the \fIsystem\fR datapaths (i.e. the Linux
211kernel module Open vSwitch datapaths) share a single connection tracking
212table (which is also used by other kernel subsystems, such as iptables,
213nftables and the regular host stack). Therefore, the following commands
214do not apply specifically to one datapath.
215.
216.TP
217.DO "[\fB\-m\fR | \fB\-\-more\fR] [\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBdump\-conntrack\fR" "[\fIdp\fR] [\fBzone=\fIzone\fR]"
218Prints to the console all the connection entries in the tracker used by
219\fIdp\fR. If \fBzone=\fIzone\fR is specified, only shows the connections
220in \fBzone\fR. With \fB\-\-more\fR, some implementation specific details
221are included. With \fB\-\-statistics\fR timeouts and timestamps are
222added to the output.
7f278d1f
DDP
223.
224.TP
c43a1331
YHW
225\*(DX\fBflush\-conntrack\fR [\fIdp\fR] [\fBzone=\fIzone\fR] [\fIct-tuple\fR]
226Flushes the connection entries in the tracker used by \fIdp\fR based on
227\fIzone\fR and connection tracking tuple \fIct-tuple\fR.
228If \fIct-tuple\fR is not provided, flushes all the connection entries.
229If \fBzone\fR=\fIzone\fR is specified, only flushes the connections in
230\fIzone\fR.
231.IP
232If \fIct-tuple\fR is provided, flushes the connection entry specified by
233\fIct-tuple\fR in \fIzone\fR. The zone defaults to 0 if it is not provided.
234An example of an IPv4 ICMP \fIct-tuple\fR:
235.IP
236"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"
237.IP
238An example of an IPv6 TCP \fIct-tuple\fR:
239.IP
240"ct_ipv6_src=fc00::1,ct_ipv6_dst=fc00::2,ct_nw_proto=6,ct_tp_src=1,ct_tp_dst=2"
8a0d9d85
FA
241.
242.TP
243\*(DX\fBct\-stats\-show\fR [\fIdp\fR] [\fBzone=\fIzone\fR] [\fBverbose\fR]
244Displays the number of connections grouped by protocol used by \fIdp\fR.
245If \fBzone=\fIzone\fR is specified, numbers refer to the connections in
246\fBzone\fR. The \fBverbose\fR option allows to group by connection state
247for each protocol.
ded30c74
FA
248.
249.TP
250\*(DX\fBct\-bkts\fR [\fIdp\fR] [\fBgt=\fIThreshold\fR]
251For each ConnTracker bucket, displays the number of connections used
252by \fIdp\fR.
253If \fBgt=\fIThreshold\fR is specified, bucket numbers are displayed when
254the number of connections in a bucket is greater than \fIThreshold\fR.
c92339ad
DB
255.
256.TP
257\*(DX\fBct\-set\-maxconns\fR [\fIdp\fR] \fBparam\fR
258Set the maximum limit of connection tracker connections.
259Can be used to reduce the processing load on the system due to
260connection tracking or simply limiting connection tracking.
261If the number of connections is already beyond the new maximum limit
262request for the number of connections then the new maximum limit will
263be enforced when the number of connections decreases to that limit, which
264normally happens due to connection expiry. Only supported for userspace
265datapath.
266.
267.TP
268\*(DX\fBct\-get\-maxconns\fR [\fIdp\fR]
269Read the maximum limit of connection tracker connections.
270Only supported for userspace datapath.
875075b3
DB
271.
272.TP
273\*(DX\fBct\-get\-nconns\fR [\fIdp\fR]
274Read the current number of connection tracker connections.
275Only supported for userspace datapath.