aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-10-22 16:21:10 -0700
committerBen Pfaff <blp@nicira.com>2013-10-22 21:12:06 -0700
commitf11c7538ba3d4d9fbaabd66457f1c20e95467b1c (patch)
treec324db39b35841080dde5bf510709292a3064fa0
parent0fb7792ab3428a28044e53b443388cbc1231035a (diff)
connmgr: Move controller_id from ofputil_packet_in to ofproto_packet_in.
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>
-rw-r--r--lib/ofp-util.h1
-rw-r--r--ofproto/connmgr.c2
-rw-r--r--ofproto/connmgr.h1
-rw-r--r--ofproto/ofproto-dpif-upcall.c2
-rw-r--r--ofproto/ofproto-dpif-xlate.c2
5 files changed, 4 insertions, 4 deletions
diff --git a/lib/ofp-util.h b/lib/ofp-util.h
index 2de6e769..9dff7632 100644
--- a/lib/ofp-util.h
+++ b/lib/ofp-util.h
@@ -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;
diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
index 2c325256..bd6e934f 100644
--- a/ofproto/connmgr.c
+++ b/ofproto/connmgr.c
@@ -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);
}
}
diff --git a/ofproto/connmgr.h b/ofproto/connmgr.h
index 4846da9c..6cbbf171 100644
--- a/ofproto/connmgr.h
+++ b/ofproto/connmgr.h
@@ -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. */
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 41d8ee4a..ec4fc5c4 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -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);
}
}
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index a7026ba6..004a1054 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -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);
}