When a group is deleted, all flows which include a Group action with the ID
of the deleted group should be removed. Currently, only flows in table 0 are
removed.
When setting ofm.fn.table_id to 0xff in delete_group__() all affected flows
in non-hidden tables are removed.
Please find attached the test steps and printouts.
Signed-off-by: Zoltán Balogh <[email protected]>
---
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index c5bd949..8c85de5 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -6548,6 +6548,7 @@ delete_group__(struct ofproto *ofproto, struct ofgroup
*ofgroup)
flow_mod_init(&ofm.fm, &match, 0, NULL, 0, OFPFC_DELETE);
ofm.fm.delete_reason = OFPRR_GROUP_DELETE;
ofm.fm.out_group = ofgroup->group_id;
+ ofm.fm.table_id = 0xff;
handle_flow_mod__(ofproto, &ofm, NULL);
hmap_remove(&ofproto->groups, &ofgroup->hmap_node);
-------------
without patch
-------------
ovs-vsctl add-br BR0
ovs-ofctl add-group BR0 group_id=01,type=select,bucket=output:2 -OOpenFlow13
ovs-ofctl add-flow BR0 table=1,in_port=1,actions=group:1 -OOpenFlow13
ovs-ofctl add-flow BR0 in_port=2,actions=group:1 -OOpenFlow13
ovs-ofctl add-flow BR0 in_port=3,actions=write_actions\(group:1\) -OOpenFlow13
ovs-ofctl add-flow BR0 table=2,in_port=4,actions=write_actions\(group:1\)
-OOpenFlow13
ovs-ofctl dump-flows BR0 -OOpenFlow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x0, duration=25.047s, table=0, n_packets=0, n_bytes=0, in_port=2
actions=group:1
cookie=0x0, duration=24.493s, table=0, n_packets=0, n_bytes=0, in_port=3
actions=write_actions(group:1)
cookie=0x0, duration=409.515s, table=0, n_packets=0, n_bytes=0, priority=0
actions=NORMAL
cookie=0x0, duration=53.497s, table=1, n_packets=0, n_bytes=0, in_port=1
actions=group:1
cookie=0x0, duration=10.094s, table=2, n_packets=0, n_bytes=0, in_port=4
actions=write_actions(group:1)
ovs-ofctl dump-groups BR0 -OOpenFlow13
OFPST_GROUP_DESC reply (OF1.3) (xid=0x2):
group_id=1,type=select,bucket=actions=output:2
ovs-ofctl del-groups BR0 group_id=1 -OOpenFlow13
ovs-ofctl dump-flows BR0 -OOpenFlow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x0, duration=458.402s, table=0, n_packets=0, n_bytes=0, priority=0
actions=NORMAL
cookie=0x0, duration=102.384s, table=1, n_packets=0, n_bytes=0, in_port=1
actions=group:1
cookie=0x0, duration=58.981s, table=2, n_packets=0, n_bytes=0, in_port=4
actions=write_actions(group:1)
----------
with patch
----------
ovs-vsctl add-br BR0
ovs-ofctl add-group BR0 group_id=01,type=select,bucket=output:2 -OOpenFlow13
ovs-ofctl add-flow BR0 table=1,in_port=1,actions=group:1 -OOpenFlow13
ovs-ofctl add-flow BR0 in_port=2,actions=group:1 -OOpenFlow13
ovs-ofctl add-flow BR0 in_port=3,actions=write_actions\(group:1\) -OOpenFlow13
ovs-ofctl add-flow BR0 table=2,in_port=4,actions=write_actions\(group:1\)
-OOpenFlow13
ovs-ofctl dump-flows BR0 -OOpenFlow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x0, duration=27.252s, table=0, n_packets=0, n_bytes=0, in_port=2
actions=group:1
cookie=0x0, duration=27.250s, table=0, n_packets=0, n_bytes=0, in_port=3
actions=write_actions(group:1)
cookie=0x0, duration=66.302s, table=0, n_packets=0, n_bytes=0, priority=0
actions=NORMAL
cookie=0x0, duration=27.258s, table=1, n_packets=0, n_bytes=0, in_port=1
actions=group:1
cookie=0x0, duration=19.222s, table=2, n_packets=0, n_bytes=0, in_port=4
actions=write_actions(group:1)
ovs-ofctl dump-groups BR0 -OOpenFlow13
OFPST_GROUP_DESC reply (OF1.3) (xid=0x2):
group_id=1,type=select,bucket=actions=output:2
ovs-ofctl del-groups BR0 group_id=1 -OOpenFlow13
ovs-ofctl dump-flows BR0 -OOpenFlow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x0, duration=164.769s, table=0, n_packets=0, n_bytes=0, priority=0
actions=NORMAL
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev