0f77b7ac588890f4c8c09e78aa03ca81f28dde1a
[kvmfornfv.git] / ci / envs / host-config
1 #!/bin/bash
2
3 ##############################################################################
4 ## Copyright (c) 2015 Intel Corp.
5 ##
6 ## All rights reserved. This program and the accompanying materials
7 ## are made available under the terms of the Apache License, Version 2.0
8 ## which accompanies this distribution, and is available at
9 ## http://www.apache.org/licenses/LICENSE-2.0
10 ###############################################################################
11
12 # Number of huge pages to create and on which NUMA node
13 numa_node=1
14 huge_pages=2
15
16 # QEMU executable path and number of cpus for guest
17 qemu=/usr/local/bin/qemu-system-x86_64
18 guest_cpus=2
19
20 # Isolated cpus for nfv, must be given as a range '-' and Numa node1 CPU's should be considered
21 host_isolcpus=`lscpu | grep "NUMA node1 CPU(s)"| awk -F ':' '{print \$2}' | sed 's/[[:space:]]//g'`
22 first=$(echo ${host_isolcpus} | cut -f1 -d-)
23 last=$(echo ${host_isolcpus} | cut -f2 -d-)
24
25 # Bind cpus from host_isolcpus range for QEMU processor threads
26 i=0
27 while [ ${i} -lt ${guest_cpus} ]; do
28  qemu_cpu[$i]=${first}
29  i=`expr $i + 1`
30  first=`expr $first + 1`
31 done
32
33 #Isolated cpus from host_isolcpus range to run Stress tool
34 stress_isolcpus=${first}-${last}
35 echo "Stress tool runs on $stress_isolcpus"