summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-02-05 16:02:22 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-02-05 16:02:22 +0900
commitf4063f2f0614923baadca50a0046869674eca26d (patch)
tree242d027cf503d8992057ebc5205987150fd6301d
parent567cb2c364479068c86a49044f8aff739de69333 (diff)
move to the main mode right after sending 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. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/controller/handler.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/ryu/controller/handler.py b/ryu/controller/handler.py
index d6a33bed..9b61b44d 100644
--- a/ryu/controller/handler.py
+++ b/ryu/controller/handler.py
@@ -197,6 +197,20 @@ class ConfigHandler(object):
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)
+
+
# The above OFPC_DELETE request may trigger flow removed ofp_event.
# Just ignore them.
@staticmethod
@@ -209,10 +223,6 @@ class ConfigHandler(object):
def barrier_reply_handler(ev):
LOG.debug('barrier reply ev %s msg %s', ev, ev.msg)
- # move on to main state
- LOG.debug('move onto main mode')
- ev.msg.datapath.ev_q.set_dispatcher(MAIN_DISPATCHER)
-
@register_cls(MAIN_DISPATCHER)
class MainHandler(object):