X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=vnfs%2Fqemu%2Fqemu.py;h=9382edef92c50d8078926dc0833d986118b581ee;hb=dd47e4e2ea55f01235c20bed8e07d69fb51c292e;hp=d108dc9a45c0722c5e1a334a4eaefb1ea38ed41b;hpb=89864cbc856cd5cf3369429d64465615097be604;p=vswitchperf.git diff --git a/vnfs/qemu/qemu.py b/vnfs/qemu/qemu.py index d108dc9a..9382edef 100644 --- a/vnfs/qemu/qemu.py +++ b/vnfs/qemu/qemu.py @@ -138,7 +138,7 @@ class IVnfQemu(IVnf): # exit testpmd if needed if self._guest_loopback == 'testpmd': self.execute_and_wait('stop', 120, "Done") - self.execute_and_wait('quit', 120, "bye") + self.execute_and_wait('quit', 120, "[bB]ye") # turn off VM self.execute_and_wait('poweroff', 120, "Power down") @@ -276,7 +276,7 @@ class IVnfQemu(IVnf): self.execute_and_wait('mount -o ro,iocharset=utf8 /dev/sdb1 ' + S.getValue('OVS_DPDK_SHARE')) self.execute_and_wait('mkdir -p ' + S.getValue('GUEST_OVS_DPDK_DIR')) - self.execute_and_wait('cp -ra ' + os.path.join(S.getValue('OVS_DPDK_SHARE'), dirname) + + self.execute_and_wait('cp -r ' + os.path.join(S.getValue('OVS_DPDK_SHARE'), dirname) + ' ' + S.getValue('GUEST_OVS_DPDK_DIR')) self.execute_and_wait('umount /dev/sdb1') @@ -354,9 +354,22 @@ class IVnfQemu(IVnf): '/DPDK/app/test-pmd') self.execute_and_wait('make clean') self.execute_and_wait('make') - self.execute_and_wait('./testpmd -c 0x3 -n 4 --socket-mem 512 --' - ' --burst=64 -i --txqflags=0xf00 ' + - '--disable-hw-vlan', 60, "Done") + if int(S.getValue('GUEST_NIC_QUEUES')): + self.execute_and_wait( + './testpmd {} -n4 --socket-mem 512 --'.format( + S.getValue('GUEST_TESTPMD_CPU_MASK')) + + ' --burst=64 -i --txqflags=0xf00 ' + + '--nb-cores={} --rxq={} --txq={} '.format( + S.getValue('GUEST_TESTPMD_NB_CORES'), + S.getValue('GUEST_TESTPMD_TXQ'), + S.getValue('GUEST_TESTPMD_RXQ')) + + '--disable-hw-vlan', 60, "Done") + else: + self.execute_and_wait( + './testpmd {} -n 4 --socket-mem 512 --'.format( + S.getValue('GUEST_TESTPMD_CPU_MASK')) + + ' --burst=64 -i --txqflags=0xf00 ' + + '--disable-hw-vlan', 60, "Done") self.execute('set fwd ' + self._testpmd_fwd_mode, 1) self.execute_and_wait('start', 20, 'TX RS bit threshold=.+ - TXQ flags=0xf00') @@ -384,17 +397,23 @@ class IVnfQemu(IVnf): """ self._configure_disable_firewall() - self.execute('ifconfig ' + self._net1 + ' ' + - S.getValue('VANILLA_NIC1_IP_CIDR')[self._number]) + self.execute('ip addr add ' + + S.getValue('VANILLA_NIC1_IP_CIDR')[self._number] + + ' dev ' + self._net1) + self.execute('ip link set dev ' + self._net1 + ' up') - self.execute('ifconfig ' + self._net2 + ' ' + - S.getValue('VANILLA_NIC2_IP_CIDR')[self._number]) + self.execute('ip addr add ' + + S.getValue('VANILLA_NIC2_IP_CIDR')[self._number] + + ' dev ' + self._net2) + self.execute('ip link set dev ' + self._net2 + ' up') # configure linux bridge self.execute('brctl addbr br0') self.execute('brctl addif br0 ' + self._net1 + ' ' + self._net2) - self.execute('ifconfig br0 ' + - S.getValue('VANILLA_BRIDGE_IP')[self._number]) + self.execute('ip addr add ' + + S.getValue('VANILLA_BRIDGE_IP')[self._number] + + ' dev br0') + self.execute('ip link set dev br0 up') # Add the arp entries for the IXIA ports and the bridge you are using. # Use command line values if provided.