summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-06-24 07:32:19 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-06-25 16:03:17 +0900
commitff5e007b0d7dec9e8284d6cdae3b5bb3361911d6 (patch)
tree75b26c909713f3ec548b176d3fc498590a4b7bb1
parent910563941d0338fc8a5df701e0eff930068feb05 (diff)
don't call send_delete_all_flows function in the core
calling send_delete_all_flows function in the core (for all applications) is a bad idea since some applications don't want such (e.g. failover). send_delete_all_flows function doesn't work for OF1.2. nxm code needs the specific code for each OF version. I really don't want to do so. So let's not call this function in the core. At this point, it's impossible to write applications that can work with any OF versions (incluing nxm). Let applications do whatever they want. We should remove OF protocol version dependent functions (send_delete_all_flows, send_flow_mod, and send_flow_del). Also trying to enable NXM blindly is very bad for buggy hardware switches. But they are not called in the core code so I leave them alone for now. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/app/simple_isolation.py6
-rw-r--r--ryu/controller/handler.py17
2 files changed, 6 insertions, 17 deletions
diff --git a/ryu/app/simple_isolation.py b/ryu/app/simple_isolation.py
index 3535e73e..b17fd14d 100644
--- a/ryu/app/simple_isolation.py
+++ b/ryu/app/simple_isolation.py
@@ -52,6 +52,12 @@ class SimpleIsolation(app_manager.RyuApp):
@set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
def switch_features_handler(self, ev):
+ msg = ev.msg
+ datapath = msg.datapath
+
+ datapath.send_delete_all_flows()
+ datapath.send_barrier()
+
self.mac2port.dpid_add(ev.msg.datapath_id)
self.nw.add_datapath(ev.msg)
diff --git a/ryu/controller/handler.py b/ryu/controller/handler.py
index 9fc4e5ab..14f67580 100644
--- a/ryu/controller/handler.py
+++ b/ryu/controller/handler.py
@@ -191,23 +191,6 @@ class ConfigHandler(object):
)
datapath.send_msg(set_config)
- #
- # drop all flows in order to put datapath into unknown state
- #
- datapath.send_delete_all_flows()
-
- datapath.send_barrier()
-
- # We had better to move on to the main state after getting the
- # response of the barrier since it guarantees that the switch
- # is in the known state (all the flows were removed). However,
- # cbench doesn't work because it ignores the barrier. Also,
- # the above "known" state doesn't always work (for example,
- # the secondary controller should not remove all the flows in
- # the case of HA configuration). Let's move on to the main
- # state here for now. I guess that we need API to enable
- # applications to initialize switches in their own ways.
-
LOG.debug('move onto main mode')
ev.msg.datapath.ev_q.set_dispatcher(MAIN_DISPATCHER)