From patchwork Fri Jun 29 19:13:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 937108 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 41HRDS6nqHz9ry1 for ; Sat, 30 Jun 2018 05:15:04 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 63618DAC; Fri, 29 Jun 2018 19:14:01 +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 7C8B6D98 for ; Fri, 29 Jun 2018 19:13:59 +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 E1A7977E for ; Fri, 29 Jun 2018 19:13:58 +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 5BD61E0003 for ; Fri, 29 Jun 2018 19:13:56 +0000 (UTC) From: Justin Pettit To: dev@openvswitch.org Date: Fri, 29 Jun 2018 12:13:49 -0700 Message-Id: <20180629191354.76641-1-jpettit@ovn.org> X-Mailer: git-send-email 2.17.1 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 1/6] NEWS: Correct release date of OVN QoS meter support. 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 It occured in OVS 2.9.0, not OVS 2.8.0. Signed-off-by: Justin Pettit Acked-by: Ben Pfaff --- NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index cd15a332c47e..2fcb3c1f86a3 100644 --- a/NEWS +++ b/NEWS @@ -23,7 +23,7 @@ Post-v2.9.0 * Add support for compiling OVS with the latest Linux 4.14 kernel. * Added support for meters. - ovn: - * implemented icmp4/icmp6/tcp_reset actions in order to drop the packet + * Implemented icmp4/icmp6/tcp_reset actions in order to drop the packet and reply with a RST for TCP or ICMPv4/ICMPv6 unreachable message for other IPv4/IPv6-based protocols whenever a reject ACL rule is hit. * ACL match conditions can now match on Port_Groups as well as address @@ -81,6 +81,7 @@ v2.9.0 - 19 Feb 2018 - Added support to generate Neighbor Solicitation packets using the OVN action 'nd_ns' to resolve unknown next hop MAC addresses for the IPv6 packets. + * Add support for QoS bandwidth limit with DPDK. * ovn-ctl: New commands run_nb_ovsdb and run_sb_ovsdb. * ovn-sbctl, ovn-nbctl: New options --leader-only, --no-leader-only. - OpenFlow: @@ -175,7 +176,6 @@ v2.8.0 - 31 Aug 2017 gateway. * Add support for ACL logging. * ovn-northd now has native support for active-standby high availability. - * Add support for QoS bandwidth limt with DPDK. - Tracing with ofproto/trace now traces through recirculation. - OVSDB: * New support for role-based access control (see ovsdb-server(1)). From patchwork Fri Jun 29 19:13:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 937109 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 41HRFK6L3Fz9ry1 for ; Sat, 30 Jun 2018 05:15:49 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1E7A9DB6; Fri, 29 Jun 2018 19:14:02 +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 E646CD9C for ; Fri, 29 Jun 2018 19:13:59 +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 54462787 for ; Fri, 29 Jun 2018 19:13:59 +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 5812CE0007 for ; Fri, 29 Jun 2018 19:13:57 +0000 (UTC) From: Justin Pettit To: dev@openvswitch.org Date: Fri, 29 Jun 2018 12:13:50 -0700 Message-Id: <20180629191354.76641-2-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 2/6] OpenFlow: Update documentation to indicate support for virtual 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 Support was added in commit 9e638f223feb ("ofproto: Support action upcall meters"). Signed-off-by: Justin Pettit --- Documentation/topics/openflow.rst | 8 -------- utilities/ovs-ofctl.8.in | 15 +++++++++------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Documentation/topics/openflow.rst b/Documentation/topics/openflow.rst index b00cbdefaaac..bb7559047742 100644 --- a/Documentation/topics/openflow.rst +++ b/Documentation/topics/openflow.rst @@ -104,14 +104,6 @@ specs carefully yet.) (optional for OF1.3+) -* Per-flow meters. - - OpenFlow protocol support is now implemented. Support for the special - ``OFPM_SLOWPATH`` and ``OFPM_CONTROLLER`` meters is missing. Support for - the software switch is under review. - - (optional for OF1.3+) - * Auxiliary connections. An implementation in generic code might be a week's worth of work. The value diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in index c5735cafc23f..5a34383d01e2 100644 --- a/utilities/ovs-ofctl.8.in +++ b/utilities/ovs-ofctl.8.in @@ -2244,13 +2244,16 @@ multiple arguments.). Unless noted otherwise only the last instance of each field is honoured. .PP .IP \fBmeter=\fIid\fR -The integer meter id of the meter. +The identifier for the meter. An integer is used to specify a +user-defined meter. In addition, the keywords "all", "controller", and +"slowpath", are also supported as virtual meters. The "controller" and +"slowpath" virtual meters apply to packets sent to the controller and to +the OVS userspace, respectively. +.IP When this field is specified in \fBdel-meter\fR, \fBdump-meter\fR, or -\fBmeter-stats\fR, the keyword "all" may be used to designate all meters. -. -This field is required, except for \fBmeter-stats\fR, which dumps all stats -when this field is not specified. - +\fBmeter-stats\fR, the keyword "all" may be used to designate all +meters. This field is required, except for \fBmeter-stats\fR, which +dumps all stats when this field is not specified. .IP \fBkbps\fR .IQ \fBpktps\fR The unit for the meter band rate parameters, either kilobits per second, or From patchwork Fri Jun 29 19:13:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 937110 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 41HRFq49kWz9s29 for ; Sat, 30 Jun 2018 05:16:15 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CA0C3DAB; Fri, 29 Jun 2018 19:14:02 +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 E0B41DA1 for ; Fri, 29 Jun 2018 19:14:00 +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 4B2F877E for ; Fri, 29 Jun 2018 19:14:00 +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 560EFE000A for ; Fri, 29 Jun 2018 19:13:58 +0000 (UTC) From: Justin Pettit To: dev@openvswitch.org Date: Fri, 29 Jun 2018 12:13:51 -0700 Message-Id: <20180629191354.76641-3-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 3/6] ovs-ofctl: Clarifications in the Meter Syntax man page section. 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 This also correct an error that indicated that the burst size is kbps, when it should be kb. Signed-off-by: Justin Pettit --- utilities/ovs-ofctl.8.in | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in index 5a34383d01e2..8c6fe2021cfb 100644 --- a/utilities/ovs-ofctl.8.in +++ b/utilities/ovs-ofctl.8.in @@ -2256,16 +2256,17 @@ meters. This field is required, except for \fBmeter-stats\fR, which dumps all stats when this field is not specified. .IP \fBkbps\fR .IQ \fBpktps\fR -The unit for the meter band rate parameters, either kilobits per second, or -packets per second, respectively. One of these must be specified. The burst -size unit corresponds to the rate unit by dropping the "per second", i.e., -burst is in units of kilobits or packets, respectively. +The unit for the \fBrate\fR and \fBburst_size\fR band parameters. +\fBkbps\fR specifies kilobits per second, and \fBpktps\fR specifies +packets per second. A unit is required for the \fBadd-meter\fR and +\fBmod-meter\fR commands. .IP \fBburst\fR -Specify burst size for all bands, or none of them, if this flag is not given. +If set, enables burst support for meter bands through the \fBburst_size\fR +parameter. .IP \fBstats\fR -Collect meter and band statistics. +If set, enables the collection of meter and band statistics. .IP \fBbands\fR=\fIband_parameters\fR The \fBadd-meter\fR and \fBmod-meter\fR commands require at least one @@ -2286,12 +2287,12 @@ Drop packets exceeding the band's rate limit. .IP "The other \fIband_parameters\fR are:" .IP \fBrate=\fIvalue\fR The relative rate limit for this band, in kilobits per second or packets per -second, depending on the meter flags defined above. +second, depending on whether \fBkbps\fR or \fBpktps\fR was specified. .IP \fBburst_size=\fIsize\fR -The maximum burst allowed for the band. If \fBpktps\fR is specified, -then \fIsize\fR is a packet count, otherwise it is in kilobits. If -unspecified, the switch is free to select some reasonable value -depending on its configuration. +If \fBburst\fR is specified for the meter entry, configures the maximum +burst allowed for the band in kilobits or packets, depending on whether +\fBkbps\fR or \fBpktps\fR was specified. If unspecified, the switch is +free to select some reasonable value depending on its configuration. .RE . .SH OPTIONS From patchwork Fri Jun 29 19:13:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 937111 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 41HRGH1y7Gz9s2B for ; Sat, 30 Jun 2018 05:16:39 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 65ADDDC6; Fri, 29 Jun 2018 19:14:03 +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 4DE56DB9 for ; Fri, 29 Jun 2018 19:14:02 +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 50AA477E for ; Fri, 29 Jun 2018 19:14:01 +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 4E96AE000B for ; Fri, 29 Jun 2018 19:13:59 +0000 (UTC) From: Justin Pettit To: dev@openvswitch.org Date: Fri, 29 Jun 2018 12:13:52 -0700 Message-Id: <20180629191354.76641-4-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 4/6] ovn: Clarify the differences between QoS marking and metering. 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 This also correct an error that indicated that the burst size is kbps, when it should be kb. Signed-off-by: Justin Pettit --- ovn/northd/ovn-northd.8.xml | 37 ++++++++++++++++++++----------------- ovn/ovn-nb.xml | 37 ++++++++++++++++++++++--------------- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml index 4d0bab476f72..a9fe7d418f97 100644 --- a/ovn/northd/ovn-northd.8.xml +++ b/ovn/northd/ovn-northd.8.xml @@ -349,18 +349,20 @@ -

Ingress Table 7: from-lport QoS marking

+

Ingress Table 7: from-lport QoS Marking

Logical flows in this table closely reproduce those in the - QoS table in the OVN_Northbound database - for the from-lport direction. + QoS table with the action column set in + the OVN_Northbound database for the + from-lport direction.

  • - For every qos_rules for every logical switch a flow will be added at - priorities mentioned in the QoS table. + For every qos_rules entry in a logical switch with DSCP marking + enabled, a flow will be added at the priority mentioned in the + QoS table.
  • @@ -369,19 +371,20 @@
-

Ingress Table 8: from-lport QoS meter

+

Ingress Table 8: from-lport QoS Meter

Logical flows in this table closely reproduce those in the - QoS table bandwidth column in the - OVN_Northbound database for the from-lport - direction. + QoS table with the bandwidth column set + in the OVN_Northbound database for the + from-lport direction.

  • - For every qos_rules for every logical switch a flow will be added at - priorities mentioned in the QoS table. + For every qos_rules entry in a logical switch with metering + enabled, a flow will be added at the priorirty mentioned in the + QoS table.
  • @@ -920,18 +923,18 @@ output;
-

Egress Table 5: to-lport QoS marking

+

Egress Table 5: to-lport QoS Marking

- This is similar to ingress table QoS marking except for - to-lport qos rules. + This is similar to ingress table QoS marking except + they apply to to-lport QoS rules.

-

Egress Table 6: to-lport QoS meter

+

Egress Table 6: to-lport QoS Meter

- This is similar to ingress table QoS meter except for - to-lport qos rules. + This is similar to ingress table QoS meter except + they apply to to-lport QoS rules.

Egress Table 7: Stateful

diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml index 6aed6102a56f..914469e482b7 100644 --- a/ovn/ovn-nb.xml +++ b/ovn/ovn-nb.xml @@ -122,7 +122,8 @@ - QOS marking rules that apply to packets within the logical switch. + QoS marking and metering rules that apply to packets within the + logical switch. @@ -1280,19 +1281,25 @@ - +

- Each row in this table represents one QOS rule for a logical switch - that points to it through its column. The column for the highest- - matching row in this table determines a packet's qos marking. If no row - matches, packets will not have any qos marking. + Each row in this table represents one QoS rule for a logical switch + that points to it through its column. + Two types of QoS are supported: DSCP marking and metering. A + with the highest- + will have QoS applied to it. If the column is + specified, then matching packets will have DSCP marking applied. + If the column is specified, then matching + packets will have metering applied. and + are not exclusive, so both marking and + metering by defined for the same QoS entry. If no row matches, + packets will not have any QoS applied.

- The QOS rule's priority. Rules with numerically higher priority - take precedence over those with lower. If two QOS rules with + The QoS rule's priority. Rules with numerically higher priority + take precedence over those with lower. If two QoS rules with the same priority both match, then the one actually applied to a packet is undefined.

@@ -1308,7 +1315,7 @@

- The packets that the QOS rules should match, in the same expression + The packets that the QoS rules should match, in the same expression language used for the column in the OVN Southbound database's table. The @@ -1319,7 +1326,7 @@ -

The action to be performed on the matched packet

+

When specified, matching flows will have DSCP marking applied.

  • dscp: The value of this action should be in the @@ -1330,16 +1337,16 @@

    - The bandwidth limit to be performed on the matched packet. - Currently only supported in the userspace by dpdk. + When specified, matching packets will have bandwidth metering + applied. Traffic over the limit will be dropped.

    • rate: The value of rate limit in kbps.
    • - burst: The value of burst rate limit in kbps. - This is optional and needs to specify the rate first. + burst: The value of burst rate limit in kilobits. + This is optional and needs to specify the rate.
    From patchwork Fri Jun 29 19:13:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 937112 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 41HRH05q0Sz9s29 for ; Sat, 30 Jun 2018 05:17:16 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 552C6DD7; 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 BBEB3DB9 for ; Fri, 29 Jun 2018 19:14:02 +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 34091787 for ; Fri, 29 Jun 2018 19:14:02 +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 52116E0003 for ; Fri, 29 Jun 2018 19:14:00 +0000 (UTC) From: Justin Pettit To: dev@openvswitch.org Date: Fri, 29 Jun 2018 12:13:53 -0700 Message-Id: <20180629191354.76641-5-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 5/6] dpif-netdev: Fix a couple of comments for dp_netdev_run_meter(). 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 Signed-off-by: Justin Pettit --- lib/dpif-netdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 9390fff68dac..1e204a8d3b72 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -4375,7 +4375,8 @@ dpif_netdev_meter_get_features(const struct dpif * dpif OVS_UNUSED, features->max_color = 0; } -/* Returns false when packet needs to be dropped. */ +/* Applies the meter identified by 'meter_id' to 'packets_'. Packets + * that exceed a band are dropped in-place. */ static void dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_, uint32_t meter_id, long long int now) @@ -4495,9 +4496,8 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_, } } - /* Fire the highest rate band exceeded by each packet. - * Drop packets if needed, by swapping packet to the end that will be - * ignored. */ + /* Fire the highest rate band exceeded by each packet, and drop + * packets if needed. */ size_t j; DP_PACKET_BATCH_REFILL_FOR_EACH (j, cnt, packet, packets_) { if (exceeded_band[j] >= 0) { 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",