aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDino Simeon Madarang <dino.simeonx.madarang@intel.com>2015-08-18 23:44:36 +0100
committerMaryam Tahhan <maryam.tahhan@intel.com>2015-08-25 14:17:18 +0000
commita3ac6bb9958c96340cff07d7e464bf1028344318 (patch)
tree305bcd085f9b8b3dde7f376816dea4b9c653abf1
parent3af55a78fcd572f93b1a46178bffc4c8e90534f2 (diff)
vswitches: Affinitize vswitch threads for OVS-DPDK
JIRA: VSPERF-64 Change-Id: I7cefd05479da6fe17357da4da558f466175dd6fc Signed-off-by: Dino Simeon Madarang <dino.simeonx.madarang@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Al Morton <acmorton@att.com>
-rw-r--r--conf/02_vswitch.conf6
-rw-r--r--vswitches/ovs_dpdk_vhost.py11
2 files changed, 16 insertions, 1 deletions
diff --git a/conf/02_vswitch.conf b/conf/02_vswitch.conf
index 48bf5964..a9202c84 100644
--- a/conf/02_vswitch.conf
+++ b/conf/02_vswitch.conf
@@ -45,6 +45,12 @@ VSWITCH_VANILLA_KERNEL_MODULES = ['openvswitch']
# directory where hugepages will be mounted on system init
HUGEPAGE_DIR = '/dev/hugepages'
+# Sets OVS PMD core mask to 2 for CPU core 1 affinitization
+VSWITCH_PMD_CPU_MASK = '2'
+VSWITCH_AFFINITIZATION_ON = 1
+
+VSWITCH_FLOW_TIMEOUT = '30000'
+
# list of tuples of format (path, module_name), which will be inserted
# using 'insmod' on system init
diff --git a/vswitches/ovs_dpdk_vhost.py b/vswitches/ovs_dpdk_vhost.py
index 3ff41260..154d5357 100644
--- a/vswitches/ovs_dpdk_vhost.py
+++ b/vswitches/ovs_dpdk_vhost.py
@@ -65,7 +65,16 @@ class OvsDpdkVhost(IVSwitch):
bridge = OFBridge(switch_name)
bridge.create()
bridge.set_db_attribute('Open_vSwitch', '.',
- 'other_config:max-idle', '60000')
+ 'other_config:max-idle',
+ settings.getValue('VSWITCH_FLOW_TIMEOUT'))
+
+ if settings.getValue('VSWITCH_AFFINITIZATION_ON') == 1:
+ # Sets the PMD core mask to VSWITCH_PMD_CPU_MASK
+ # for CPU core affinitization
+ bridge.set_db_attribute('Open_vSwitch', '.',
+ 'other_config:pmd-cpu-mask',
+ settings.getValue('VSWITCH_PMD_CPU_MASK'))
+
bridge.set_db_attribute('Bridge', bridge.br_name,
'datapath_type', 'netdev')
self._bridges[switch_name] = bridge