aboutsummaryrefslogtreecommitdiffstats
path: root/vswitches
diff options
context:
space:
mode:
Diffstat (limited to 'vswitches')
-rw-r--r--vswitches/ovs_dpdk_vhost.py13
-rw-r--r--vswitches/ovs_vanilla.py27
2 files changed, 22 insertions, 18 deletions
diff --git a/vswitches/ovs_dpdk_vhost.py b/vswitches/ovs_dpdk_vhost.py
index cebc14b2..c0764c87 100644
--- a/vswitches/ovs_dpdk_vhost.py
+++ b/vswitches/ovs_dpdk_vhost.py
@@ -70,11 +70,11 @@ class OvsDpdkVhost(IVSwitchOvs):
super(OvsDpdkVhost, self).start()
# old style OVS <= 2.5.0 multi-queue enable
if settings.getValue('OVS_OLD_STYLE_MQ') and \
- int(settings.getValue('VSWITCH_MULTI_QUEUES')):
+ int(settings.getValue('VSWITCH_DPDK_MULTI_QUEUES')):
tmp_br = OFBridge(timeout=-1)
tmp_br.set_db_attribute(
'Open_vSwitch', '.', 'other_config:' +
- 'n-dpdk-rxqs', settings.getValue('VSWITCH_MULTI_QUEUES'))
+ 'n-dpdk-rxqs', settings.getValue('VSWITCH_DPDK_MULTI_QUEUES'))
def stop(self):
"""See IVswitch for general description
@@ -112,10 +112,11 @@ class OvsDpdkVhost(IVSwitchOvs):
port_name = 'dpdk' + str(dpdk_count)
params = ['--', 'set', 'Interface', port_name, 'type=dpdk']
# multi-queue enable
- if int(settings.getValue('VSWITCH_MULTI_QUEUES')) and \
+
+ if int(settings.getValue('VSWITCH_DPDK_MULTI_QUEUES')) and \
not settings.getValue('OVS_OLD_STYLE_MQ'):
params += ['options:n_rxq={}'.format(
- settings.getValue('VSWITCH_MULTI_QUEUES'))]
+ settings.getValue('VSWITCH_DPDK_MULTI_QUEUES'))]
of_port = bridge.add_port(port_name, params)
return (port_name, of_port)
@@ -131,10 +132,10 @@ class OvsDpdkVhost(IVSwitchOvs):
port_name = 'dpdkvhostuser' + str(vhost_count)
params = ['--', 'set', 'Interface', port_name, 'type=dpdkvhostuser']
# multi queue enable
- if int(settings.getValue('VSWITCH_MULTI_QUEUES')) and \
+ if int(settings.getValue('VSWITCH_DPDK_MULTI_QUEUES')) and \
not settings.getValue('OVS_OLD_STYLE_MQ'):
params += ['options:n_rxq={}'.format(
- settings.getValue('VSWITCH_MULTI_QUEUES'))]
+ settings.getValue('VSWITCH_DPDK_MULTI_QUEUES'))]
of_port = bridge.add_port(port_name, params)
return (port_name, of_port)
diff --git a/vswitches/ovs_vanilla.py b/vswitches/ovs_vanilla.py
index f880dfaf..332725e3 100644
--- a/vswitches/ovs_vanilla.py
+++ b/vswitches/ovs_vanilla.py
@@ -60,9 +60,10 @@ class OvsVanilla(IVSwitchOvs):
# remove all tap interfaces
for i in range(self._vport_id):
tapx = 'tap' + str(i)
- tasks.run_task(['sudo', 'ip', 'tuntap', 'del',
- tapx, 'mode', 'tap'],
- self._logger, 'Deleting ' + tapx, False)
+ tap_cmd_list = ['sudo', 'ip', 'tuntap', 'del', tapx, 'mode', 'tap']
+ if int(settings.getValue('GUEST_NIC_QUEUES')):
+ tap_cmd_list += ['multi_queue']
+ tasks.run_task(tap_cmd_list, self._logger, 'Deleting ' + tapx, False)
self._vport_id = 0
super(OvsVanilla, self).stop()
@@ -71,7 +72,6 @@ class OvsVanilla(IVSwitchOvs):
self._module_manager.remove_modules()
-
def add_phy_port(self, switch_name):
"""
Method adds port based on detected device names.
@@ -111,14 +111,17 @@ class OvsVanilla(IVSwitchOvs):
# Create tap devices for the VM
tap_name = 'tap' + str(self._vport_id)
self._vport_id += 1
-
- tasks.run_task(['sudo', 'ip', 'tuntap', 'del',
- tap_name, 'mode', 'tap'],
- self._logger, 'Creating tap device...', False)
-
- tasks.run_task(['sudo', 'ip', 'tuntap', 'add',
- tap_name, 'mode', 'tap'],
- self._logger, 'Creating tap device...', False)
+ tap_cmd_list = ['sudo', 'ip', 'tuntap', 'del', tap_name, 'mode', 'tap']
+ if int(settings.getValue('GUEST_NIC_QUEUES')):
+ tap_cmd_list += ['multi_queue']
+ tasks.run_task(tap_cmd_list, self._logger,
+ 'Creating tap device...', False)
+
+ tap_cmd_list = ['sudo', 'ip', 'tuntap', 'add', tap_name, 'mode', 'tap']
+ if int(settings.getValue('GUEST_NIC_QUEUES')):
+ tap_cmd_list += ['multi_queue']
+ tasks.run_task(tap_cmd_list, self._logger,
+ 'Creating tap device...', False)
tasks.run_task(['sudo', 'ip', 'addr', 'flush', 'dev', tap_name],
self._logger, 'Remove IP', False)