add get_platform_cpus
Add helper function for platform cpu number calculation Change-Id: I6f656594e80fb067794cc14ba8f01db84585d198 Partial-Bug: 1834796 Signed-off-by: Bin Yang <bin.yang@intel.com>
This commit is contained in:
parent
7cbff55d9a
commit
a30e09bb87
@ -1,3 +1,3 @@
|
|||||||
SRC_DIR="worker-utils"
|
SRC_DIR="worker-utils"
|
||||||
COPY_LIST="$SRC_DIR/LICENSE"
|
COPY_LIST="$SRC_DIR/LICENSE"
|
||||||
TIS_PATCH_VER=3
|
TIS_PATCH_VER=4
|
||||||
|
@ -13,6 +13,7 @@ BuildRequires: systemd-devel
|
|||||||
Requires: systemd
|
Requires: systemd
|
||||||
Requires: python
|
Requires: python
|
||||||
Requires: /bin/systemctl
|
Requires: /bin/systemctl
|
||||||
|
Requires: perl
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Initial worker node resource reservation and misc. utilities
|
Initial worker node resource reservation and misc. utilities
|
||||||
|
@ -268,6 +268,17 @@ function get_platform_cpu_list {
|
|||||||
echo ${PLATFORM_CPULIST}
|
echo ${PLATFORM_CPULIST}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Return number of CPUs reserved for platform
|
||||||
|
################################################################################
|
||||||
|
function get_platform_cpus {
|
||||||
|
local PLATFORM_CPULIST
|
||||||
|
PLATFORM_CPULIST=($(platform_expanded_cpu_list | \
|
||||||
|
perl -pe 's/(\d+)-(\d+)/join(",",$1..$2)/eg'| \
|
||||||
|
sed 's/,/ /g'))
|
||||||
|
echo ${#PLATFORM_CPULIST[@]}
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Return list of CPUs reserved for vswitch
|
# Return list of CPUs reserved for vswitch
|
||||||
################################################################################
|
################################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user