Skip to content
Snippets Groups Projects
Commit 153d598d authored by Murphy McCauley's avatar Murphy McCauley
Browse files

node: Allow OVSSwitch to run in userspace mode

This adds a datapath parameter to OVSSwitch which allows one to tell OVS to
run in userspace mode rather than kernel mode.  From the commandline, this
is --switch=ovsk,datapath=user.

Note that this makes "ovsk" and the OVSKernelSwitch alias misnomers.  Since
the default behavior is still kernel mode, this is hopefully harmless.

This is the second version of this patch, which changes the argument name
and values according to Bob's suggestion.
parent 3582facd
No related branches found
No related tags found
No related merge requests found
......@@ -896,12 +896,14 @@ def stop( self ):
class OVSSwitch( Switch ):
"Open vSwitch switch. Depends on ovs-vsctl."
def __init__( self, name, failMode='secure', **params ):
def __init__( self, name, failMode='secure', datapath='kernel', **params ):
"""Init.
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 )
self.failMode = failMode
self.datapath = datapath
@classmethod
def setup( cls ):
......@@ -956,6 +958,8 @@ def start( self, controllers ):
# Annoyingly, --if-exists option seems not to work
self.cmd( 'ovs-vsctl del-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,
'other_config:datapath-id=' + self.dpid )
self.cmd( 'ovs-vsctl set-fail-mode', self, self.failMode )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment