Skip to content

Commit

Permalink
ofproto: Remove flows from all tables upon group deletion.
Browse files Browse the repository at this point in the history
When a group is deleted, all flows which include a Group action with the ID
of the deleted group should be removed.  Until now, only flows in table 0
were removed.  This fixes the problem.

Signed-off-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
[blp@ovn.org added a test]
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
zoltanbalogheth authored and blp committed Dec 23, 2015
1 parent 4a7e11d commit 31e3f30
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -137,6 +137,7 @@ Yasuhito Takamiya yasuhito@gmail.com
yinpeijun yinpeijun@huawei.com
Yu Zhiguo yuzg@cn.fujitsu.com
ZhengLingyun konghuarukhr@163.com
Zoltán Balogh zoltan.balogh@ericsson.com
Zoltan Kiss zoltan.kiss@citrix.com
Zhi Yong Wu zwu.kernel@gmail.com
Zang MingJie zealot0630@gmail.com
Expand Down
1 change: 1 addition & 0 deletions ofproto/ofproto.c
Expand Up @@ -5730,6 +5730,7 @@ delete_group__(struct ofproto *ofproto, struct ofgroup *ofgroup)
match_init_catchall(&match);
flow_mod_init(&fm, &match, 0, NULL, 0, OFPFC_DELETE);
fm.out_group = ofgroup->group_id;
fm.table_id = OFPTT_ALL;
handle_flow_mod__(ofproto, NULL, &fm, NULL);

/* Must wait until existing readers are done,
Expand Down
8 changes: 4 additions & 4 deletions tests/ofproto.at
Expand Up @@ -306,25 +306,25 @@ group_id=1235,type=all,bucket=output:10
AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
AT_DATA([flows.txt], [dnl
tcp actions=group:1234
udp actions=group:1235
table=2 udp actions=group:1235
])
AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
[0], [dnl
table=2, udp actions=group:1235
tcp actions=group:1234
udp actions=group:1235
OFPST_FLOW reply (OF1.1):
])
AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
[0], [dnl
udp actions=group:1235
table=2, udp actions=group:1235
OFPST_FLOW reply (OF1.1):
])
AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
[0], [dnl
udp actions=group:1235
table=2, udp actions=group:1235
OFPST_FLOW reply (OF1.1):
])
AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
Expand Down

0 comments on commit 31e3f30

Please sign in to comment.