identified as dp0 (see ovs-dpctl(8) for more detailed usage
information).
- # ovs-dpctl adddp dp0
+ # ovs-dpctl add-dp dp0
(dp0 is the first datapath within a host. openvswitch_mod supports
multiple datapaths within the same host, which would be identified
switch using interfaces eth1 and eth2, you would issue the
following commands:
- # ovs-dpctl addif dp0 eth1
- # ovs-dpctl addif dp0 eth2
+ # ovs-dpctl add-if dp0 eth1
+ # ovs-dpctl add-if dp0 eth2
You can verify that the interfaces were successfully added by asking
ovs-dpctl to print the current status of datapath dp0:
check_op "Removing IP address from $netdev" ifconfig $netdev 0.0.0.0
done
- must_succeed "Creating datapath" ovs-dpctl adddp of0 $NETDEVS
+ must_succeed "Creating datapath" ovs-dpctl add-dp of0 $NETDEVS
xx='[0-9abcdefABCDEF][0-9abcdefABCDEF]'
case $DATAPATH_ID in
--exec $DAEMON
echo "$NAME."
- check_op "Deleting datapath" ovs-dpctl deldp of0
+ check_op "Deleting datapath" ovs-dpctl del-dp of0
check_op "Unloading kernel module" modprobe -r openvswitch_mod
;;
force-stop)
In this configuration, OpenFlow traffic uses a network separate from
the data traffic that it controls, that is, the switch does not use
any of the network devices added to the datapath with \fBovs\-dpctl
-addif\fR in its communication with the controller.
+add\-if\fR in its communication with the controller.
To use \fBsecchan\fR in a network with out-of-band control, specify
\fB--out-of-band\fR on the \fBsecchan\fR command line. The control
In this configuration, a single network is used for OpenFlow traffic
and other data traffic, that is, the switch contacts the controller
over one of the network devices added to the datapath with \fBovs\-dpctl
-addif\fR. This configuration is often more convenient than
+add\-if\fR. This configuration is often more convenient than
out-of-band control, because it is not necessary to maintain two
independent networks.
In this mode, \fBsecchan\fR will broadcast a DHCP request with vendor
class identifier \fBOpenFlow\fR across the network devices added to
-the datapath with \fBovs\-dpctl addif\fR. It will accept any valid DHCP
+the datapath with \fBovs\-dpctl add\-if\fR. It will accept any valid DHCP
reply that has the same vendor class identifier and includes a
vendor-specific option with code 1 whose contents are a string
specifying the location of the controller in the same format used on
``local port'' to allow \fBsecchan\fR to connect to that controller.
The OpenFlow local port is a virtual network port that \fBsecchan\fR
bridges to the physical switch ports. The name of the local port for
-a given \fIdatapath\fR may be seen by running \fBovs\-dpctl dp-show
-\fIdatapath\fR; the local port is listed as port 0 in \fBdp-show\fR's
+a given \fIdatapath\fR may be seen by running \fBovs\-dpctl show
+\fIdatapath\fR; the local port is listed as port 0 in \fBshow\fR's
output.
.IP
.SH BUGS
If the network devices specified on the command line have been added
-to an OpenVSwitch datapath with \fBovs\-dpctl addif\fR, then controller
+to an OpenVSwitch datapath with \fBovs\-dpctl add\-if\fR, then controller
discovery will fail because \fBovs\-discover\fR will not be able to
see DHCP responses, even though tools such as \fBtcpdump\fR(8) and
\fBwireshark\fR(1) can see them on the wire. This is because of the
virtual network device sometimes called the datapath's ``local port''.
A newly created datapath is not, however, associated with any of the
host's other network devices. To intercept and process traffic on a
-given network device, use the \fBaddif\fR command to explicitly add
+given network device, use the \fBadd\-if\fR command to explicitly add
that network device to the datapath.
Do not use \fBovs\-dpctl\fR commands to modify datapaths if
The following commands manage datapaths.
.TP
-\fBadddp \fIdp\fR [\fInetdev\fR...]
+\fBadd\-dp \fIdp\fR [\fInetdev\fR...]
Creates datapath \fIdp\fR. The name of the new datapath's local port
depends on how \fIdp\fR is specified: if it takes the form
If \fInetdev\fRs are specified, \fBovs\-dpctl\fR adds them to the datapath.
.TP
-\fBdeldp \fIdp\fR
+\fBdel\-dp \fIdp\fR
Deletes datapath \fIdp\fR. If \fIdp\fR is associated with any network
devices, they are automatically removed.
.TP
-\fBaddif \fIdp netdev\fR[\fIoption\fR...]...
+\fBadd\-if \fIdp netdev\fR[\fIoption\fR...]...
Adds each \fInetdev\fR to the set of network devices datapath
\fIdp\fR monitors, where \fIdp\fR is the name of an existing
datapath, and \fInetdev\fR is the name of one of the host's
.RS
.IP "\fBport=\fIportno\fR"
Specifies \fIportno\fR (a number between 1 and 255) as the port number
-at which \fInetdev\fR will be attached. By default, \fBaddif\fR
+at which \fInetdev\fR will be attached. By default, \fBadd\-if\fR
automatically selects the lowest available port number.
.IP "\fBinternal\fR"
.RE
.TP
-\fBdelif \fIdp netdev\fR...
+\fBdel\-if \fIdp netdev\fR...
Removes each \fInetdev\fR from the list of network devices datapath
\fIdp\fR monitors.
.TP
-\fBdp-show \fR[\fIdp\fR...]
+\fBshow \fR[\fIdp\fR...]
Prints a summary of configured datapaths, including their datapath
numbers and a list of ports connected to each datapath. (The local
port is identified as port 0.)
datapaths are displayed. Otherwise, \fBovs\-dpctl\fR displays information
about all configured datapaths.
-.IP "\fBdp-dump-flows \fIdp\fR"
+.IP "\fBdump-flows \fIdp\fR"
Prints to the console all flow entries in datapath \fIdp\fR's
flow table.
OpenFlow flow entries. Instead, they are different and considerably
simpler flows maintained by the OpenVSwitch kernel module.
-.IP "\fBdp-del-flows \fIdp\fR"
+.IP "\fBdel-flows \fIdp\fR"
Deletes all flow entries from datapath \fIdp\fR's flow table.
This command is primarily useful for debugging OpenVSwitch. As
-discussed in \fBdp-dump-flows\fR, these entries are
+discussed in \fBdump-flows\fR, these entries are
not OpenFlow flow entries. By deleting them, the process that set them
up may be confused about their disappearance.
-.IP "\fBdp-dump-groups \fIdp\fR"
+.IP "\fBdump-groups \fIdp\fR"
Prints to the console the sets of port groups maintained by datapath
\fIdp\fR. Ordinarily there are at least 2 port groups in a datapath
that \fBsecchan\fR or \fBvswitch\fR is controlling: group 0 contains
OpenVSwitch kernel module:
.TP
-\fBovs\-dpctl adddp dp0\fR
+\fBovs\-dpctl add\-dp dp0\fR
Creates datapath number 0.
.TP
-\fBovs\-dpctl addif dp0 eth0 eth1\fR
+\fBovs\-dpctl add\-if dp0 eth0 eth1\fR
Adds two network devices to the new datapath.
.PP
the switch and the datapath is no longer needed:
.TP
-\fBovs\-dpctl delif dp0 eth0 eth1\fR
+\fBovs\-dpctl del\-if dp0 eth0 eth1\fR
Removes network devices from the datapath.
.TP
-\fBovs\-dpctl deldp dp0\fR
+\fBovs\-dpctl del\-dp dp0\fR
Deletes the datapath.
.SH "SEE ALSO"
{
printf("%s: OpenVSwitch datapath management utility\n"
"usage: %s [OPTIONS] COMMAND [ARG...]\n"
- " adddp DP [IFACE...] add new datapath DP (with IFACES)\n"
- " deldp DP delete local datapath DP\n"
- " addif DP IFACE... add each IFACE as a port on DP\n"
- " delif DP IFACE... delete each IFACE from DP\n"
- " dp-show show basic info on all datapaths\n"
- " dp-show DP... show basic info on each DP\n"
- " dp-dump-flows DP display flows in DP\n"
- " dp-del-flows DP delete all flows from DP\n"
- " dp-dump-groups DP display port groups in DP\n",
+ " add-dp DP [IFACE...] add new datapath DP (with IFACEs)\n"
+ " del-dp DP delete local datapath DP\n"
+ " add-if DP IFACE... add each IFACE as a port on DP\n"
+ " del-if DP IFACE... delete each IFACE from DP\n"
+ " show show basic info on all datapaths\n"
+ " show DP... show basic info on each DP\n"
+ " dump-flows DP display flows in DP\n"
+ " del-flows DP delete all flows from DP\n"
+ " dump-groups DP display port groups in DP\n",
program_name, program_name);
vlog_usage();
printf("\nOther options:\n"
}
}
\f
-static void do_add_port(int argc, char *argv[]);
+static void do_add_if(int argc, char *argv[]);
static int if_up(const char *netdev_name)
{
run(dpif_create(argv[1], &dpif), "add_dp");
dpif_close(&dpif);
if (argc > 2) {
- do_add_port(argc, argv);
+ do_add_if(argc, argv);
}
}
}
static void
-do_add_port(int argc UNUSED, char *argv[])
+do_add_if(int argc UNUSED, char *argv[])
{
bool failure = false;
struct dpif dpif;
}
static void
-do_del_port(int argc UNUSED, char *argv[])
+do_del_if(int argc UNUSED, char *argv[])
{
bool failure = false;
struct dpif dpif;
}
static void
-do_dp_show(int argc UNUSED, char *argv[])
+do_show(int argc UNUSED, char *argv[])
{
bool failure = false;
if (argc > 1) {
}
static void
-do_dp_dump_flows(int argc UNUSED, char *argv[])
+do_dump_flows(int argc UNUSED, char *argv[])
{
struct odp_flow *flows;
struct dpif dpif;
}
static void
-do_dp_del_flows(int argc UNUSED, char *argv[])
+do_del_flows(int argc UNUSED, char *argv[])
{
struct dpif dpif;
}
static void
-do_dp_dump_groups(int argc UNUSED, char *argv[])
+do_dump_groups(int argc UNUSED, char *argv[])
{
struct odp_stats stats;
struct dpif dpif;
}
static struct command all_commands[] = {
- { "adddp", 1, INT_MAX, do_add_dp },
- { "deldp", 1, 1, do_del_dp },
- { "addif", 2, INT_MAX, do_add_port },
- { "delif", 2, INT_MAX, do_del_port },
- { "dp-show", 0, INT_MAX, do_dp_show },
- { "dp-dump-flows", 1, 1, do_dp_dump_flows },
- { "dp-del-flows", 1, 1, do_dp_del_flows },
- { "dp-dump-groups", 1, 1, do_dp_dump_groups },
+ { "add-dp", 1, INT_MAX, do_add_dp },
+ { "del-dp", 1, 1, do_del_dp },
+ { "add-if", 2, INT_MAX, do_add_if },
+ { "del-if", 2, INT_MAX, do_del_if },
+ { "show", 0, INT_MAX, do_show },
+ { "dump-flows", 1, 1, do_dump_flows },
+ { "del-flows", 1, 1, do_del_flows },
+ { "dump-groups", 1, 1, do_dump_groups },
{ "help", 0, INT_MAX, do_help },
{ NULL, 0, 0, NULL },
};
static int
handle_port_cmd(struct ofpbuf *buffer, bool add)
{
- const char *cmd_name = add ? "addif" : "delif";
+ const char *cmd_name = add ? "add-if" : "del-if";
struct nlattr *attrs[ARRAY_SIZE(brc_port_policy)];
const char *br_name, *port_name;
int retval;
* queued up from it.
*
* - Someone externally added an interface (e.g. with "ovs-dpctl
- * addif") that we don't know about.
+ * add-if") that we don't know about.
*
* - Packet arrived on the local port but the local port is not
* one of our bridge ports.
fi
function dp_list {
- "$dpctl" dp-show | grep '^dp[0-9]\+:' | cut -d':' -f 1
+ "$dpctl" show | grep '^dp[0-9]\+:' | cut -d':' -f 1
}
function dp_intf {
local dp=$1
# Currently port0 is hardcoded to be the local port.
- "$dpctl" dp-show $dp | grep 'port 0:' | cut -d' ' -f 3
+ "$dpctl" show $dp | grep 'port 0:' | cut -d' ' -f 3
}
function ifdown_dp_intf {
function remove_all_dp {
for dp in $(dp_list); do
- action "Removing datapath: $dp" "$dpctl" deldp "$dp"
+ action "Removing datapath: $dp" "$dpctl" del-dp "$dp"
done
}
}
function watchdp {
- watch ovs-dpctl dp-show "$@"
+ watch ovs-dpctl show "$@"
}
function watchdpflows {
if [ $# -gt 0 ]; then
grep="| grep $@"
fi
- watch "ovs-dpctl dp-dump-flows $dp $grep"
+ watch "ovs-dpctl dump-flows $dp $grep"
}
function watchflows {
local grep=""
local dp=$1
shift
- bridge=$(ovs-dpctl dp-show $dp | grep 'port 0:' | cut -d' ' -f 3)
+ bridge=$(ovs-dpctl show $dp | grep 'port 0:' | cut -d' ' -f 3)
if [ $# -gt 0 ]; then
grep="| grep $@"
fi