Merge pull request #149 from MurphyMc/ovs_userspace_v2
node: Allow OVSSwitch to run in userspace mode
This commit is contained in:
+6
-2
@@ -896,12 +896,14 @@ class OVSLegacyKernelSwitch( Switch ):
|
|||||||
class OVSSwitch( Switch ):
|
class OVSSwitch( Switch ):
|
||||||
"Open vSwitch switch. Depends on ovs-vsctl."
|
"Open vSwitch switch. Depends on ovs-vsctl."
|
||||||
|
|
||||||
def __init__( self, name, failMode='secure', **params ):
|
def __init__( self, name, failMode='secure', datapath='kernel', **params ):
|
||||||
"""Init.
|
"""Init.
|
||||||
name: name for switch
|
name: name for switch
|
||||||
failMode: controller loss behavior (secure|open)"""
|
failMode: controller loss behavior (secure|open)
|
||||||
|
datapath: userspace or kernel mode (kernel|user)"""
|
||||||
Switch.__init__( self, name, **params )
|
Switch.__init__( self, name, **params )
|
||||||
self.failMode = failMode
|
self.failMode = failMode
|
||||||
|
self.datapath = datapath
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup( cls ):
|
def setup( cls ):
|
||||||
@@ -956,6 +958,8 @@ class OVSSwitch( Switch ):
|
|||||||
# Annoyingly, --if-exists option seems not to work
|
# Annoyingly, --if-exists option seems not to work
|
||||||
self.cmd( 'ovs-vsctl del-br', self )
|
self.cmd( 'ovs-vsctl del-br', self )
|
||||||
self.cmd( 'ovs-vsctl add-br', self )
|
self.cmd( 'ovs-vsctl add-br', self )
|
||||||
|
if self.datapath == 'user':
|
||||||
|
self.cmd( 'ovs-vsctl set bridge', self,'datapath_type=netdev' )
|
||||||
self.cmd( 'ovs-vsctl -- set Bridge', self,
|
self.cmd( 'ovs-vsctl -- set Bridge', self,
|
||||||
'other_config:datapath-id=' + self.dpid )
|
'other_config:datapath-id=' + self.dpid )
|
||||||
self.cmd( 'ovs-vsctl set-fail-mode', self, self.failMode )
|
self.cmd( 'ovs-vsctl set-fail-mode', self, self.failMode )
|
||||||
|
|||||||
Reference in New Issue
Block a user