Merge "Enable BURST_MODE for l2fwd"
[vswitchperf.git] / vnfs / qemu / qemu.py
index 87f7758..9382ede 100644 (file)
@@ -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.