This helps releasing ofputil_flow_mod earlier in a later patch.

Signed-off-by: Jarno Rajahalme <ja...@ovn.org>
---
 ofproto/ofproto-provider.h | 1 +
 ofproto/ofproto.c          | 9 +++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index f328b4a..35ce4f4 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -1910,6 +1910,7 @@ struct ofproto_flow_mod {
 
     /* Replicate needed fields from ofputil_flow_mod to not need it after the
      * flow has been created. */
+    uint16_t command;
     uint32_t buffer_id;
     bool modify_cookie;
 
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 47020b8..b8b6bc2 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -7140,13 +7140,14 @@ ofproto_flow_mod_start(struct ofproto *ofproto, struct 
ofproto_flow_mod *ofm)
     }
 
     /* Forward flow mod fields we need later. */
+    ofm->command = ofm->fm.command;
     ofm->buffer_id = ofm->fm.buffer_id;
     ofm->modify_cookie = ofm->fm.modify_cookie;
 
     ofm->modify_may_add_flow = (ofm->fm.new_cookie != OVS_BE64_MAX
                                 && ofm->fm.cookie_mask == htonll(0));
 
-    switch (ofm->fm.command) {
+    switch (ofm->command) {
     case OFPFC_ADD:
         ofm->event = NXFME_ADDED;
         return add_flow_start(ofproto, ofm);
@@ -7173,7 +7174,7 @@ static void
 ofproto_flow_mod_revert(struct ofproto *ofproto, struct ofproto_flow_mod *ofm)
     OVS_REQUIRES(ofproto_mutex)
 {
-    switch (ofm->fm.command) {
+    switch (ofm->command) {
     case OFPFC_ADD:
         add_flow_revert(ofproto, ofm);
         break;
@@ -7199,7 +7200,7 @@ ofproto_flow_mod_finish(struct ofproto *ofproto,
                         const struct openflow_mod_requester *req)
     OVS_REQUIRES(ofproto_mutex)
 {
-    switch (ofm->fm.command) {
+    switch (ofm->command) {
     case OFPFC_ADD:
         add_flow_finish(ofproto, ofm, req);
         break;
@@ -7219,7 +7220,7 @@ ofproto_flow_mod_finish(struct ofproto *ofproto,
     }
 
     if (req) {
-        ofconn_report_flow_mod(req->ofconn, ofm->fm.command);
+        ofconn_report_flow_mod(req->ofconn, ofm->command);
     }
 }
 
-- 
2.1.4

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

Reply via email to