def add_switch(self, switch_name, params=None): """See IVswitch for general description """ # create and configure new ovs bridge and delete all default flows bridge = OFBridge(switch_name) bridge.create(params) bridge.del_flow({}) bridge.set_db_attribute('Open_vSwitch', '.', 'other_config:max-idle', settings.getValue('VSWITCH_FLOW_TIMEOUT')) self._switches[switch_name] = bridge if settings.getValue('OVS_ROUTING_TABLES'): # table#0 - flows designed to force 5 & 13 tuple matches go here flow = {'table': '0', 'priority': '1', 'actions': ['goto_table:1']} bridge.add_flow(flow) # table#1 - flows to route packets between ports goes here. The # chosen port is communicated to subsequent tables by setting the # metadata value to the egress port number # # A placeholder - flows are added into this table by deployments # or by TestSteps via add_connection() method # table#2 - frame modification table. Frame modification flow rules are # isolated in this table so that they can be turned on or off # without affecting the routing or tuple-matching flow rules. flow = {'table': '2', 'priority': '1', 'actions': ['goto_table:3']} bridge.add_flow(flow) # table#3 - egress table # (NOTE) Billy O'Mahony - the drop action here actually required in # order to egress the packet. This is the subject of a thread on # ovs-discuss 2015-06-30. flow = {'table': '3', 'priority': '1', 'actions': ['drop']} bridge.add_flow(flow)
def add_switch(self, switch_name, params=None): """See IVswitch for general description """ bridge = OFBridge(switch_name) bridge.create(params) bridge.set_db_attribute('Open_vSwitch', '.', 'other_config:max-idle', settings.getValue('VSWITCH_FLOW_TIMEOUT')) self._bridges[switch_name] = bridge
def add_switch(self, switch_name, params=None): """See IVswitch for general description """ bridge = OFBridge(switch_name) bridge.create(params) bridge.set_db_attribute('Open_vSwitch', '.', 'other_config:max-idle', '60000') self._bridges[switch_name] = bridge
def add_switch(self, switch_name, params=None): """See IVswitch for general description """ bridge = OFBridge(switch_name) if params is None: bridge.create( ['--', 'set', 'bridge', switch_name, 'datapath_type=netdev']) else: bridge.create( ['--', 'set', 'bridge', switch_name, 'datapath_type=netdev'] + params) bridge.set_db_attribute('Open_vSwitch', '.', 'other_config:max-idle', settings.getValue('VSWITCH_FLOW_TIMEOUT')) if settings.getValue('VSWITCH_AFFINITIZATION_ON') == 1: # Sets the PMD core mask to VSWITCH_PMD_CPU_MASK # for CPU core affinitization bridge.set_db_attribute('Open_vSwitch', '.', 'other_config:pmd-cpu-mask', settings.getValue('VSWITCH_PMD_CPU_MASK')) self._bridges[switch_name] = bridge