2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 05:18:13 +00:00

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>
This commit is contained in:
Ben Pfaff 2013-10-22 16:21:10 -07:00
parent 0fb7792ab3
commit f11c7538ba
5 changed files with 4 additions and 4 deletions

View 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;

View 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);
}
}

View 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. */

View 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);
}
}

View 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);
}