From patchwork Fri Jun 29 19:13:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 937113 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41HRHY2XRVz9ry1 for ; Sat, 30 Jun 2018 05:17:45 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EBC8ADDD; Fri, 29 Jun 2018 19:14:06 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 11761DD1 for ; Fri, 29 Jun 2018 19:14:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3824577E for ; Fri, 29 Jun 2018 19:14:03 +0000 (UTC) X-Originating-IP: 76.21.1.228 Received: from localhost.localdomain (unknown [76.21.1.228]) (Authenticated sender: jpettit@ovn.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 4D4B9E0005 for ; Fri, 29 Jun 2018 19:14:01 +0000 (UTC) From: Justin Pettit To: dev@openvswitch.org Date: Fri, 29 Jun 2018 12:13:54 -0700 Message-Id: <20180629191354.76641-6-jpettit@ovn.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180629191354.76641-1-jpettit@ovn.org> References: <20180629191354.76641-1-jpettit@ovn.org> X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 6/6] ovs-ofctl: Prefer "del-meters" and "dump-meters". X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 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 --- utilities/ovs-ofctl.8.in | 21 +++++++++++---------- 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 8c6fe2021cfb..5f26c4cca34a 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 029a1c8b97a1..0cd0fcb63e4b 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",