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:
parent
0fb7792ab3
commit
f11c7538ba
@ -380,7 +380,6 @@ struct ofputil_packet_in {
|
|||||||
size_t packet_len;
|
size_t packet_len;
|
||||||
|
|
||||||
enum ofp_packet_in_reason reason; /* One of OFPR_*. */
|
enum ofp_packet_in_reason reason; /* One of OFPR_*. */
|
||||||
uint16_t controller_id; /* Controller ID to send to. */
|
|
||||||
uint8_t table_id;
|
uint8_t table_id;
|
||||||
ovs_be64 cookie;
|
ovs_be64 cookie;
|
||||||
|
|
||||||
|
@ -1494,7 +1494,7 @@ connmgr_send_packet_in(struct connmgr *mgr,
|
|||||||
|
|
||||||
LIST_FOR_EACH (ofconn, node, &mgr->all_conns) {
|
LIST_FOR_EACH (ofconn, node, &mgr->all_conns) {
|
||||||
if (ofconn_receives_async_msg(ofconn, OAM_PACKET_IN, pin->up.reason)
|
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);
|
schedule_packet_in(ofconn, *pin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,7 @@ enum ofconn_async_msg_type {
|
|||||||
struct ofproto_packet_in {
|
struct ofproto_packet_in {
|
||||||
struct ofputil_packet_in up;
|
struct ofputil_packet_in up;
|
||||||
struct list list_node; /* For queuing. */
|
struct list list_node; /* For queuing. */
|
||||||
|
uint16_t controller_id; /* Controller ID to send to. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Basics. */
|
/* Basics. */
|
||||||
|
@ -845,11 +845,11 @@ handle_upcalls(struct udpif *udpif, struct list *upcalls)
|
|||||||
pin->up.packet = xmemdup(packet->data, packet->size);
|
pin->up.packet = xmemdup(packet->data, packet->size);
|
||||||
pin->up.packet_len = packet->size;
|
pin->up.packet_len = packet->size;
|
||||||
pin->up.reason = OFPR_NO_MATCH;
|
pin->up.reason = OFPR_NO_MATCH;
|
||||||
pin->up.controller_id = 0;
|
|
||||||
pin->up.table_id = 0;
|
pin->up.table_id = 0;
|
||||||
pin->up.cookie = 0;
|
pin->up.cookie = 0;
|
||||||
pin->up.send_len = 0; /* Not used for flow table misses. */
|
pin->up.send_len = 0; /* Not used for flow table misses. */
|
||||||
flow_get_metadata(&miss->flow, &pin->up.fmd);
|
flow_get_metadata(&miss->flow, &pin->up.fmd);
|
||||||
|
pin->controller_id = 0;
|
||||||
ofproto_dpif_send_packet_in(miss->ofproto, pin);
|
ofproto_dpif_send_packet_in(miss->ofproto, pin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1847,13 +1847,13 @@ execute_controller_action(struct xlate_ctx *ctx, int len,
|
|||||||
pin->up.packet_len = packet->size;
|
pin->up.packet_len = packet->size;
|
||||||
pin->up.packet = ofpbuf_steal_data(packet);
|
pin->up.packet = ofpbuf_steal_data(packet);
|
||||||
pin->up.reason = reason;
|
pin->up.reason = reason;
|
||||||
pin->up.controller_id = controller_id;
|
|
||||||
pin->up.table_id = ctx->table_id;
|
pin->up.table_id = ctx->table_id;
|
||||||
pin->up.cookie = ctx->rule ? rule_dpif_get_flow_cookie(ctx->rule) : 0;
|
pin->up.cookie = ctx->rule ? rule_dpif_get_flow_cookie(ctx->rule) : 0;
|
||||||
|
|
||||||
pin->up.send_len = len;
|
pin->up.send_len = len;
|
||||||
flow_get_metadata(&ctx->xin->flow, &pin->up.fmd);
|
flow_get_metadata(&ctx->xin->flow, &pin->up.fmd);
|
||||||
|
|
||||||
|
pin->controller_id = controller_id;
|
||||||
ofproto_dpif_send_packet_in(ctx->xbridge->ofproto, pin);
|
ofproto_dpif_send_packet_in(ctx->xbridge->ofproto, pin);
|
||||||
ofpbuf_delete(packet);
|
ofpbuf_delete(packet);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user