From 8b792aef0df46b591638ee4cda396b8e5f07bfd6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Balogh?= Date: Tue, 22 Dec 2015 17:10:40 -0800 Subject: [PATCH] ofproto: Remove flows from all tables upon group deletion. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 [blp@ovn.org added a test] Signed-off-by: Ben Pfaff --- AUTHORS | 1 + ofproto/ofproto.c | 1 + tests/ofproto.at | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index e8d17acde..cc7aacc84 100644 --- a/AUTHORS +++ b/AUTHORS @@ -220,6 +220,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 diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index c5bd949a1..a5ce04eed 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 = OFPTT_ALL; handle_flow_mod__(ofproto, &ofm, NULL); hmap_remove(&ofproto->groups, &ofgroup->hmap_node); diff --git a/tests/ofproto.at b/tests/ofproto.at index c22d79fbf..52e1ab408 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -386,25 +386,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]) -- 2.20.1