diff options
author | Justin Pettit <jpettit@ovn.org> | 2018-06-29 12:02:28 -0700 |
---|---|---|
committer | Justin Pettit <jpettit@ovn.org> | 2018-07-06 14:23:30 -0700 |
commit | 04f803fddc8df4312cc2bef6ed8a7c4d000990d9 (patch) | |
tree | 2b881c514c9e289f06136968f3596b728d9e5569 /utilities | |
parent | 425a7b9eaf7c69761965552dfd84031c8f4356b7 (diff) | |
download | openvswitch-04f803fddc8df4312cc2bef6ed8a7c4d000990d9.tar.gz |
ovs-ofctl: Prefer "del-meters" and "dump-meters".
Previously to delete or dump the meter table, separate commands had to
be used depending on whether one wanted to operate on a single or all
meters. This change makes it so that the "meter" argument is always
optional regardless of the command. This is a bit more consistent with
other OVS commands and makes it easier when experimenting to not have to
distinguish between the two cases.
This also fixes an error in the ovs-ofctl man page that show the plural
version of the command supported an optional "meter" argument.
"del-meter" and "dump-meter" can still be used, but their use is no
longer documented.
Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/ovs-ofctl.8.in | 21 | ||||
-rw-r--r-- | utilities/ovs-ofctl.c | 14 |
2 files changed, 17 insertions, 18 deletions
diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in index 8c6fe2021..5f26c4cca 100644 --- a/utilities/ovs-ofctl.8.in +++ b/utilities/ovs-ofctl.8.in @@ -459,16 +459,17 @@ described in section \fBMeter Syntax\fR, below. .IP "\fBmod\-meter \fIswitch meter\fR" Modify an existing meter. . -.IP "\fBdel\-meters \fIswitch\fR" -.IQ "\fBdel\-meter \fIswitch\fR [\fImeter\fR]" -Delete entries from \fIswitch\fR's meter table. \fImeter\fR can specify -a single meter with syntax \fBmeter=\fIid\fR, or all meters with syntax -\fBmeter=all\fR. -. -.IP "\fBdump\-meters \fIswitch\fR" -.IQ "\fBdump\-meter \fIswitch\fR [\fImeter\fR]" -Print meter configuration. \fImeter\fR can specify a single meter with -syntax \fBmeter=\fIid\fR, or all meters with syntax \fBmeter=all\fR. +.IP "\fBdel\-meters \fIswitch\fR [\fImeter\fR]" +Delete entries from \fIswitch\fR's meter table. To delete only a +specific meter, specify its number as \fImeter\fR. Otherwise, if +\fImeter\fR is omitted, or if it is specified as \fBall\fR, then all +meters are deleted. +. +.IP "\fBdump\-meters \fIswitch\fR [\fImeter\fR]" +Print entries from \fIswitch\fR's meter table. To print only a +specific meter, specify its number as \fImeter\fR. Otherwise, if +\fImeter\fR is omitted, or if it is specified as \fBall\fR, then all +meters are printed. . .IP "\fBmeter\-stats \fIswitch\fR [\fImeter\fR]" Print meter statistics. \fImeter\fR can specify a single meter with diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 029a1c8b9..0cd0fcb63 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -477,10 +477,8 @@ usage(void) " queue-get-config SWITCH [PORT] print queue config for PORT\n" " add-meter SWITCH METER add meter described by METER\n" " mod-meter SWITCH METER modify specific METER\n" - " del-meter SWITCH METER delete METER\n" - " del-meters SWITCH delete all meters\n" - " dump-meter SWITCH METER print METER configuration\n" - " dump-meters SWITCH print all meter configuration\n" + " del-meters SWITCH [METER] delete meters matching METER\n" + " dump-meters SWITCH [METER] print METER configuration\n" " meter-stats SWITCH [METER] print meter statistics\n" " meter-features SWITCH print meter features\n" " add-tlv-map SWITCH MAP add TLV option MAPpings\n" @@ -4844,13 +4842,13 @@ static const struct ovs_cmdl_command all_commands[] = { { "mod-meter", "switch meter", 2, 2, ofctl_mod_meter, OVS_RW }, { "del-meter", "switch meter", - 2, 2, ofctl_del_meters, OVS_RW }, + 1, 2, ofctl_del_meters, OVS_RW }, { "del-meters", "switch", - 1, 1, ofctl_del_meters, OVS_RW }, + 1, 2, ofctl_del_meters, OVS_RW }, { "dump-meter", "switch meter", - 2, 2, ofctl_dump_meters, OVS_RO }, + 1, 2, ofctl_dump_meters, OVS_RO }, { "dump-meters", "switch", - 1, 1, ofctl_dump_meters, OVS_RO }, + 1, 2, ofctl_dump_meters, OVS_RO }, { "meter-stats", "switch [meter]", 1, 2, ofctl_meter_stats, OVS_RO }, { "meter-features", "switch", |