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>
This commit is contained in:
FUJITA Tomonori 2012-06-24 07:32:19 +09:00
parent 910563941d
commit ff5e007b0d
2 changed files with 6 additions and 17 deletions

View File

@ -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)

View File

@ -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)