1 # Copyright 2015-2016 Intel Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # ############################
17 # ############################
18 VNF_DIR = os.path.join(ROOT_DIR, 'vnfs/')
19 VNF = 'QemuDpdkVhostUser'
20 VNF_AFFINITIZATION_ON = True
22 # ############################
23 # Directories, executables and log files
24 # ############################
26 # please see conf/00_common.conf for description of PATHS dictionary
30 'path': os.path.join(ROOT_DIR, 'src/qemu/qemu/'),
31 'qemu-system': 'x86_64-softmmu/qemu-system-x86_64'
34 'qemu-system': 'qemu-system-x86_64'
39 LOG_FILE_QEMU = 'qemu.log'
41 # log file for all commands executed on guest(s)
42 # multiple guests will result in log files with the guest number appended
43 LOG_FILE_GUEST_CMDS = 'guest-cmds.log'
45 # ############################
47 # ############################
48 # All configuration options related to a particular VM instance are defined as
49 # lists and prefixed with `GUEST_` label. It is essential, that there is enough
50 # items in all `GUEST_` options to cover all VM instances involved in the test.
51 # In case there is not enough items, then VSPERF will use the first item of
52 # particular `GUEST_` option to expand the list to required length. First option
53 # can contain macros starting with `#` to generate VM specific values. These
54 # macros can be used only for options of `list` or `str` types with `GUEST_`
56 # Following macros are supported:
58 # * #VMINDEX - it is replaced by index of VM being executed; This macro is
59 # expanded first, so it can be used inside other macros.
61 # * #MAC(mac_address[, step]) - it will iterate given `mac_address` with
62 # optional `step`. In case that step is not defined, then it is set to 1.
63 # It means, that first VM will use the value of `mac_address`, second VM
64 # value of `mac_address` increased by `step`, etc.
66 # * #IP(ip_address[, step]) - it will iterate given `ip_address` with optional
67 # step. In case that step is not defined, then it is set to 1.
68 # It means, that first VM will use the value of `ip_address`, second VM
69 # value of `ip_address` increased by `step`, etc.
71 # * #EVAL(expression) - it will evaluate given `expression` as python code;
72 # Only simple expressions should be used. Call of the functions is not
75 # directory which is shared to QEMU guests. Useful for exchanging files
76 # between host and guest, VNF specific share will be created
77 # For 2 VNFs you may use ['/tmp/qemu0_share', '/tmp/qemu1_share']
78 GUEST_SHARE_DIR = ['/tmp/qemu0_share']
80 # location of guest disk image
81 # For 2 VNFs you may use ['guest1.img', 'guest2.img']
84 # guarding timer for VM start up
85 # For 2 VNFs you may use [180, 180]
88 # Guest images may require different drive types such as ide to mount shared
89 # locations and/or boot correctly. You can modify the types here.
90 GUEST_BOOT_DRIVE_TYPE = ['scsi']
91 GUEST_SHARED_DRIVE_TYPE = ['scsi']
93 # packet forwarding mode supported by testpmd; Please see DPDK documentation
94 # for comprehensive list of modes supported by your version.
95 # e.g. io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho|...
96 # Note: Option "mac_retry" has been changed to "mac retry" since DPDK v16.07
97 GUEST_TESTPMD_FWD_MODE = 'csum'
99 # guest loopback application method; supported options are:
100 # 'testpmd' - testpmd from dpdk will be built and used
101 # 'l2fwd' - l2fwd module provided by Huawei will be built and used
102 # 'linux_bridge' - linux bridge will be configured
103 # 'buildin' - nothing will be configured by vsperf; VM image must
104 # ensure traffic forwarding between its interfaces
105 # This configuration option can be overridden by CLI SCALAR option
106 # guest_loopback, e.g. --test-params "guest_loopback=l2fwd"
107 # For 2 VNFs you may use ['testpmd', 'l2fwd']
108 GUEST_LOOPBACK = ['testpmd']
110 # username for guest image
111 GUEST_USERNAME = ['root']
113 # password for guest image
114 GUEST_PASSWORD = ['root']
116 # login username prompt for guest image
117 GUEST_PROMPT_LOGIN = ['.* login:']
119 # login password prompt for guest image
120 GUEST_PROMPT_PASSWORD = ['Password: ']
122 # standard prompt for guest image
123 GUEST_PROMPT = ['root.*#']
125 # defines the number of NICs configured for each guest, it must be less or equal to
126 # the number of NICs configured in GUEST_NICS
129 # template for guests with 4 NICS, but only GUEST_NICS_NR NICS will be configured at runtime
130 GUEST_NICS = [[{'device' : 'eth0', 'mac' : '#MAC(00:00:00:00:00:01,2)', 'pci' : '00:04.0', 'ip' : '#IP(192.168.1.2,4)/24'},
131 {'device' : 'eth1', 'mac' : '#MAC(00:00:00:00:00:02,2)', 'pci' : '00:05.0', 'ip' : '#IP(192.168.1.3,4)/24'},
132 {'device' : 'eth2', 'mac' : '#MAC(cc:00:00:00:00:01,2)', 'pci' : '00:06.0', 'ip' : '#IP(192.168.1.4,4)/24'},
133 {'device' : 'eth3', 'mac' : '#MAC(cc:00:00:00:00:02,2)', 'pci' : '00:07.0', 'ip' : '#IP(192.168.1.5,4)/24'},
136 # amount of host memory allocated for each guest
137 GUEST_MEMORY = ['2048']
138 # number of hugepages configured inside each guest
139 GUEST_HUGEPAGES_NR = ['1024']
141 # test-pmd requires 2 VM cores
144 # Host cores to use to affinitize the SMP cores of a QEMU instance
145 # For 2 VNFs you may use [(4,5), (6, 7)]
146 GUEST_CORE_BINDING = [('#EVAL(6+2*#VMINDEX)', '#EVAL(7+2*#VMINDEX)')]
148 # Queues per NIC inside guest for multi-queue configuration, requires switch
149 # multi-queue to be enabled for dpdk. Set to 0 for disabled. Can be enabled if
150 # using Vanilla OVS without enabling switch multi-queue.
151 GUEST_NIC_QUEUES = [0]
153 # Disable VHost user guest NIC merge buffers by enabling the below setting. This
154 # can improve performance when not using Jumbo Frames.
155 GUEST_NIC_MERGE_BUFFERS_DISABLE = [True]
157 # Virtio-Net vhost thread CPU mapping. If using vanilla OVS with virtio-net,
158 # you can affinitize the vhost-net threads by enabling the below setting. There
159 # is one vhost-net thread per port per queue so one guest with 2 queues will
160 # have 4 vhost-net threads. If more threads are present than CPUs given, the
161 # affinitize will overlap CPUs in a round robin fashion.
162 VSWITCH_VHOST_NET_AFFINITIZATION = False
163 VSWITCH_VHOST_CPU_MAP = [4,5,8,11]
165 GUEST_START_TIMEOUT = [120]
166 GUEST_OVS_DPDK_DIR = ['/root/ovs_dpdk']
167 GUEST_OVS_DPDK_SHARE = ['/mnt/ovs_dpdk_share']
169 # IP addresses to use for Vanilla OVS PXP testing
170 # Consider using RFC 2544/3330 recommended IP addresses for benchmark testing.
171 # Network: 198.18.0.0/15
172 # Netmask: 255.254.0.0
173 # Broadcast: 198.19.255.255
174 # First IP: 198.18.0.1
175 # Last IP: 198.19.255.254
179 # ARP entries for the IXIA ports and the bridge you are using:
180 VANILLA_TGEN_PORT1_IP = '1.1.1.10'
181 VANILLA_TGEN_PORT1_MAC = 'AA:BB:CC:DD:EE:FF'
183 VANILLA_TGEN_PORT2_IP = '1.1.2.10'
184 VANILLA_TGEN_PORT2_MAC = 'AA:BB:CC:DD:EE:F0'
186 GUEST_BRIDGE_IP = ['#IP(1.1.1.5)/16']
188 # ############################
189 # Guest TESTPMD configuration
190 # ############################
192 # packet forwarding mode supported by testpmd; Please see DPDK documentation
193 # for comprehensive list of modes supported by your version.
194 # e.g. io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho|...
195 # Note: Option "mac_retry" has been changed to "mac retry" since DPDK v16.07
196 GUEST_TESTPMD_FWD_MODE = ['csum']
198 # Set the CPU mask for testpmd loopback. To bind to specific guest CPUs use -l
199 # GUEST_TESTPMD_CPU_MASK = ['-l 0,1']
200 GUEST_TESTPMD_CPU_MASK = ['-c 0x3']
202 # Testpmd multi-core config. Leave at 0's for disabled. Will not enable unless
203 # GUEST_NIC_QUEUES are > 0. For bi directional traffic NB_CORES must be equal
205 GUEST_TESTPMD_NB_CORES = [0]
206 GUEST_TESTPMD_TXQ = [0]
207 GUEST_TESTPMD_RXQ = [0]