aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2019-01-28 13:51:41 +0000
committerPeter Mikus <pmikus@cisco.com>2019-01-28 13:54:54 +0000
commit81dc66a10a70bb606531523bab6ffe96621cc7d4 (patch)
treee9b73729bbecf1ca156ae32d86a9938844d8496b
parenta8d3515144d3b83d390be864668c1648e948f107 (diff)
FIX: CPU util for NF
- Fix detecting total allocable CPUs for NFs Change-Id: If3345518befb887655d3e162551c49df3163ed92 Signed-off-by: Peter Mikus <pmikus@cisco.com> (cherry picked from commit 15648d7c4f98cc90a406519362b0d7f548893859)
-rw-r--r--resources/libraries/python/CpuUtils.py7
-rw-r--r--tests/vpp/perf/vm_vhost/2n-10ge2p1x710-eth-l2bd-32vhost-4chain-16vm-l3fwdip4-ndrpdr.robot2
2 files changed, 6 insertions, 3 deletions
diff --git a/resources/libraries/python/CpuUtils.py b/resources/libraries/python/CpuUtils.py
index aa1bd79419..57bf7fdb71 100644
--- a/resources/libraries/python/CpuUtils.py
+++ b/resources/libraries/python/CpuUtils.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2018 Cisco and/or its affiliates.
+# Copyright (c) 2019 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -268,7 +268,10 @@ class CpuUtils(object):
dt_req = ((kwargs['chains'] * kwargs['nodeness']) + kwargs['dtcr'] - 1)\
/ kwargs['dtcr']
- if kwargs['skip_cnt'] + mt_req + dt_req > cpu_list_len:
+ cpu_req = kwargs['skip_cnt'] + mt_req + dt_req
+ if smt_used and cpu_req > cpu_list_len / CpuUtils.NR_OF_THREADS:
+ raise RuntimeError("Not enough CPU cores available for placement!")
+ elif not smt_used and cpu_req > cpu_list_len:
raise RuntimeError("Not enough CPU cores available for placement!")
offset = (kwargs['node_id'] - 1) + (kwargs['chain_id'] - 1)\
diff --git a/tests/vpp/perf/vm_vhost/2n-10ge2p1x710-eth-l2bd-32vhost-4chain-16vm-l3fwdip4-ndrpdr.robot b/tests/vpp/perf/vm_vhost/2n-10ge2p1x710-eth-l2bd-32vhost-4chain-16vm-l3fwdip4-ndrpdr.robot
index 88fe68587e..259eb17593 100644
--- a/tests/vpp/perf/vm_vhost/2n-10ge2p1x710-eth-l2bd-32vhost-4chain-16vm-l3fwdip4-ndrpdr.robot
+++ b/tests/vpp/perf/vm_vhost/2n-10ge2p1x710-eth-l2bd-32vhost-4chain-16vm-l3fwdip4-ndrpdr.robot
@@ -57,7 +57,7 @@
# X710 bandwidth limit
| ${s_limit}= | ${10000000000}
# Traffic profile:
-| ${traffic_profile}= | trex-sl-2n3n-ethip4-ip4src254-4c16n
+| ${traffic_profile}= | trex-sl-2n3n-ethip4-ip4src254-4c4n
*** Keywords ***
| Local Template