Nothing actually used it.

An upcoming commit will use part of the hole for a new member.

Signed-off-by: Ben Pfaff <b...@nicira.com>
---
 ofproto/ofproto-provider.h | 17 +++++++++++------
 ofproto/ofproto.c          | 14 +++++---------
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index 8da2822..9c6b960 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -398,18 +398,23 @@ static inline bool rule_is_hidden(const struct rule *);
  * A struct rule_actions may be accessed without a risk of being
  * freed by code that holds a read-lock or write-lock on 'rule->mutex' (where
  * 'rule' is the rule for which 'rule->actions == actions') or during the RCU
- * active period. */
+ * active period.
+ *
+ * All members are immutable: they do not change during the struct's
+ * lifetime. */
 struct rule_actions {
-    /* These members are immutable: they do not change during the struct's
-     * lifetime.  */
+    /* Flags.
+     *
+     * 'has_meter' is true if 'ofpacts' contains an OFPACT_METER action. */
+    bool has_meter;
+
+    /* Actions. */
     uint32_t ofpacts_len;         /* Size of 'ofpacts', in bytes. */
-    uint32_t provider_meter_id;   /* Datapath meter_id, or UINT32_MAX. */
     struct ofpact ofpacts[];      /* Sequence of "struct ofpacts". */
 };
 BUILD_ASSERT_DECL(offsetof(struct rule_actions, ofpacts) % OFPACT_ALIGNTO == 
0);
 
-const struct rule_actions *rule_actions_create(const struct ofproto *,
-                                               const struct ofpact *, size_t);
+const struct rule_actions *rule_actions_create(const struct ofpact *, size_t);
 void rule_actions_destroy(const struct rule_actions *);
 
 /* A set of rules to which an OpenFlow operation applies. */
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 61daeda..5f7f9fb 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -2486,16 +2486,13 @@ static uint32_t get_provider_meter_id(const struct 
ofproto *,
 /* Creates and returns a new 'struct rule_actions', whose actions are a copy
  * of from the 'ofpacts_len' bytes of 'ofpacts'. */
 const struct rule_actions *
-rule_actions_create(const struct ofproto *ofproto,
-                    const struct ofpact *ofpacts, size_t ofpacts_len)
+rule_actions_create(const struct ofpact *ofpacts, size_t ofpacts_len)
 {
     struct rule_actions *actions;
 
     actions = xmalloc(sizeof *actions + ofpacts_len);
     actions->ofpacts_len = ofpacts_len;
-    actions->provider_meter_id
-        = get_provider_meter_id(ofproto,
-                                ofpacts_get_meter(ofpacts, ofpacts_len));
+    actions->has_meter = ofpacts_get_meter(ofpacts, ofpacts_len) != 0;
     memcpy(actions->ofpacts, ofpacts, ofpacts_len);
 
     return actions;
@@ -3861,7 +3858,7 @@ add_flow(struct ofproto *ofproto, struct ofputil_flow_mod 
*fm,
 
     *CONST_CAST(uint8_t *, &rule->table_id) = table - ofproto->tables;
     rule->flags = fm->flags & OFPUTIL_FF_STATE;
-    actions = rule_actions_create(ofproto, fm->ofpacts, fm->ofpacts_len);
+    actions = rule_actions_create(fm->ofpacts, fm->ofpacts_len);
     ovsrcu_set(&rule->actions, actions);
     list_init(&rule->meter_list_node);
     rule->eviction_group = NULL;
@@ -3882,7 +3879,7 @@ add_flow(struct ofproto *ofproto, struct ofputil_flow_mod 
*fm,
     }
     cookies_insert(ofproto, rule);
     eviction_group_add_rule(rule);
-    if (actions->provider_meter_id != UINT32_MAX) {
+    if (actions->has_meter) {
         meter_insert_rule(rule);
     }
 
@@ -3997,8 +3994,7 @@ modify_flows__(struct ofproto *ofproto, struct 
ofputil_flow_mod *fm,
         }
 
         if (change_actions) {
-            ovsrcu_set(&rule->actions, rule_actions_create(ofproto,
-                                                           fm->ofpacts,
+            ovsrcu_set(&rule->actions, rule_actions_create(fm->ofpacts,
                                                            fm->ofpacts_len));
             rule_actions_destroy(actions);
         }
-- 
1.9.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to