Merge "CONFIG: VSPERF Config-file Generation Wizard."
[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 = os.path.join(ROOT_DIR, 'vnfs/')
19 VNF = 'QemuDpdkVhostUser'
20 VNF_AFFINITIZATION_ON = True
21
22 # ############################
23 # Directories, executables and log files
24 # ############################
25
26 # please see conf/00_common.conf for description of PATHS dictionary
27 PATHS['qemu'] = {
28     'type' : 'src',
29     'src': {
30         'path': os.path.join(ROOT_DIR, 'src/qemu/qemu/'),
31         'qemu-system': 'x86_64-softmmu/qemu-system-x86_64'
32     },
33     'bin': {
34         'qemu-system': 'qemu-system-x86_64'
35     }
36 }
37
38 # log file for qemu
39 LOG_FILE_QEMU = 'qemu.log'
40
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'
44
45 # ############################
46 # Guest configuration
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_`
55 # prefix.
56 # Following macros are supported:
57 #
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.
60 #
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.
65 #
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.
70 #
71 # * #EVAL(expression) - it will evaluate given `expression` as python code;
72 #   Only simple expressions should be used. Call of the functions is not
73 #   supported.
74
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']
79
80 # location of guest disk image
81 # For 2 VNFs you may use ['guest1.img', 'guest2.img']
82 GUEST_IMAGE = ['']
83
84 # guarding timer for VM start up
85 # For 2 VNFs you may use [180, 180]
86 GUEST_TIMEOUT = [180]
87
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']
92
93 # guest loopback application method; supported options are:
94 #       'testpmd'       - testpmd from dpdk will be built and used
95 #       'l2fwd'         - l2fwd module provided by Huawei will be built and used
96 #       'linux_bridge'  - linux bridge will be configured
97 #       'buildin'       - nothing will be configured by vsperf; VM image must
98 #                         ensure traffic forwarding between its interfaces
99 #       'clean'         - nothing will be configured, but automatic login will
100 #                         be performed; Useful for stepdriven testcases.
101 # For 2 VNFs you may use ['testpmd', 'l2fwd']
102 GUEST_LOOPBACK = ['testpmd']
103
104 # guest driver binding option; support options are:
105 #       'igb_uio_from_src'  - build igb_uio driver from downloaded source files
106 #       'uio_pci_generic'   - use uio_pci_generic driver
107 #       'vfio_no_iommu'     - use unsafe vfio driver without iommu (requires
108 #                             image with supported kernel 4.5 or greater and
109 #                             dpdk 16.04 or greater. VSPerf vloop image does not
110 #                             support this mode.
111 GUEST_DPDK_BIND_DRIVER = ['igb_uio_from_src']
112
113 # username for guest image
114 GUEST_USERNAME = ['root']
115
116 # password for guest image
117 GUEST_PASSWORD = ['root']
118
119 # login username prompt for guest image
120 GUEST_PROMPT_LOGIN = ['.* login:']
121
122 # login password prompt for guest image
123 GUEST_PROMPT_PASSWORD = ['Password: ']
124
125 # standard prompt for guest image
126 GUEST_PROMPT = ['root.*#']
127
128 # defines the number of NICs configured for each guest, it must be less or equal to
129 # the number of NICs configured in GUEST_NICS
130 GUEST_NICS_NR = [2]
131
132 # template for guests with 4 NICS, but only GUEST_NICS_NR NICS will be configured at runtime
133 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'},
134                {'device' : 'eth1', 'mac' : '#MAC(00:00:00:00:00:02,2)', 'pci' : '00:05.0', 'ip' : '#IP(192.168.1.3,4)/24'},
135                {'device' : 'eth2', 'mac' : '#MAC(cc:00:00:00:00:01,2)', 'pci' : '00:06.0', 'ip' : '#IP(192.168.1.4,4)/24'},
136                {'device' : 'eth3', 'mac' : '#MAC(cc:00:00:00:00:02,2)', 'pci' : '00:07.0', 'ip' : '#IP(192.168.1.5,4)/24'},
137              ]]
138
139 # amount of host memory allocated for each guest
140 GUEST_MEMORY = ['2048']
141 # number of hugepages configured inside each guest
142 GUEST_HUGEPAGES_NR = ['1024']
143
144 # test-pmd requires 2 VM cores
145 # It is also possible to configure GUEST's CPU topology,
146 # e.g. GUEST_SMP = ["sockets=1,cores=2"]
147 GUEST_SMP = ['2']
148
149 # cpu features to the guest, default options provided to pass all available
150 # host processor features to the guest. Also tsc deadline timer for guest,
151 # the guest PMU, the invariant TSC options can be provided as well.
152 GUEST_CPU_OPTIONS = ['host,migratable=off']
153
154 # Host cores to use to affinitize the SMP cores of a QEMU instance
155 # For 2 VNFs you may use [(4,5), (6, 7)]
156 GUEST_CORE_BINDING = [('#EVAL(6+2*#VMINDEX)', '#EVAL(7+2*#VMINDEX)')]
157
158 # pin guest vCPU threads to another pCPU core. This reduces the noise from qemu
159 # housekeeping threads. By default the GUEST_THREAD_BINDING will be none.
160 GUEST_THREAD_BINDING = [ None ]
161
162 # Queues per NIC inside guest for multi-queue configuration, requires switch
163 # multi-queue to be enabled for dpdk. Set to 0 for disabled. Can be enabled if
164 # using Vanilla OVS without enabling switch multi-queue.
165 GUEST_NIC_QUEUES = [0]
166
167 # Disable VHost user guest NIC merge buffers by enabling the below setting. This
168 # can improve performance when not using Jumbo Frames.
169 GUEST_NIC_MERGE_BUFFERS_DISABLE = [True]
170
171 # Virtio-Net vhost thread CPU mapping. If using  vanilla OVS with virtio-net,
172 # you can affinitize the vhost-net threads by enabling the below setting. There
173 # is one vhost-net thread per port per queue so one guest with 2 queues will
174 # have 4 vhost-net threads. If more threads are present than CPUs given, the
175 # affinitize will overlap CPUs in a round robin fashion.
176 VSWITCH_VHOST_NET_AFFINITIZATION = False
177 VSWITCH_VHOST_CPU_MAP = [4,5,8,11]
178
179 GUEST_START_TIMEOUT = [120]
180 GUEST_OVS_DPDK_DIR = ['/root/ovs_dpdk']
181 GUEST_OVS_DPDK_SHARE = ['/mnt/ovs_dpdk_share']
182
183 # IP addresses to use for Vanilla OVS PXP testing
184 # Consider using RFC 2544/3330 recommended IP addresses for benchmark testing.
185 # Network: 198.18.0.0/15
186 # Netmask: 255.254.0.0
187 # Broadcast: 198.19.255.255
188 # First IP: 198.18.0.1
189 # Last IP: 198.19.255.254
190 # Hosts: 131070
191 #
192
193 # ARP entries for the IXIA ports and the bridge you are using:
194 VANILLA_TGEN_PORT1_IP = '1.1.1.10'
195 VANILLA_TGEN_PORT1_MAC = 'AA:BB:CC:DD:EE:FF'
196
197 VANILLA_TGEN_PORT2_IP = '1.1.2.10'
198 VANILLA_TGEN_PORT2_MAC = 'AA:BB:CC:DD:EE:F0'
199
200 GUEST_BRIDGE_IP = ['#IP(1.1.1.5)/16']
201
202 # ############################
203 # Guest TESTPMD configuration
204 # ############################
205
206 # set of configuration parameters, which will be passed to the testpmd
207 # executed inside the guest
208 # Note: Testpmd must be executed in interactive mode. It means, that
209 # VSPERF won't work correctly if '-i' will be removed.
210 GUEST_TESTPMD_PARAMS = ['-c 0x3 -n 4 --socket-mem 512 -- '
211                         '--burst=64 -i --txqflags=0xf00 '
212                         '--disable-hw-vlan']
213
214 # packet forwarding mode supported by testpmd; Please see DPDK documentation
215 # for comprehensive list of modes supported by your version.
216 # e.g. io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho|...
217 # Note: Option "mac_retry" has been changed to "mac retry" since DPDK v16.07
218 GUEST_TESTPMD_FWD_MODE = ['csum']