+ # read GUEST NICs configuration and use only defined NR of NICS
+ nics_nr = S.getValue('GUEST_NICS_NR')[self._number]
+ # and inform user about missconfiguration
+ if nics_nr < 1:
+ raise RuntimeError('At least one VM NIC is mandotory, but {} '
+ 'NICs are configured'.format(nics_nr))
+ elif nics_nr > 1 and nics_nr % 2:
+ nics_nr = int(nics_nr / 2) * 2
+ self._logger.warning('Odd number of NICs is configured, only '
+ '%s NICs will be used', nics_nr)
+
+ self._nics = S.getValue('GUEST_NICS')[self._number][:nics_nr]
+
+ # set guest loopback application based on VNF configuration
+ # cli option take precedence to config file values
+ self._guest_loopback = S.getValue('GUEST_LOOPBACK')[self._number]
+
+ self._testpmd_fwd_mode = S.getValue('GUEST_TESTPMD_FWD_MODE')[self._number]
+ # in case of SRIOV we must ensure, that MAC addresses are not swapped
+ if S.getValue('SRIOV_ENABLED') and self._testpmd_fwd_mode.startswith('mac') and \
+ not S.getValue('VNF').endswith('PciPassthrough'):
+
+ self._logger.info("SRIOV detected, forwarding mode of testpmd was changed from '%s' to '%s'",
+ self._testpmd_fwd_mode, 'io')
+ self._testpmd_fwd_mode = 'io'
+
+ guest_smp = int(get_test_param('guest_smp', 0))
+ if guest_smp:
+ override_list = [guest_smp] * (self._number + 1)
+ S.setValue('GUEST_SMP', override_list)