[ovs-dev,1/3] ofproto: Do not signal revalidation for group mods twice.
diff mbox

Message ID 1474067451-78603-2-git-send-email-jarno@ovn.org
State Accepted
Delegated to: Ben Pfaff
Headers show

Commit Message

Jarno Rajahalme Sept. 16, 2016, 11:10 p.m. UTC
The new group mod implementation signals revalidation through
'->set_tables_version()', so the separate '->group_modify()' is no
longer needed.  The ofproto-provider API is changed to allow
'group_modify' to be NULL.

Fixes: 5d08a275cd ("ofproto: Make groups versioned.")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
---
 ofproto/ofproto-dpif.c | 10 +---------
 ofproto/ofproto.c      |  3 ++-
 2 files changed, 3 insertions(+), 10 deletions(-)

Comments

Ben Pfaff Sept. 20, 2016, 3:20 p.m. UTC | #1
On Fri, Sep 16, 2016 at 04:10:49PM -0700, Jarno Rajahalme wrote:
> The new group mod implementation signals revalidation through
> '->set_tables_version()', so the separate '->group_modify()' is no
> longer needed.  The ofproto-provider API is changed to allow
> 'group_modify' to be NULL.
> 
> Fixes: 5d08a275cd ("ofproto: Make groups versioned.")
> Signed-off-by: Jarno Rajahalme <jarno@ovn.org>

Acked-by: Ben Pfaff <blp@ovn.org>
Jarno Rajahalme Sept. 20, 2016, 6:43 p.m. UTC | #2
> On Sep 20, 2016, at 8:20 AM, Ben Pfaff <blp@ovn.org> wrote:
> 
> On Fri, Sep 16, 2016 at 04:10:49PM -0700, Jarno Rajahalme wrote:
>> The new group mod implementation signals revalidation through
>> '->set_tables_version()', so the separate '->group_modify()' is no
>> longer needed.  The ofproto-provider API is changed to allow
>> 'group_modify' to be NULL.
>> 
>> Fixes: 5d08a275cd ("ofproto: Make groups versioned.")
>> Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
> 
> Acked-by: Ben Pfaff <blp@ovn.org>

Thanks for the review, pushed to master and branch-2.6.

  Jarno

Patch
diff mbox

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 0cffca1..63a84a8 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4549,14 +4549,6 @@  group_destruct(struct ofgroup *group_)
     ovs_mutex_destroy(&group->stats_mutex);
 }
 
-static void
-group_modify(struct ofgroup *group_)
-{
-    struct ofproto_dpif *ofproto = ofproto_dpif_cast(group_->ofproto);
-
-    ofproto->backer->need_revalidate = REV_FLOW_TABLE;
-}
-
 static enum ofperr
 group_get_stats(const struct ofgroup *group_, struct ofputil_group_stats *ogs)
 {
@@ -5899,7 +5891,7 @@  const struct ofproto_class ofproto_dpif_class = {
     group_construct,            /* group_construct */
     group_destruct,             /* group_destruct */
     group_dealloc,              /* group_dealloc */
-    group_modify,               /* group_modify */
+    NULL,                       /* group_modify */
     group_get_stats,            /* group_get_stats */
     get_datapath_version,       /* get_datapath_version */
 };
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index f89f0ef..e87def7 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -7091,7 +7091,8 @@  ofproto_group_mod_finish(struct ofproto *ofproto,
     struct ofgroup *new_group = ogm->new_group;
     struct ofgroup *old_group;
 
-    if (new_group && group_collection_n(&ogm->old_groups)) {
+    if (new_group && group_collection_n(&ogm->old_groups) &&
+        ofproto->ofproto_class->group_modify) {
         /* Modify a group. */
         ovs_assert(group_collection_n(&ogm->old_groups) == 1);