connmgr: Move controller_id from ofputil_packet_in to ofproto_packet_in.
authorBen Pfaff <blp@nicira.com>
Tue, 22 Oct 2013 23:21:10 +0000 (16:21 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 23 Oct 2013 04:12:06 +0000 (21:12 -0700)
controller_id isn't part of the OpenFlow message, so it shouldn't be in
ofputil_packet_in.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-util.h
ofproto/connmgr.c
ofproto/connmgr.h
ofproto/ofproto-dpif-upcall.c
ofproto/ofproto-dpif-xlate.c

index 2de6e76..9dff763 100644 (file)
@@ -380,7 +380,6 @@ struct ofputil_packet_in {
     size_t packet_len;
 
     enum ofp_packet_in_reason reason;    /* One of OFPR_*. */
-    uint16_t controller_id;              /* Controller ID to send to. */
     uint8_t table_id;
     ovs_be64 cookie;
 
index 2c32525..bd6e934 100644 (file)
@@ -1494,7 +1494,7 @@ connmgr_send_packet_in(struct connmgr *mgr,
 
     LIST_FOR_EACH (ofconn, node, &mgr->all_conns) {
         if (ofconn_receives_async_msg(ofconn, OAM_PACKET_IN, pin->up.reason)
-            && ofconn->controller_id == pin->up.controller_id) {
+            && ofconn->controller_id == pin->controller_id) {
             schedule_packet_in(ofconn, *pin);
         }
     }
index 4846da9..6cbbf17 100644 (file)
@@ -66,6 +66,7 @@ enum ofconn_async_msg_type {
 struct ofproto_packet_in {
     struct ofputil_packet_in up;
     struct list list_node;      /* For queuing. */
+    uint16_t controller_id;     /* Controller ID to send to. */
 };
 
 /* Basics. */
index 41d8ee4..ec4fc5c 100644 (file)
@@ -845,11 +845,11 @@ handle_upcalls(struct udpif *udpif, struct list *upcalls)
             pin->up.packet = xmemdup(packet->data, packet->size);
             pin->up.packet_len = packet->size;
             pin->up.reason = OFPR_NO_MATCH;
-            pin->up.controller_id = 0;
             pin->up.table_id = 0;
             pin->up.cookie = 0;
             pin->up.send_len = 0; /* Not used for flow table misses. */
             flow_get_metadata(&miss->flow, &pin->up.fmd);
+            pin->controller_id = 0;
             ofproto_dpif_send_packet_in(miss->ofproto, pin);
         }
     }
index a7026ba..004a105 100644 (file)
@@ -1847,13 +1847,13 @@ execute_controller_action(struct xlate_ctx *ctx, int len,
     pin->up.packet_len = packet->size;
     pin->up.packet = ofpbuf_steal_data(packet);
     pin->up.reason = reason;
-    pin->up.controller_id = controller_id;
     pin->up.table_id = ctx->table_id;
     pin->up.cookie = ctx->rule ? rule_dpif_get_flow_cookie(ctx->rule) : 0;
 
     pin->up.send_len = len;
     flow_get_metadata(&ctx->xin->flow, &pin->up.fmd);
 
+    pin->controller_id = controller_id;
     ofproto_dpif_send_packet_in(ctx->xbridge->ofproto, pin);
     ofpbuf_delete(packet);
 }