- ovs2.3
- 核心代码在ovs/ofproto/ofproto.c
- barrierRequest/Reply机制,根据官方文档说明如下
- barrierRequest:ensure message dependencies have been met or receive notifications for completed operations(确保依赖关系或者对已完成操作的通知)
- barrierReply:The switch responds with this message to a barrier request.(响应request给控制器的回复)
- barrier机制有以下三个特点
- barrier之前的消息全部被处理
- 然后处理barrierRequest消息
- 再处理barrier之后的消息
-
handle_openflow__函数提取出消息的type进行switch-case的匹配
-
命中OFPTYPE_BARRIER_REQUEST,执行对barrier_request的处理函数handle_barrier_request
static enum ofperr handle_barrier_request(struct ofconn *ofconn, const struct ofp_header *oh) { struct ofpbuf *buf; // 这部分代码应该是等待未完成消息的处理 if (ofconn_has_pending_opgroups(ofconn)) {