aboutsummaryrefslogtreecommitdiffstats
path: root/vswitches
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2016-08-18 13:14:27 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-08-18 13:14:27 +0000
commit21c787b5bb7dd4592bc83718756ac670232a8347 (patch)
tree451c046251362978e86850488d3577969f5fe0d1 /vswitches
parent99e50b9aa86d3bd92d23a32ff34b5f80b9b3e4da (diff)
parent32361ffed1efce856e56a04029dcb72e5dcbf02d (diff)
Merge "old_style_multi-queue: Allows for multi-queue with ovs <= 2.5.0"
Diffstat (limited to 'vswitches')
-rw-r--r--vswitches/ovs_dpdk_vhost.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/vswitches/ovs_dpdk_vhost.py b/vswitches/ovs_dpdk_vhost.py
index 0950c426..39c8b633 100644
--- a/vswitches/ovs_dpdk_vhost.py
+++ b/vswitches/ovs_dpdk_vhost.py
@@ -72,12 +72,20 @@ class OvsDpdkVhost(IVSwitchOvs):
"""
dpdk.init()
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')):
+ tmp_br = OFBridge(timeout=-1)
+ tmp_br.set_db_attribute(
+ 'Open_vSwitch', '.', 'other_config:' +
+ 'n-dpdk-rxqs', settings.getValue('VSWITCH_MULTI_QUEUES'))
def stop(self):
"""See IVswitch for general description
Kills ovsdb and vswitchd and removes DPDK kernel modules.
"""
+
super(OvsDpdkVhost, self).stop()
dpdk.cleanup()
dpdk.remove_vhost_modules()
@@ -90,7 +98,6 @@ class OvsDpdkVhost(IVSwitchOvs):
switch_params = switch_params + params
super(OvsDpdkVhost, self).add_switch(switch_name, switch_params)
-
if settings.getValue('VSWITCH_AFFINITIZATION_ON') == 1:
# Sets the PMD core mask to VSWITCH_PMD_CPU_MASK
# for CPU core affinitization
@@ -109,7 +116,8 @@ 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')):
+ if int(settings.getValue('VSWITCH_MULTI_QUEUES')) and \
+ not settings.getValue('OVS_OLD_STYLE_MQ'):
params += ['options:n_rxq={}'.format(
settings.getValue('VSWITCH_MULTI_QUEUES'))]
of_port = bridge.add_port(port_name, params)
@@ -133,7 +141,8 @@ 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')):
+ if int(settings.getValue('VSWITCH_MULTI_QUEUES')) and \
+ not settings.getValue('OVS_OLD_STYLE_MQ'):
params += ['options:n_rxq={}'.format(
settings.getValue('VSWITCH_MULTI_QUEUES'))]
of_port = bridge.add_port(port_name, params)