aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/ContainerUtils.py
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2018-07-25 06:47:34 +0000
committerPeter Mikus <pmikus@cisco.com>2018-07-27 22:21:46 +0000
commit3f074f530223783e9e986dfe2f4b64af93483abc (patch)
treea4b7a3732f7ea5f0ed6cff12349ed00d7870f92b /resources/libraries/python/ContainerUtils.py
parentc7b2541ae5ff737691547daef2e4b25f9d232eba (diff)
FIX: Interface up handling
- Increase timeout when trying to check interface (this is useful if there are multiple interfaces and dump command take more than TIMEOUT/NR_IF which is happening quite often). - Reverse the order of applying MTU and interface UP to try to prevent API overload during interface initialization phase. Change-Id: I4e8623963d15b3c0d202172b4c58c43a972bb9cb Signed-off-by: Peter Mikus <pmikus@cisco.com> (cherry picked from commit 584345da4f7330f7517e5defd894b4995c2b57b0)
Diffstat (limited to 'resources/libraries/python/ContainerUtils.py')
-rw-r--r--resources/libraries/python/ContainerUtils.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/resources/libraries/python/ContainerUtils.py b/resources/libraries/python/ContainerUtils.py
index 5e1ab5ab4f..9a141767b9 100644
--- a/resources/libraries/python/ContainerUtils.py
+++ b/resources/libraries/python/ContainerUtils.py
@@ -80,14 +80,21 @@ class ContainerManager(object):
# Set cpuset.cpus cgroup
skip_cnt = kwargs['cpu_skip']
+ smt_used = CpuUtils.is_smt_enabled(kwargs['node']['cpuinfo'])
if not kwargs['cpu_shared']:
skip_cnt += kwargs['i'] * kwargs['cpu_count']
self.engine.container.cpuset_cpus = \
CpuUtils.cpu_slice_of_list_per_node(node=kwargs['node'],
cpu_node=kwargs['cpuset_mems'],
skip_cnt=skip_cnt,
- cpu_cnt=kwargs['cpu_count'],
- smt_used=kwargs['smt_used'])
+ cpu_cnt=1,
+ smt_used=False) \
+ + \
+ CpuUtils.cpu_slice_of_list_per_node(node=kwargs['node'],
+ cpu_node=kwargs['cpuset_mems'],
+ skip_cnt=skip_cnt+1,
+ cpu_cnt=kwargs['cpu_count']-1,
+ smt_used=smt_used)
# Store container instance
self.containers[kwargs['name']] = self.engine.container
@@ -340,6 +347,7 @@ class ContainerEngine(object):
'priority=1',
config_file=SUPERVISOR_CONF))
self.execute('supervisorctl reload')
+ self.execute('supervisorctl restart vpp')
def restart_vpp(self):
"""Restart VPP service inside a container."""