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