[ovs-dev] [ACL Meters 5/7] ovn: Support configuring meters through SB Meter table.

Ben Pfaff blp at ovn.org
Mon Jul 30 18:44:47 UTC 2018

On Sun, Jul 29, 2018 at 11:46:36PM -0700, Justin Pettit wrote:
> Add the ability to configure meters through the newly introduced Meter
> table in the Southbound database.  Previously, meters were configured by
> providing strings to describe the meter in the extended meter table.
> This patch changes the behavior so that the extended meter table's
> strings are references to names in the Meter table.  The old behavior is
> still supported if the extended meter table entry begins with "__string: "
> Signed-off-by: Justin Pettit <jpettit at ovn.org>

I have the following suggestions.  Neither is important.

diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c
index 01981a79480b..d810d413f207 100644
--- a/ovn/controller/ofctrl.c
+++ b/ovn/controller/ofctrl.c
@@ -907,7 +907,7 @@ ofctrl_can_put(void)
  * Replaces the group table and meter table on the switch, if possible,
  * by the contents of '->desired'.  Regardless of whether the table is
- * updated, this deletes all the groups ore metersjfrom the '->desired'
+ * updated, this deletes all the groups ore meters from the '->desired'
  * and frees them. (The hmap itself isn't destroyed.)
  * Sends conntrack flush messages to each zone in 'pending_ct_zones' that
@@ -1080,10 +1080,10 @@ ofctrl_put(struct hmap *flow_table, struct shash *pending_ct_zones,
     struct ovn_extend_table_info *m_installed, *next_meter;
     EXTEND_TABLE_FOR_EACH_INSTALLED (m_installed, next_meter, meters) {
         /* Delete the meter. */
-        struct ofputil_meter_mod mm;
-        memset(&mm, 0, sizeof mm);
-        mm.command = OFPMC13_DELETE;
-        mm.meter.meter_id = m_installed->table_id;
+        struct ofputil_meter_mod mm = {
+            .command = OFPMC13_DELETE,
+            .meter.meter_id = m_installed->table_id,
+        };
         add_meter_mod(&mm, &msgs);
         ovn_extend_table_remove(meters, m_installed);

Acked-by: Ben Pfaff <blp at ovn.org>

More information about the dev mailing list