From 9e087fba39dbf571ee01872796fdacaee3be5255 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 15 May 2009 16:56:33 -0700 Subject: [PATCH] ovs-dpctl: Rename commands for consistency. --- INSTALL | 6 ++-- debian/openvswitch-switch.init | 4 +-- secchan/secchan.8.in | 10 +++--- utilities/ovs-discover.8.in | 2 +- utilities/ovs-dpctl.8.in | 30 +++++++++--------- utilities/ovs-dpctl.c | 50 +++++++++++++++--------------- vswitchd/brcompatd.c | 2 +- vswitchd/bridge.c | 2 +- xenserver/etc_init.d_vswitch | 6 ++-- xenserver/etc_profile.d_vswitch.sh | 6 ++-- 10 files changed, 59 insertions(+), 59 deletions(-) diff --git a/INSTALL b/INSTALL index 5aa7073e..091e75e3 100644 --- a/INSTALL +++ b/INSTALL @@ -324,7 +324,7 @@ The OpenVSwitch kernel module must be loaded, as described under 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 @@ -340,8 +340,8 @@ The OpenVSwitch kernel module must be loaded, as described under 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: diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index 3f96c914..50ea4b8b 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -265,7 +265,7 @@ case "$1" in 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 @@ -385,7 +385,7 @@ case "$1" 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) diff --git a/secchan/secchan.8.in b/secchan/secchan.8.in index 8a842947..c567c785 100644 --- a/secchan/secchan.8.in +++ b/secchan/secchan.8.in @@ -51,7 +51,7 @@ over the network. It can do so in one of two ways: 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 @@ -62,7 +62,7 @@ is started. 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. @@ -80,7 +80,7 @@ automatically, do not specify the location of the controller on the 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 @@ -149,8 +149,8 @@ argument. You must also configure the network device for the OpenFlow ``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 diff --git a/utilities/ovs-discover.8.in b/utilities/ovs-discover.8.in index 423fa42c..9943a3c0 100644 --- a/utilities/ovs-discover.8.in +++ b/utilities/ovs-discover.8.in @@ -100,7 +100,7 @@ effect. .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 diff --git a/utilities/ovs-dpctl.8.in b/utilities/ovs-dpctl.8.in index 72a787f7..fab0a4f5 100644 --- a/utilities/ovs-dpctl.8.in +++ b/utilities/ovs-dpctl.8.in @@ -18,7 +18,7 @@ A newly created datapath is associated with only one network device, a 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 @@ -37,7 +37,7 @@ forms: 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 @@ -53,12 +53,12 @@ exists, or if \fIdp\fR is given in the form \fBdp\fIN\fR or 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 @@ -73,7 +73,7 @@ The following options are currently supported: .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" @@ -82,12 +82,12 @@ port (analogous to the local port) with that name. .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.) @@ -96,7 +96,7 @@ If one or more datapaths are specified, information on only those 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. @@ -105,15 +105,15 @@ table entries that it displays are not 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 @@ -139,11 +139,11 @@ A typical \fBovs\-dpctl\fR command sequence for controlling an 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 @@ -152,11 +152,11 @@ At this point one would ordinarily start \fBsecchan\fR(8) on 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" diff --git a/utilities/ovs-dpctl.c b/utilities/ovs-dpctl.c index 207c94b7..bfd87aff 100644 --- a/utilities/ovs-dpctl.c +++ b/utilities/ovs-dpctl.c @@ -171,15 +171,15 @@ usage(void) { 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" @@ -211,7 +211,7 @@ static void run(int retval, const char *message, ...) } } -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) { @@ -233,7 +233,7 @@ do_add_dp(int argc UNUSED, char *argv[]) run(dpif_create(argv[1], &dpif), "add_dp"); dpif_close(&dpif); if (argc > 2) { - do_add_port(argc, argv); + do_add_if(argc, argv); } } @@ -285,7 +285,7 @@ get_free_port(struct dpif *dpif) } static void -do_add_port(int argc UNUSED, char *argv[]) +do_add_if(int argc UNUSED, char *argv[]) { bool failure = false; struct dpif dpif; @@ -377,7 +377,7 @@ get_port_number(struct dpif *dpif, const char *name, uint16_t *port) } static void -do_del_port(int argc UNUSED, char *argv[]) +do_del_if(int argc UNUSED, char *argv[]) { bool failure = false; struct dpif dpif; @@ -443,7 +443,7 @@ show_dpif(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) { @@ -484,7 +484,7 @@ do_dp_show(int argc UNUSED, char *argv[]) } 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; @@ -514,7 +514,7 @@ do_dp_dump_flows(int argc UNUSED, char *argv[]) } static void -do_dp_del_flows(int argc UNUSED, char *argv[]) +do_del_flows(int argc UNUSED, char *argv[]) { struct dpif dpif; @@ -524,7 +524,7 @@ do_dp_del_flows(int argc UNUSED, char *argv[]) } 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; @@ -557,14 +557,14 @@ do_help(int argc UNUSED, char *argv[] UNUSED) } 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 }, }; diff --git a/vswitchd/brcompatd.c b/vswitchd/brcompatd.c index 929f277c..aecb73ed 100644 --- a/vswitchd/brcompatd.c +++ b/vswitchd/brcompatd.c @@ -414,7 +414,7 @@ static const struct nl_policy brc_port_policy[] = { 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; diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 6fb9ccde..3d7c9173 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1620,7 +1620,7 @@ process_flow(struct bridge *br, const flow_t *flow, * 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. diff --git a/xenserver/etc_init.d_vswitch b/xenserver/etc_init.d_vswitch index 932ba7cb..162f30b3 100755 --- a/xenserver/etc_init.d_vswitch +++ b/xenserver/etc_init.d_vswitch @@ -75,13 +75,13 @@ if [ "$ENABLE_FAKE_PROC_NET" == "y" ]; then 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 { @@ -141,7 +141,7 @@ function turn_on_corefiles { 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 } diff --git a/xenserver/etc_profile.d_vswitch.sh b/xenserver/etc_profile.d_vswitch.sh index 7905491e..631a384f 100644 --- a/xenserver/etc_profile.d_vswitch.sh +++ b/xenserver/etc_profile.d_vswitch.sh @@ -17,7 +17,7 @@ function watchconf { } function watchdp { - watch ovs-dpctl dp-show "$@" + watch ovs-dpctl show "$@" } function watchdpflows { @@ -27,14 +27,14 @@ 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 -- 2.30.2