From: Jarno Rajahalme Date: Fri, 29 Jul 2016 23:52:05 +0000 (-0700) Subject: ofproto: Add 'command' to ofproto_flow_mod. X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5a27991d1a2738abba89e19bc51985e54812515b;p=ovs.git ofproto: Add 'command' to ofproto_flow_mod. This helps releasing ofputil_flow_mod earlier in a later patch. Signed-off-by: Jarno Rajahalme Acked-by: Ben Pfaff --- diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h index 2bb4cca7e..67a85e0a5 100644 --- a/ofproto/ofproto-provider.h +++ b/ofproto/ofproto-provider.h @@ -1844,6 +1844,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 56e298a1f..8e59c699c 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -7034,13 +7034,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); @@ -7067,7 +7068,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; @@ -7093,7 +7094,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; @@ -7113,7 +7114,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); } }