test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add 1 cbdma script
@ 2020-09-17  6:28 JiangYuX
  2020-09-17  6:31 ` Jiang, YuX
  0 siblings, 1 reply; 4+ messages in thread
From: JiangYuX @ 2020-09-17  6:28 UTC (permalink / raw)
  To: dts; +Cc: JiangYu

From: JiangYu <yux.jiang@intel.com>

1, add 1 cbdma script: test_vhost_gro_tcp_ipv4_with_cbdma_enable
2, modify start_vm: csum=on,gso=on
3, adapt launch_testpmd_gro_on para: mode and queue

Signed-off-by: JiangYu <yux.jiang@intel.com>
---
 tests/TestSuite_dpdk_gro_lib.py | 121 ++++++++++++++++++++++++++++++++++++----
 1 file changed, 111 insertions(+), 10 deletions(-)

diff --git a/tests/TestSuite_dpdk_gro_lib.py b/tests/TestSuite_dpdk_gro_lib.py
index f2b5b0d..3f23e3e 100644
--- a/tests/TestSuite_dpdk_gro_lib.py
+++ b/tests/TestSuite_dpdk_gro_lib.py
@@ -97,6 +97,12 @@ class TestDPDKGROLib(TestCase):
         self.prepare_dpdk()
         self.base_dir = self.dut.base_dir.replace('~', '/root')
 
+        self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
+        # get cbdma device
+        self.cbdma_dev_infos = []
+        self.dmas_info = None
+        self.device_str = None
+
     def set_up(self):
         #
         # Run before each test case.
@@ -106,15 +112,60 @@ class TestDPDKGROLib(TestCase):
         self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#")
         self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
 
-    def launch_testpmd_gro_on(self, mode=1):
+    def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num):
+        """
+        get all cbdma ports
+        """
+        str_info = 'Misc (rawdev) devices using kernel driver'
+        out = self.dut.send_expect('./usertools/dpdk-devbind.py --status-dev misc', '# ', 30)
+        device_info = out.split('\n')
+        for device in device_info:
+            pci_info = re.search('\s*(0000:\d*:\d*.\d*)', device)
+            if pci_info is not None:
+                dev_info = pci_info.group(1)
+                # the numa id of ioat dev, only add the device which
+                # on same socket with nic dev
+                bus = int(dev_info[5:7], base=16)
+                if bus >= 128:
+                    cur_socket = 1
+                else:
+                    cur_socket = 0
+                if self.ports_socket == cur_socket:
+                    self.cbdma_dev_infos.append(pci_info.group(1))
+        self.verify(len(self.cbdma_dev_infos) >= cbdma_num, 'There no enough cbdma device to run this suite')
+        used_cbdma = self.cbdma_dev_infos[0:cbdma_num]
+        dmas_info = ''
+        for dmas in used_cbdma:
+            number = used_cbdma.index(dmas)
+            dmas = 'txq{}@{};'.format(number, dmas)
+            dmas_info += dmas
+        self.dmas_info = dmas_info[:-1]
+        self.device_str = ' '.join(self.cbdma_dev_infos)
+        self.dut.setup_modules(self.target, "igb_uio","None")
+        self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s' % ("igb_uio", self.device_str), '# ', 60)
+
+    def bind_cbdma_device_to_kernel(self):
+        if self.device_str is not None:
+            self.dut.send_expect('modprobe ioatdma', '# ')
+            self.dut.send_expect('./usertools/dpdk-devbind.py -u %s' % self.device_str, '# ', 30)
+            self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=ioatdma  %s' % self.device_str, '# ', 60)
+
+    def launch_testpmd_gro_on(self, mode=1, queue=1):
         #
         # Launch the vhost sample with different parameters
         # mode 1 : tcp traffic light mode
         # mode 2 : tcp traffic heavy mode
         # mode 3 : vxlan traffic light mode
         # mode 4 : tcp traffic flush 4
-        eal_param = self.dut.create_eal_parameters(cores=self.vhost_list, vdevs=['net_vhost0,iface=%s/vhost-net,queues=1' % self.base_dir])
-        self.testcmd_start = self.path + eal_param + " -- -i  --enable-hw-vlan-strip --tx-offloads=0x00 --txd=1024 --rxd=1024"
+        # mode 5 : tcp traffice light mode with cdbma enable
+        if mode == 5:
+            self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2)
+            self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=igb_uio  %s' % self.pci, '# ', 20)
+            eal_param = self.dut.create_eal_parameters(cores=self.vhost_list, vdevs=["'net_vhost0,iface=%s/vhost-net,queues=%s,dmas=[%s],dmathr=1024'" % (self.base_dir, queue, self.dmas_info)])
+            self.testcmd_start = self.path + eal_param + " -- -i --txd=1024 --rxd=1024 --txq=2 --rxq=2"
+        else:
+            eal_param = self.dut.create_eal_parameters(cores=self.vhost_list, vdevs=['net_vhost0,iface=%s/vhost-net,queues=%s' % (self.base_dir, queue)])
+            self.testcmd_start = self.path + eal_param + " -- -i  --enable-hw-vlan-strip --tx-offloads=0x00 --txd=1024 --rxd=1024"
         self.vhost_user = self.dut.new_session(suite="user")
         self.vhost_user.send_expect(self.testcmd_start, "testpmd> ", 120)
         self.vhost_user.send_expect("set fwd csum", "testpmd> ", 120)
@@ -125,13 +176,13 @@ class TestDPDKGROLib(TestCase):
         self.vhost_user.send_expect("csum set ip hw 0", "testpmd> ", 120)
         self.vhost_user.send_expect("csum set tcp hw 1", "testpmd> ", 120)
         self.vhost_user.send_expect("csum set ip hw 1", "testpmd> ", 120)
-        if(mode == 1):
+        if(mode == 1 or mode == 5):
             self.vhost_user.send_expect("set port 0 gro on", "testpmd> ", 120)
             self.vhost_user.send_expect("set gro flush 1", "testpmd> ", 120)
-        if(mode == 2):
+        elif(mode == 2):
             self.vhost_user.send_expect("set port 0 gro on", "testpmd> ", 120)
             self.vhost_user.send_expect("set gro flush 2", "testpmd> ", 120)
-        if (mode == 3):
+        elif (mode == 3):
             self.vhost_user.send_expect("csum parse-tunnel on 1", "testpmd> ", 120)
             self.vhost_user.send_expect("csum parse-tunnel on 0", "testpmd> ", 120)
             self.vhost_user.send_expect("csum set outer-ip hw 0", "testpmd> ", 120)
@@ -240,15 +291,18 @@ class TestDPDKGROLib(TestCase):
                 vm_config.params[i]['cpu'][0]['number'] = 1
                 vm_config.params[i]['cpu'][0]['cpupin'] = self.qemu_cpupin
 
-    def start_vm(self):
+    def start_vm(self, mode=1, queue=1):
         self.vm1 = VM(self.dut, 'vm0', 'vhost_sample')
         self.vm1.load_config()
         vm_params_1 = {}
         vm_params_1['driver'] = 'vhost-user'
         vm_params_1['opt_path'] = self.base_dir + '/vhost-net'
         vm_params_1['opt_mac'] = self.virtio_mac1
-        vm_params_1[
-            'opt_settings'] = 'mrg_rxbuf=on,csum=off,gso=off,host_tso4=on,guest_tso4=on'
+        if mode == 5:
+            vm_params_1['opt_queue'] = queue
+            vm_params_1['opt_settings'] = 'mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on,mq=on,vectors=15'
+        else:
+            vm_params_1['opt_settings'] = 'mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on'
         self.vm1.set_vm_device(**vm_params_1)
         self.set_vm_cpu_number(self.vm1)
         try:
@@ -275,6 +329,15 @@ class TestDPDKGROLib(TestCase):
         self.result_table_print()
         self.output_result = "Iperf throughput is %s" % iperfdata[-1]
         self.logger.info(self.output_result)
+        iperfdata_kb = 0
+        tmp_value = iperfdata[-1].split(" ")[0]
+        if 'Gbits' in iperfdata[-1]:
+            iperfdata_kb = float(tmp_value)*1000000
+        elif 'Mbits' in iperfdata[-1]:
+            iperfdata_kb = float(tmp_value)*1000
+        else:
+            iperfdata_kb = float(tmp_value)
+        return iperfdata_kb
 
     def test_vhost_gro_tcp_lightmode(self):
         self.config_kernel_nic_host(0)
@@ -299,7 +362,7 @@ class TestDPDKGROLib(TestCase):
             'ip netns exec ns1 iperf -c %s -i 1 -t 10 -P 1> /root/iperf_client.log &' %
             (self.virtio_ip1), '', 180)
         time.sleep(30)
-        self.iperf_result_verify('GRO lib')
+        tc1_perfdata = self.iperf_result_verify('GRO lib')
         print(("the GRO lib %s " % (self.output_result)))
         self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
         # Turn off DPDK GRO lib and Kernel GRO off
@@ -313,6 +376,7 @@ class TestDPDKGROLib(TestCase):
         self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
         self.quit_testpmd()
         self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
+        self.dut.send_expect('echo %s > /root/dpdk_gro_lib_on_iperf_tc1.log' % tc1_perfdata, '#', 10)
 
     def test_vhost_gro_tcp_heavymode(self):
         self.config_kernel_nic_host(0)
@@ -376,6 +440,42 @@ class TestDPDKGROLib(TestCase):
         self.quit_testpmd()
         self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
 
+    def test_vhost_gro_tcp_ipv4_with_cbdma_enable(self):
+        self.config_kernel_nic_host(0)
+        self.heavymode = 5
+        self.launch_testpmd_gro_on(self.heavymode, queue=2)
+        self.start_vm(mode=5, queue=2)
+        time.sleep(5)
+        self.dut.get_session_output(timeout=2)
+        # Get the virtio-net device name
+        for port in self.vm1_dut.ports_info:
+            self.vm1_intf = port['intf']
+        # Start the Iperf test
+        self.vm1_dut.send_expect('ifconfig -a', '#', 30)
+        self.vm1_dut.send_expect(
+            'ifconfig %s %s up' %
+            (self.vm1_intf, self.virtio_ip1), '#', 10)
+        self.vm1_dut.send_expect('ethtool -L %s combined 2' % self.vm1_intf, '#', 10)
+        self.vm1_dut.send_expect(
+            'ethtool -K %s gro off' %
+            (self.vm1_intf), '#', 10)
+        self.vm1_dut.send_expect('iperf -s', '', 10)
+        self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
+        out = self.dut.send_expect(
+            'ip netns exec ns1 iperf -c %s -i 1 -t 60 -m -P 2 > /root/iperf_client.log &' %
+            (self.virtio_ip1), '', 180)
+        time.sleep(30)
+        print(out)
+        tc4_perfdata = self.iperf_result_verify('GRO lib')
+        print(("the GRO lib %s " % (self.output_result)))
+        #self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
+        self.quit_testpmd()
+        self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
+        tc1_perfdata = self.dut.send_expect("cat /root/dpdk_gro_lib_on_iperf_tc1.log", "#")
+        self.verify("No such file or directory" not in tc1_perfdata, "Cannot find dpdk_gro_lib_on_iperf_tc1.log, please run test_vhost_gro_tcp_lightmode firstly")
+        if tc1_perfdata:
+            self.verify(float(tc4_perfdata) > float(tc1_perfdata), "TestFailed: W/cbdma iperf data is %s Kbits/sec, W/O cbdma iperf data is %s Kbits/sec" %(tc4_perfdata, tc1_perfdata))
+
     def tear_down(self):
         """
         Run after each test case.
@@ -390,6 +490,7 @@ class TestDPDKGROLib(TestCase):
         self.dut.send_expect(
             "./usertools/dpdk-devbind.py -b %s %s" %
             (self.pci_drv, self.peer_pci), '# ', 30)
+        self.bind_cbdma_device_to_kernel()
 
     def tear_down_all(self):
         """
-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add 1 cbdma script
  2020-09-17  6:28 [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add 1 cbdma script JiangYuX
@ 2020-09-17  6:31 ` Jiang, YuX
  2020-09-21  1:08   ` Wang, Yinan
  0 siblings, 1 reply; 4+ messages in thread
From: Jiang, YuX @ 2020-09-17  6:31 UTC (permalink / raw)
  To: dts; +Cc: Jiang, YuX

[-- Attachment #1: Type: text/plain, Size: 11931 bytes --]

Tested-by: Jiang, YuX <yux.jiang@intel.com>

    Best Regards
    Jiang yu


> -----Original Message-----
> From: Jiang, YuX
> Sent: Thursday, September 17, 2020 2:28 PM
> To: dts@dpdk.org
> Cc: Jiang, YuX <yux.jiang@intel.com>
> Subject: [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add 1 cbdma script
> 
> From: JiangYu <yux.jiang@intel.com>
> 
> 1, add 1 cbdma script: test_vhost_gro_tcp_ipv4_with_cbdma_enable
> 2, modify start_vm: csum=on,gso=on
> 3, adapt launch_testpmd_gro_on para: mode and queue
> 
> Signed-off-by: JiangYu <yux.jiang@intel.com>
> ---
>  tests/TestSuite_dpdk_gro_lib.py | 121
> ++++++++++++++++++++++++++++++++++++----
>  1 file changed, 111 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/TestSuite_dpdk_gro_lib.py
> b/tests/TestSuite_dpdk_gro_lib.py index f2b5b0d..3f23e3e 100644
> --- a/tests/TestSuite_dpdk_gro_lib.py
> +++ b/tests/TestSuite_dpdk_gro_lib.py
> @@ -97,6 +97,12 @@ class TestDPDKGROLib(TestCase):
>          self.prepare_dpdk()
>          self.base_dir = self.dut.base_dir.replace('~', '/root')
> 
> +        self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
> +        # get cbdma device
> +        self.cbdma_dev_infos = []
> +        self.dmas_info = None
> +        self.device_str = None
> +
>      def set_up(self):
>          #
>          # Run before each test case.
> @@ -106,15 +112,60 @@ class TestDPDKGROLib(TestCase):
>          self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#")
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> 
> -    def launch_testpmd_gro_on(self, mode=1):
> +    def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num):
> +        """
> +        get all cbdma ports
> +        """
> +        str_info = 'Misc (rawdev) devices using kernel driver'
> +        out = self.dut.send_expect('./usertools/dpdk-devbind.py --status-dev
> misc', '# ', 30)
> +        device_info = out.split('\n')
> +        for device in device_info:
> +            pci_info = re.search('\s*(0000:\d*:\d*.\d*)', device)
> +            if pci_info is not None:
> +                dev_info = pci_info.group(1)
> +                # the numa id of ioat dev, only add the device which
> +                # on same socket with nic dev
> +                bus = int(dev_info[5:7], base=16)
> +                if bus >= 128:
> +                    cur_socket = 1
> +                else:
> +                    cur_socket = 0
> +                if self.ports_socket == cur_socket:
> +                    self.cbdma_dev_infos.append(pci_info.group(1))
> +        self.verify(len(self.cbdma_dev_infos) >= cbdma_num, 'There no
> enough cbdma device to run this suite')
> +        used_cbdma = self.cbdma_dev_infos[0:cbdma_num]
> +        dmas_info = ''
> +        for dmas in used_cbdma:
> +            number = used_cbdma.index(dmas)
> +            dmas = 'txq{}@{};'.format(number, dmas)
> +            dmas_info += dmas
> +        self.dmas_info = dmas_info[:-1]
> +        self.device_str = ' '.join(self.cbdma_dev_infos)
> +        self.dut.setup_modules(self.target, "igb_uio","None")
> +        self.dut.send_expect('./usertools/dpdk-devbind.py --force
> + --bind=%s %s' % ("igb_uio", self.device_str), '# ', 60)
> +
> +    def bind_cbdma_device_to_kernel(self):
> +        if self.device_str is not None:
> +            self.dut.send_expect('modprobe ioatdma', '# ')
> +            self.dut.send_expect('./usertools/dpdk-devbind.py -u %s' %
> self.device_str, '# ', 30)
> +            self.dut.send_expect('./usertools/dpdk-devbind.py --force
> + --bind=ioatdma  %s' % self.device_str, '# ', 60)
> +
> +    def launch_testpmd_gro_on(self, mode=1, queue=1):
>          #
>          # Launch the vhost sample with different parameters
>          # mode 1 : tcp traffic light mode
>          # mode 2 : tcp traffic heavy mode
>          # mode 3 : vxlan traffic light mode
>          # mode 4 : tcp traffic flush 4
> -        eal_param = self.dut.create_eal_parameters(cores=self.vhost_list,
> vdevs=['net_vhost0,iface=%s/vhost-net,queues=1' % self.base_dir])
> -        self.testcmd_start = self.path + eal_param + " -- -i  --enable-hw-vlan-
> strip --tx-offloads=0x00 --txd=1024 --rxd=1024"
> +        # mode 5 : tcp traffice light mode with cdbma enable
> +        if mode == 5:
> +            self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2)
> +            self.dut.send_expect('./usertools/dpdk-devbind.py --force --
> bind=igb_uio  %s' % self.pci, '# ', 20)
> +            eal_param = self.dut.create_eal_parameters(cores=self.vhost_list,
> vdevs=["'net_vhost0,iface=%s/vhost-
> net,queues=%s,dmas=[%s],dmathr=1024'" % (self.base_dir, queue,
> self.dmas_info)])
> +            self.testcmd_start = self.path + eal_param + " -- -i --txd=1024 --
> rxd=1024 --txq=2 --rxq=2"
> +        else:
> +            eal_param = self.dut.create_eal_parameters(cores=self.vhost_list,
> vdevs=['net_vhost0,iface=%s/vhost-net,queues=%s' % (self.base_dir,
> queue)])
> +            self.testcmd_start = self.path + eal_param + " -- -i  --enable-hw-vlan-
> strip --tx-offloads=0x00 --txd=1024 --rxd=1024"
>          self.vhost_user = self.dut.new_session(suite="user")
>          self.vhost_user.send_expect(self.testcmd_start, "testpmd> ", 120)
>          self.vhost_user.send_expect("set fwd csum", "testpmd> ", 120) @@ -
> 125,13 +176,13 @@ class TestDPDKGROLib(TestCase):
>          self.vhost_user.send_expect("csum set ip hw 0", "testpmd> ", 120)
>          self.vhost_user.send_expect("csum set tcp hw 1", "testpmd> ", 120)
>          self.vhost_user.send_expect("csum set ip hw 1", "testpmd> ", 120)
> -        if(mode == 1):
> +        if(mode == 1 or mode == 5):
>              self.vhost_user.send_expect("set port 0 gro on", "testpmd> ", 120)
>              self.vhost_user.send_expect("set gro flush 1", "testpmd> ", 120)
> -        if(mode == 2):
> +        elif(mode == 2):
>              self.vhost_user.send_expect("set port 0 gro on", "testpmd> ", 120)
>              self.vhost_user.send_expect("set gro flush 2", "testpmd> ", 120)
> -        if (mode == 3):
> +        elif (mode == 3):
>              self.vhost_user.send_expect("csum parse-tunnel on 1", "testpmd> ",
> 120)
>              self.vhost_user.send_expect("csum parse-tunnel on 0", "testpmd> ",
> 120)
>              self.vhost_user.send_expect("csum set outer-ip hw 0", "testpmd> ",
> 120) @@ -240,15 +291,18 @@ class TestDPDKGROLib(TestCase):
>                  vm_config.params[i]['cpu'][0]['number'] = 1
>                  vm_config.params[i]['cpu'][0]['cpupin'] = self.qemu_cpupin
> 
> -    def start_vm(self):
> +    def start_vm(self, mode=1, queue=1):
>          self.vm1 = VM(self.dut, 'vm0', 'vhost_sample')
>          self.vm1.load_config()
>          vm_params_1 = {}
>          vm_params_1['driver'] = 'vhost-user'
>          vm_params_1['opt_path'] = self.base_dir + '/vhost-net'
>          vm_params_1['opt_mac'] = self.virtio_mac1
> -        vm_params_1[
> -            'opt_settings'] =
> 'mrg_rxbuf=on,csum=off,gso=off,host_tso4=on,guest_tso4=on'
> +        if mode == 5:
> +            vm_params_1['opt_queue'] = queue
> +            vm_params_1['opt_settings'] =
> 'mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on,mq=on,vect
> ors=15'
> +        else:
> +            vm_params_1['opt_settings'] =
> 'mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on'
>          self.vm1.set_vm_device(**vm_params_1)
>          self.set_vm_cpu_number(self.vm1)
>          try:
> @@ -275,6 +329,15 @@ class TestDPDKGROLib(TestCase):
>          self.result_table_print()
>          self.output_result = "Iperf throughput is %s" % iperfdata[-1]
>          self.logger.info(self.output_result)
> +        iperfdata_kb = 0
> +        tmp_value = iperfdata[-1].split(" ")[0]
> +        if 'Gbits' in iperfdata[-1]:
> +            iperfdata_kb = float(tmp_value)*1000000
> +        elif 'Mbits' in iperfdata[-1]:
> +            iperfdata_kb = float(tmp_value)*1000
> +        else:
> +            iperfdata_kb = float(tmp_value)
> +        return iperfdata_kb
> 
>      def test_vhost_gro_tcp_lightmode(self):
>          self.config_kernel_nic_host(0)
> @@ -299,7 +362,7 @@ class TestDPDKGROLib(TestCase):
>              'ip netns exec ns1 iperf -c %s -i 1 -t 10 -P 1> /root/iperf_client.log &' %
>              (self.virtio_ip1), '', 180)
>          time.sleep(30)
> -        self.iperf_result_verify('GRO lib')
> +        tc1_perfdata = self.iperf_result_verify('GRO lib')
>          print(("the GRO lib %s " % (self.output_result)))
>          self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
>          # Turn off DPDK GRO lib and Kernel GRO off @@ -313,6 +376,7 @@ class
> TestDPDKGROLib(TestCase):
>          self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
>          self.quit_testpmd()
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> +        self.dut.send_expect('echo %s >
> + /root/dpdk_gro_lib_on_iperf_tc1.log' % tc1_perfdata, '#', 10)
> 
>      def test_vhost_gro_tcp_heavymode(self):
>          self.config_kernel_nic_host(0)
> @@ -376,6 +440,42 @@ class TestDPDKGROLib(TestCase):
>          self.quit_testpmd()
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> 
> +    def test_vhost_gro_tcp_ipv4_with_cbdma_enable(self):
> +        self.config_kernel_nic_host(0)
> +        self.heavymode = 5
> +        self.launch_testpmd_gro_on(self.heavymode, queue=2)
> +        self.start_vm(mode=5, queue=2)
> +        time.sleep(5)
> +        self.dut.get_session_output(timeout=2)
> +        # Get the virtio-net device name
> +        for port in self.vm1_dut.ports_info:
> +            self.vm1_intf = port['intf']
> +        # Start the Iperf test
> +        self.vm1_dut.send_expect('ifconfig -a', '#', 30)
> +        self.vm1_dut.send_expect(
> +            'ifconfig %s %s up' %
> +            (self.vm1_intf, self.virtio_ip1), '#', 10)
> +        self.vm1_dut.send_expect('ethtool -L %s combined 2' % self.vm1_intf,
> '#', 10)
> +        self.vm1_dut.send_expect(
> +            'ethtool -K %s gro off' %
> +            (self.vm1_intf), '#', 10)
> +        self.vm1_dut.send_expect('iperf -s', '', 10)
> +        self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
> +        out = self.dut.send_expect(
> +            'ip netns exec ns1 iperf -c %s -i 1 -t 60 -m -P 2 > /root/iperf_client.log
> &' %
> +            (self.virtio_ip1), '', 180)
> +        time.sleep(30)
> +        print(out)
> +        tc4_perfdata = self.iperf_result_verify('GRO lib')
> +        print(("the GRO lib %s " % (self.output_result)))
> +        #self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
> +        self.quit_testpmd()
> +        self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> +        tc1_perfdata = self.dut.send_expect("cat
> /root/dpdk_gro_lib_on_iperf_tc1.log", "#")
> +        self.verify("No such file or directory" not in tc1_perfdata, "Cannot find
> dpdk_gro_lib_on_iperf_tc1.log, please run test_vhost_gro_tcp_lightmode
> firstly")
> +        if tc1_perfdata:
> +            self.verify(float(tc4_perfdata) > float(tc1_perfdata),
> + "TestFailed: W/cbdma iperf data is %s Kbits/sec, W/O cbdma iperf data
> + is %s Kbits/sec" %(tc4_perfdata, tc1_perfdata))
> +
>      def tear_down(self):
>          """
>          Run after each test case.
> @@ -390,6 +490,7 @@ class TestDPDKGROLib(TestCase):
>          self.dut.send_expect(
>              "./usertools/dpdk-devbind.py -b %s %s" %
>              (self.pci_drv, self.peer_pci), '# ', 30)
> +        self.bind_cbdma_device_to_kernel()
> 
>      def tear_down_all(self):
>          """
> --
> 2.7.4


[-- Attachment #2: TestDPDKGROLib+TestVhostUserInterrupt.log --]
[-- Type: application/octet-stream, Size: 81198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add 1 cbdma script
  2020-09-17  6:31 ` Jiang, YuX
@ 2020-09-21  1:08   ` Wang, Yinan
  2020-09-23  8:30     ` Tu, Lijuan
  0 siblings, 1 reply; 4+ messages in thread
From: Wang, Yinan @ 2020-09-21  1:08 UTC (permalink / raw)
  To: Jiang, YuX, dts; +Cc: Jiang, YuX

Acked-by: Wang, Yinan <yinan.wang@intel.com>

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Jiang, YuX
> Sent: 2020?9?17? 14:31
> To: dts@dpdk.org
> Cc: Jiang, YuX <yux.jiang@intel.com>
> Subject: Re: [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add 1 cbdma script
> 
> Tested-by: Jiang, YuX <yux.jiang@intel.com>
> 
>     Best Regards
>     Jiang yu
> 
> 
> > -----Original Message-----
> > From: Jiang, YuX
> > Sent: Thursday, September 17, 2020 2:28 PM
> > To: dts@dpdk.org
> > Cc: Jiang, YuX <yux.jiang@intel.com>
> > Subject: [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add 1 cbdma script
> >
> > From: JiangYu <yux.jiang@intel.com>
> >
> > 1, add 1 cbdma script: test_vhost_gro_tcp_ipv4_with_cbdma_enable
> > 2, modify start_vm: csum=on,gso=on
> > 3, adapt launch_testpmd_gro_on para: mode and queue
> >
> > Signed-off-by: JiangYu <yux.jiang@intel.com>
> > ---
> >  tests/TestSuite_dpdk_gro_lib.py | 121
> > ++++++++++++++++++++++++++++++++++++----
> >  1 file changed, 111 insertions(+), 10 deletions(-)
> >
> > diff --git a/tests/TestSuite_dpdk_gro_lib.py
> > b/tests/TestSuite_dpdk_gro_lib.py index f2b5b0d..3f23e3e 100644
> > --- a/tests/TestSuite_dpdk_gro_lib.py
> > +++ b/tests/TestSuite_dpdk_gro_lib.py
> > @@ -97,6 +97,12 @@ class TestDPDKGROLib(TestCase):
> >          self.prepare_dpdk()
> >          self.base_dir = self.dut.base_dir.replace('~', '/root')
> >
> > +        self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
> > +        # get cbdma device
> > +        self.cbdma_dev_infos = []
> > +        self.dmas_info = None
> > +        self.device_str = None
> > +
> >      def set_up(self):
> >          #
> >          # Run before each test case.
> > @@ -106,15 +112,60 @@ class TestDPDKGROLib(TestCase):
> >          self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#")
> >          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> >
> > -    def launch_testpmd_gro_on(self, mode=1):
> > +    def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num):
> > +        """
> > +        get all cbdma ports
> > +        """
> > +        str_info = 'Misc (rawdev) devices using kernel driver'
> > +        out = self.dut.send_expect('./usertools/dpdk-devbind.py --status-dev
> > misc', '# ', 30)
> > +        device_info = out.split('\n')
> > +        for device in device_info:
> > +            pci_info = re.search('\s*(0000:\d*:\d*.\d*)', device)
> > +            if pci_info is not None:
> > +                dev_info = pci_info.group(1)
> > +                # the numa id of ioat dev, only add the device which
> > +                # on same socket with nic dev
> > +                bus = int(dev_info[5:7], base=16)
> > +                if bus >= 128:
> > +                    cur_socket = 1
> > +                else:
> > +                    cur_socket = 0
> > +                if self.ports_socket == cur_socket:
> > +                    self.cbdma_dev_infos.append(pci_info.group(1))
> > +        self.verify(len(self.cbdma_dev_infos) >= cbdma_num, 'There no
> > enough cbdma device to run this suite')
> > +        used_cbdma = self.cbdma_dev_infos[0:cbdma_num]
> > +        dmas_info = ''
> > +        for dmas in used_cbdma:
> > +            number = used_cbdma.index(dmas)
> > +            dmas = 'txq{}@{};'.format(number, dmas)
> > +            dmas_info += dmas
> > +        self.dmas_info = dmas_info[:-1]
> > +        self.device_str = ' '.join(self.cbdma_dev_infos)
> > +        self.dut.setup_modules(self.target, "igb_uio","None")
> > +        self.dut.send_expect('./usertools/dpdk-devbind.py --force
> > + --bind=%s %s' % ("igb_uio", self.device_str), '# ', 60)
> > +
> > +    def bind_cbdma_device_to_kernel(self):
> > +        if self.device_str is not None:
> > +            self.dut.send_expect('modprobe ioatdma', '# ')
> > +            self.dut.send_expect('./usertools/dpdk-devbind.py -u %s' %
> > self.device_str, '# ', 30)
> > +            self.dut.send_expect('./usertools/dpdk-devbind.py --force
> > + --bind=ioatdma  %s' % self.device_str, '# ', 60)
> > +
> > +    def launch_testpmd_gro_on(self, mode=1, queue=1):
> >          #
> >          # Launch the vhost sample with different parameters
> >          # mode 1 : tcp traffic light mode
> >          # mode 2 : tcp traffic heavy mode
> >          # mode 3 : vxlan traffic light mode
> >          # mode 4 : tcp traffic flush 4
> > -        eal_param = self.dut.create_eal_parameters(cores=self.vhost_list,
> > vdevs=['net_vhost0,iface=%s/vhost-net,queues=1' % self.base_dir])
> > -        self.testcmd_start = self.path + eal_param + " -- -i  --enable-hw-vlan-
> > strip --tx-offloads=0x00 --txd=1024 --rxd=1024"
> > +        # mode 5 : tcp traffice light mode with cdbma enable
> > +        if mode == 5:
> > +            self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2)
> > +            self.dut.send_expect('./usertools/dpdk-devbind.py --force --
> > bind=igb_uio  %s' % self.pci, '# ', 20)
> > +            eal_param = self.dut.create_eal_parameters(cores=self.vhost_list,
> > vdevs=["'net_vhost0,iface=%s/vhost-
> > net,queues=%s,dmas=[%s],dmathr=1024'" % (self.base_dir, queue,
> > self.dmas_info)])
> > +            self.testcmd_start = self.path + eal_param + " -- -i --txd=1024 --
> > rxd=1024 --txq=2 --rxq=2"
> > +        else:
> > +            eal_param = self.dut.create_eal_parameters(cores=self.vhost_list,
> > vdevs=['net_vhost0,iface=%s/vhost-net,queues=%s' % (self.base_dir,
> > queue)])
> > +            self.testcmd_start = self.path + eal_param + " -- -i  --enable-hw-vlan-
> > strip --tx-offloads=0x00 --txd=1024 --rxd=1024"
> >          self.vhost_user = self.dut.new_session(suite="user")
> >          self.vhost_user.send_expect(self.testcmd_start, "testpmd> ", 120)
> >          self.vhost_user.send_expect("set fwd csum", "testpmd> ", 120) @@ -
> > 125,13 +176,13 @@ class TestDPDKGROLib(TestCase):
> >          self.vhost_user.send_expect("csum set ip hw 0", "testpmd> ", 120)
> >          self.vhost_user.send_expect("csum set tcp hw 1", "testpmd> ", 120)
> >          self.vhost_user.send_expect("csum set ip hw 1", "testpmd> ", 120)
> > -        if(mode == 1):
> > +        if(mode == 1 or mode == 5):
> >              self.vhost_user.send_expect("set port 0 gro on", "testpmd> ", 120)
> >              self.vhost_user.send_expect("set gro flush 1", "testpmd> ", 120)
> > -        if(mode == 2):
> > +        elif(mode == 2):
> >              self.vhost_user.send_expect("set port 0 gro on", "testpmd> ", 120)
> >              self.vhost_user.send_expect("set gro flush 2", "testpmd> ", 120)
> > -        if (mode == 3):
> > +        elif (mode == 3):
> >              self.vhost_user.send_expect("csum parse-tunnel on 1", "testpmd> ",
> > 120)
> >              self.vhost_user.send_expect("csum parse-tunnel on 0", "testpmd> ",
> > 120)
> >              self.vhost_user.send_expect("csum set outer-ip hw 0", "testpmd> ",
> > 120) @@ -240,15 +291,18 @@ class TestDPDKGROLib(TestCase):
> >                  vm_config.params[i]['cpu'][0]['number'] = 1
> >                  vm_config.params[i]['cpu'][0]['cpupin'] = self.qemu_cpupin
> >
> > -    def start_vm(self):
> > +    def start_vm(self, mode=1, queue=1):
> >          self.vm1 = VM(self.dut, 'vm0', 'vhost_sample')
> >          self.vm1.load_config()
> >          vm_params_1 = {}
> >          vm_params_1['driver'] = 'vhost-user'
> >          vm_params_1['opt_path'] = self.base_dir + '/vhost-net'
> >          vm_params_1['opt_mac'] = self.virtio_mac1
> > -        vm_params_1[
> > -            'opt_settings'] =
> > 'mrg_rxbuf=on,csum=off,gso=off,host_tso4=on,guest_tso4=on'
> > +        if mode == 5:
> > +            vm_params_1['opt_queue'] = queue
> > +            vm_params_1['opt_settings'] =
> > 'mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on,mq=on,vect
> > ors=15'
> > +        else:
> > +            vm_params_1['opt_settings'] =
> > 'mrg_rxbuf=on,csum=on,gso=on,host_tso4=on,guest_tso4=on'
> >          self.vm1.set_vm_device(**vm_params_1)
> >          self.set_vm_cpu_number(self.vm1)
> >          try:
> > @@ -275,6 +329,15 @@ class TestDPDKGROLib(TestCase):
> >          self.result_table_print()
> >          self.output_result = "Iperf throughput is %s" % iperfdata[-1]
> >          self.logger.info(self.output_result)
> > +        iperfdata_kb = 0
> > +        tmp_value = iperfdata[-1].split(" ")[0]
> > +        if 'Gbits' in iperfdata[-1]:
> > +            iperfdata_kb = float(tmp_value)*1000000
> > +        elif 'Mbits' in iperfdata[-1]:
> > +            iperfdata_kb = float(tmp_value)*1000
> > +        else:
> > +            iperfdata_kb = float(tmp_value)
> > +        return iperfdata_kb
> >
> >      def test_vhost_gro_tcp_lightmode(self):
> >          self.config_kernel_nic_host(0)
> > @@ -299,7 +362,7 @@ class TestDPDKGROLib(TestCase):
> >              'ip netns exec ns1 iperf -c %s -i 1 -t 10 -P 1> /root/iperf_client.log &' %
> >              (self.virtio_ip1), '', 180)
> >          time.sleep(30)
> > -        self.iperf_result_verify('GRO lib')
> > +        tc1_perfdata = self.iperf_result_verify('GRO lib')
> >          print(("the GRO lib %s " % (self.output_result)))
> >          self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
> >          # Turn off DPDK GRO lib and Kernel GRO off @@ -313,6 +376,7 @@ class
> > TestDPDKGROLib(TestCase):
> >          self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
> >          self.quit_testpmd()
> >          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> > +        self.dut.send_expect('echo %s >
> > + /root/dpdk_gro_lib_on_iperf_tc1.log' % tc1_perfdata, '#', 10)
> >
> >      def test_vhost_gro_tcp_heavymode(self):
> >          self.config_kernel_nic_host(0)
> > @@ -376,6 +440,42 @@ class TestDPDKGROLib(TestCase):
> >          self.quit_testpmd()
> >          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> >
> > +    def test_vhost_gro_tcp_ipv4_with_cbdma_enable(self):
> > +        self.config_kernel_nic_host(0)
> > +        self.heavymode = 5
> > +        self.launch_testpmd_gro_on(self.heavymode, queue=2)
> > +        self.start_vm(mode=5, queue=2)
> > +        time.sleep(5)
> > +        self.dut.get_session_output(timeout=2)
> > +        # Get the virtio-net device name
> > +        for port in self.vm1_dut.ports_info:
> > +            self.vm1_intf = port['intf']
> > +        # Start the Iperf test
> > +        self.vm1_dut.send_expect('ifconfig -a', '#', 30)
> > +        self.vm1_dut.send_expect(
> > +            'ifconfig %s %s up' %
> > +            (self.vm1_intf, self.virtio_ip1), '#', 10)
> > +        self.vm1_dut.send_expect('ethtool -L %s combined 2' % self.vm1_intf,
> > '#', 10)
> > +        self.vm1_dut.send_expect(
> > +            'ethtool -K %s gro off' %
> > +            (self.vm1_intf), '#', 10)
> > +        self.vm1_dut.send_expect('iperf -s', '', 10)
> > +        self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
> > +        out = self.dut.send_expect(
> > +            'ip netns exec ns1 iperf -c %s -i 1 -t 60 -m -P 2 > /root/iperf_client.log
> > &' %
> > +            (self.virtio_ip1), '', 180)
> > +        time.sleep(30)
> > +        print(out)
> > +        tc4_perfdata = self.iperf_result_verify('GRO lib')
> > +        print(("the GRO lib %s " % (self.output_result)))
> > +        #self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
> > +        self.quit_testpmd()
> > +        self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> > +        tc1_perfdata = self.dut.send_expect("cat
> > /root/dpdk_gro_lib_on_iperf_tc1.log", "#")
> > +        self.verify("No such file or directory" not in tc1_perfdata, "Cannot find
> > dpdk_gro_lib_on_iperf_tc1.log, please run test_vhost_gro_tcp_lightmode
> > firstly")
> > +        if tc1_perfdata:
> > +            self.verify(float(tc4_perfdata) > float(tc1_perfdata),
> > + "TestFailed: W/cbdma iperf data is %s Kbits/sec, W/O cbdma iperf data
> > + is %s Kbits/sec" %(tc4_perfdata, tc1_perfdata))
> > +
> >      def tear_down(self):
> >          """
> >          Run after each test case.
> > @@ -390,6 +490,7 @@ class TestDPDKGROLib(TestCase):
> >          self.dut.send_expect(
> >              "./usertools/dpdk-devbind.py -b %s %s" %
> >              (self.pci_drv, self.peer_pci), '# ', 30)
> > +        self.bind_cbdma_device_to_kernel()
> >
> >      def tear_down_all(self):
> >          """
> > --
> > 2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add 1 cbdma script
  2020-09-21  1:08   ` Wang, Yinan
@ 2020-09-23  8:30     ` Tu, Lijuan
  0 siblings, 0 replies; 4+ messages in thread
From: Tu, Lijuan @ 2020-09-23  8:30 UTC (permalink / raw)
  To: Wang, Yinan, Jiang, YuX, dts; +Cc: Jiang, YuX

> > > Subject: [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add 1 cbdma
> > > script
> > >
> > > From: JiangYu <yux.jiang@intel.com>
> > >
> > > 1, add 1 cbdma script: test_vhost_gro_tcp_ipv4_with_cbdma_enable
> > > 2, modify start_vm: csum=on,gso=on
> > > 3, adapt launch_testpmd_gro_on para: mode and queue
> > >
> > > Signed-off-by: JiangYu <yux.jiang@intel.com>> > Tested-by: Jiang, YuX <yux.jiang@intel.com>
> Acked-by: Wang, Yinan <yinan.wang@intel.com>

Applied

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-23  8:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17  6:28 [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add 1 cbdma script JiangYuX
2020-09-17  6:31 ` Jiang, YuX
2020-09-21  1:08   ` Wang, Yinan
2020-09-23  8:30     ` Tu, Lijuan

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ https://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git