Merge "multi VM: Multi VMs in serial or parallel"
[vswitchperf.git] / conf / 04_vnf.conf
1 # Copyright 2015-2016 Intel Corporation.
2 #
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
6 #
7 #   http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14
15 # ############################
16 # VNF configuration
17 # ############################
18 VNF_DIR = 'vnfs/'
19 VNF = 'QemuDpdkVhostUser'
20 VNF_AFFINITIZATION_ON = True
21
22 # ############################
23 # Executables and log files
24 # ############################
25
26 QEMU_BIN = os.path.join(QEMU_DIR, 'x86_64-softmmu/qemu-system-x86_64')
27
28 # log file for qemu
29 LOG_FILE_QEMU = 'qemu.log'
30
31 # log file for all commands executed on guest(s)
32 # multiple guests will result in log files with the guest number appended
33 LOG_FILE_GUEST_CMDS = 'guest-cmds.log'
34
35 # ############################
36 # Guest configuration
37 # ############################
38 # All configuration options related to a particular VM instance are defined as
39 # lists and prefixed with `GUEST_` label. It is essential, that there is enough
40 # items in all `GUEST_` options to cover all VM instances involved in the test.
41 # In case there is not enough items, then VSPERF will use the first item of
42 # particular `GUEST_` option to expand the list to required length. First option
43 # can contain macros starting with `#` to generate VM specific values. These
44 # macros can be used only for options of `list` or `str` types with `GUEST_`
45 # prefix.
46 # Following macros are supported:
47 #
48 # * #VMINDEX - it is replaced by index of VM being executed; This macro is
49 #   expanded first, so it can be used inside other macros.
50 #
51 # * #MAC(mac_address[, step]) - it will iterate given `mac_address` with
52 #   optional `step`. In case that step is not defined, then it is set to 1.
53 #   It means, that first VM will use the value of `mac_address`, second VM
54 #   value of `mac_address` increased by `step`, etc.
55 #
56 # * #IP(ip_address[, step]) - it will iterate given `ip_address` with optional
57 #   step. In case that step is not defined, then it is set to 1.
58 #   It means, that first VM will use the value of `ip_address`, second VM
59 #   value of `ip_address` increased by `step`, etc.
60 #
61 # * #EVAL(expression) - it will evaluate given `expression` as python code;
62 #   Only simple expressions should be used. Call of the functions is not
63 #   supported.
64
65 # directory which is shared to QEMU guests. Useful for exchanging files
66 # between host and guest, VNF specific share will be created
67 # For 2 VNFs you may use ['/tmp/qemu0_share', '/tmp/qemu1_share']
68 GUEST_SHARE_DIR = ['/tmp/qemu0_share']
69
70 # location of guest disk image
71 # For 2 VNFs you may use ['guest1.img', 'guest2.img']
72 GUEST_IMAGE = ['']
73
74 # guarding timer for VM start up
75 # For 2 VNFs you may use [180, 180]
76 GUEST_TIMEOUT = [180]
77
78 # Guest images may require different drive types such as ide to mount shared
79 # locations and/or boot correctly. You can modify the types here.
80 GUEST_BOOT_DRIVE_TYPE = ['scsi']
81 GUEST_SHARED_DRIVE_TYPE = ['scsi']
82
83 # packet forwarding mode supported by testpmd; Please see DPDK documentation
84 # for comprehensive list of modes supported by your version.
85 # e.g. io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho|...
86 # Note: Option "mac_retry" has been changed to "mac retry" since DPDK v16.07
87 GUEST_TESTPMD_FWD_MODE = 'csum'
88
89 # guest loopback application method; supported options are:
90 #       'testpmd'       - testpmd from dpdk will be built and used
91 #       'l2fwd'         - l2fwd module provided by Huawei will be built and used
92 #       'linux_bridge'  - linux bridge will be configured
93 #       'buildin'       - nothing will be configured by vsperf; VM image must
94 #                         ensure traffic forwarding between its interfaces
95 # This configuration option can be overridden by CLI SCALAR option
96 # guest_loopback, e.g. --test-params "guest_loopback=l2fwd"
97 # For 2 VNFs you may use ['testpmd', 'l2fwd']
98 GUEST_LOOPBACK = ['testpmd']
99
100 # username for guest image
101 GUEST_USERNAME = ['root']
102
103 # password for guest image
104 GUEST_PASSWORD = ['root']
105
106 # login username prompt for guest image
107 GUEST_PROMPT_LOGIN = ['.* login:']
108
109 # login password prompt for guest image
110 GUEST_PROMPT_PASSWORD = ['Password: ']
111
112 # standard prompt for guest image
113 GUEST_PROMPT = ['root.*#']
114
115 # defines the number of NICs configured for each guest, it must be less or equal to
116 # the number of NICs configured in GUEST_NICS
117 GUEST_NICS_NR = [2]
118
119 # template for guests with 4 NICS, but only GUEST_NICS_NR NICS will be configured at runtime
120 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'},
121                {'device' : 'eth1', 'mac' : '#MAC(00:00:00:00:00:02,2)', 'pci' : '00:05.0', 'ip' : '#IP(192.168.1.3,4)/24'},
122                {'device' : 'eth2', 'mac' : '#MAC(cc:00:00:00:00:01,2)', 'pci' : '00:06.0', 'ip' : '#IP(192.168.1.4,4)/24'},
123                {'device' : 'eth3', 'mac' : '#MAC(cc:00:00:00:00:02,2)', 'pci' : '00:07.0', 'ip' : '#IP(192.168.1.5,4)/24'},
124              ]]
125
126 # amount of host memory allocated for each guest
127 GUEST_MEMORY = ['2048']
128 # number of hugepages configured inside each guest
129 GUEST_HUGEPAGES_NR = ['1024']
130
131 # test-pmd requires 2 VM cores
132 GUEST_SMP = ['2']
133
134 # Host cores to use to affinitize the SMP cores of a QEMU instance
135 # For 2 VNFs you may use [(4,5), (6, 7)]
136 GUEST_CORE_BINDING = [('#EVAL(6+2*#VMINDEX)', '#EVAL(7+2*#VMINDEX)')]
137
138 # Queues per NIC inside guest for multi-queue configuration, requires switch
139 # multi-queue to be enabled for dpdk. Set to 0 for disabled. Can be enabled if
140 # using Vanilla OVS without enabling switch multi-queue.
141 GUEST_NIC_QUEUES = [0]
142
143 # Virtio-Net vhost thread CPU mapping. If using  vanilla OVS with virtio-net,
144 # you can affinitize the vhost-net threads by enabling the below setting. There
145 # is one vhost-net thread per port per queue so one guest with 2 queues will
146 # have 4 vhost-net threads. If more threads are present than CPUs given, the
147 # affinitize will overlap CPUs.
148 VSWITCH_VHOST_NET_AFFINITIZATION = False
149 VSWITCH_VHOST_CPU_MAP = [4,5,8,11]
150
151 GUEST_START_TIMEOUT = [120]
152 GUEST_OVS_DPDK_DIR = ['/root/ovs_dpdk']
153 GUEST_OVS_DPDK_SHARE = ['/mnt/ovs_dpdk_share']
154
155 # IP addresses to use for Vanilla OVS PXP testing
156 # Consider using RFC 2544/3330 recommended IP addresses for benchmark testing.
157 # Network: 198.18.0.0/15
158 # Netmask: 255.254.0.0
159 # Broadcast: 198.19.255.255
160 # First IP: 198.18.0.1
161 # Last IP: 198.19.255.254
162 # Hosts: 131070
163 #
164
165 # ARP entries for the IXIA ports and the bridge you are using:
166 VANILLA_TGEN_PORT1_IP = '1.1.1.10'
167 VANILLA_TGEN_PORT1_MAC = 'AA:BB:CC:DD:EE:FF'
168
169 VANILLA_TGEN_PORT2_IP = '1.1.2.10'
170 VANILLA_TGEN_PORT2_MAC = 'AA:BB:CC:DD:EE:F0'
171
172 GUEST_BRIDGE_IP = ['#IP(1.1.1.5)/16']
173
174 # ############################
175 # Guest TESTPMD configuration
176 # ############################
177
178 # packet forwarding mode supported by testpmd; Please see DPDK documentation
179 # for comprehensive list of modes supported by your version.
180 # e.g. io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho|...
181 # Note: Option "mac_retry" has been changed to "mac retry" since DPDK v16.07
182 GUEST_TESTPMD_FWD_MODE = ['csum']
183
184 # Set the CPU mask for testpmd loopback. To bind to specific guest CPUs use -l
185 # GUEST_TESTPMD_CPU_MASK = ['-l 0,1']
186 GUEST_TESTPMD_CPU_MASK = ['-c 0x3']
187
188 # Testpmd multi-core config. Leave at 0's for disabled. Will not enable unless
189 # GUEST_NIC_QUEUES are > 0. For bi directional traffic NB_CORES must be equal
190 # to (RXQ + TXQ).
191 GUEST_TESTPMD_NB_CORES = [0]
192 GUEST_TESTPMD_TXQ = [0]
193 GUEST_TESTPMD_RXQ = [0]