diff mbox

[ovs-dev,08/13] ofproto: Report flow mods also from bundles.

Message ID 1468577959-98487-8-git-send-email-jarno@ovn.org
State Superseded
Headers show

Commit Message

Jarno Rajahalme July 15, 2016, 10:19 a.m. UTC
Flow mod stats get skewed if they are not reported from bundles.  Move
reporting to ofproto_flow_mod_finish() so that it will be done in all
cases.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
---
 ofproto/ofproto.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index c36df4e..e96aeb7 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -5468,7 +5468,7 @@  handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh)
 
     error = reject_slave_controller(ofconn);
     if (error) {
-        goto exit;
+        return error;
     }
 
     ofpbuf_use_stub(&ofpacts, ofpacts_stub, sizeof ofpacts_stub);
@@ -5480,15 +5480,8 @@  handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh)
         struct openflow_mod_requester req = { ofconn, oh };
         error = handle_flow_mod__(ofproto, &ofm, &req);
     }
-    if (error) {
-        goto exit_free_ofpacts;
-    }
 
-    ofconn_report_flow_mod(ofconn, ofm.fm.command);
-
-exit_free_ofpacts:
     ofpbuf_uninit(&ofpacts);
-exit:
     return error;
 }
 
@@ -7057,6 +7050,10 @@  ofproto_flow_mod_finish(struct ofproto *ofproto,
     default:
         break;
     }
+
+    if (req) {
+        ofconn_report_flow_mod(req->ofconn, ofm->fm.command);
+    }
 }
 
 /* Commit phases (all while locking ofproto_mutex):