The execution of "ovs-appctl -t ovs-ofctl ofctl/send" could happen before
ovs-appctl received and printed the
NXST_FLOW_MONITOR reply (xid=0x0):
event=ADDED table=0 cookie=0 in_port=2 actions=output:1
msesage, which could cause the
send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
message to be printed before rather than after the NXST_FLOW_MONITOR reply.
This commit fixes the problem by inserting a serializing barrier.
Reported-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
ovs-ofctl add-flow br0 in_port=1,actions=output:2
ovs-ofctl add-flow br0 in_port=2,actions=output:1
ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
ovs-ofctl add-flow br0 in_port=1,actions=output:2
ovs-ofctl add-flow br0 in_port=2,actions=output:1
+ovs-appctl -t ovs-ofctl ofctl/barrier
ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
ovs-appctl -t ovs-ofctl ofctl/barrier
AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
ovs-appctl -t ovs-ofctl ofctl/barrier
AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
event=ADDED table=0 cookie=0 in_port=1 actions=output:2
NXST_FLOW_MONITOR reply (xid=0x0):
event=ADDED table=0 cookie=0 in_port=2 actions=output:1
event=ADDED table=0 cookie=0 in_port=1 actions=output:2
NXST_FLOW_MONITOR reply (xid=0x0):
event=ADDED table=0 cookie=0 in_port=2 actions=output:1
send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
NXST_FLOW_MONITOR reply (xid=0x0):
event=ABBREV xid=0x12345678
send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
NXST_FLOW_MONITOR reply (xid=0x0):
event=ABBREV xid=0x12345678