Revision 153d598d

View differences:

mininet/node.py
896 896
class OVSSwitch( Switch ):
897 897
    "Open vSwitch switch. Depends on ovs-vsctl."
898 898

  
899
    def __init__( self, name, failMode='secure', **params ):
899
    def __init__( self, name, failMode='secure', datapath='kernel', **params ):
900 900
        """Init.
901 901
           name: name for switch
902
           failMode: controller loss behavior (secure|open)"""
902
           failMode: controller loss behavior (secure|open)
903
           datapath: userspace or kernel mode (kernel|user)"""
903 904
        Switch.__init__( self, name, **params )
904 905
        self.failMode = failMode
906
        self.datapath = datapath
905 907

  
906 908
    @classmethod
907 909
    def setup( cls ):
......
956 958
        # Annoyingly, --if-exists option seems not to work
957 959
        self.cmd( 'ovs-vsctl del-br', self )
958 960
        self.cmd( 'ovs-vsctl add-br', self )
961
        if self.datapath == 'user':
962
            self.cmd( 'ovs-vsctl set bridge', self,'datapath_type=netdev' )
959 963
        self.cmd( 'ovs-vsctl -- set Bridge', self,
960 964
                  'other_config:datapath-id=' + self.dpid )
961 965
        self.cmd( 'ovs-vsctl set-fail-mode', self, self.failMode )

Also available in: Unified diff