ofproto: Remove flows from all tables upon group deletion.
authorZoltán Balogh <zoltan.balogh@ericsson.com>
Wed, 23 Dec 2015 01:10:40 +0000 (17:10 -0800)
committerBen Pfaff <blp@ovn.org>
Wed, 23 Dec 2015 01:12:20 +0000 (17:12 -0800)
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>
AUTHORS
ofproto/ofproto.c
tests/ofproto.at

diff --git a/AUTHORS b/AUTHORS
index e8d17ac..cc7aacc 100644 (file)
--- 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
index c5bd949..a5ce04e 100644 (file)
@@ -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);
index c22d79f..52e1ab4 100644 (file)
@@ -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])