test suite reviews and discussions
 help / color / Atom feed
* Re: [dts] [PATCH V1] tests/dpdk_gso_lib:Put the same case to suite
  2019-09-05  8:07 [dts] [PATCH V1] tests/dpdk_gso_lib:Put the same case to suite zhuwenhui
@ 2019-09-05  8:06 ` Zhu, ShuaiX
  2019-09-18  5:32 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Zhu, ShuaiX @ 2019-09-05  8:06 UTC (permalink / raw)
  To: Zhu, WenhuiX, dts; +Cc: Zhu, WenhuiX, Zhu, ShuaiX

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

Tested-by: Zhu, ShuaiX <shuaix.zhu@intel.com>

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhuwenhui
> Sent: Thursday, September 5, 2019 4:08 PM
> To: dts@dpdk.org
> Cc: Zhu, WenhuiX <wenhuix.zhu@intel.com>
> Subject: [dts] [PATCH V1] tests/dpdk_gso_lib:Put the same case to suite
> 
> Due to the different topology of cases in virtio_user_as_exceptional_path.
> Put the same case as the dpdk_gso_lib topology into dpdk_gso_lib
> 
> Signed-off-by: zhuwenhui <wenhuix.zhu@intel.com>
> ---
>  tests/TestSuite_dpdk_gso_lib.py | 103
> +++++++++++++++++++++++++++++++-
>  1 file changed, 102 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/TestSuite_dpdk_gso_lib.py b/tests/TestSuite_dpdk_gso_lib.py
> index 68d09cb..fd50ba5 100644
> --- a/tests/TestSuite_dpdk_gso_lib.py
> +++ b/tests/TestSuite_dpdk_gso_lib.py
> @@ -207,6 +207,14 @@ class TestDPDKGsoLib(TestCase):
>              "ip netns exec ns1 ifconfig gre100 1.1.1.1/24 up",
>              "#")
> 
> +    def config_kernel_nic_host_for_exception_path(self):
> +        self.dut.send_expect("ip netns del ns1", "#")
> +        self.dut.send_expect("ip netns add ns1", "#")
> +        self.dut.send_expect("ip link set %s netns ns1" % self.nic_in_kernel,
> "#")
> +        self.dut.send_expect("ip netns exec ns1 ifconfig %s 1.1.1.8 up" %
> self.nic_in_kernel, "#")
> +        self.dut.send_expect("ip netns exec ns1 ethtool -K %s gro on" %
> self.nic_in_kernel, "#")
> +        self.dut.send_expect("ip netns exec ns1 ethtool -K %s tso on" %
> + self.nic_in_kernel, "#")
> +
>      def prepare_dpdk(self):
>          # Changhe the testpmd checksum fwd code for mac change
>          self.dut.send_expect(
> @@ -282,18 +290,59 @@ class TestDPDKGsoLib(TestCase):
>          print iperfdata
>          self.verify(iperfdata, 'There no data about this case')
>          self.result_table_create(['Data', 'Unit'])
> -        results_row = ['GSO']
> +        if self.type_row == "exception_path":
> +            results_row = ['exception path']
> +        else:
> +            results_row = ['GSO']
>          results_row.append(iperfdata[-1])
>          self.result_table_add(results_row)
>          self.result_table_print()
>          self.output_result = "Iperf throughput is %s" % iperfdata[-1]
>          self.logger.info(self.output_result)
> 
> +    def launch_testpmd_exception_path(self):
> +        self.testcmd = self.target + "/app/testpmd -c %s -n %d
> --socket-mem %s --legacy-mem" \
> +                + "
> --vdev=virtio_user0,mac=%s,path=/dev/vhost-net,queue_size=1024 -- -i" \
> +                + " --rxd=1024 --txd=1024"
> +        self.cores = self.dut.get_core_list("1S/2C/1T", socket=self.socket)
> +        self.coremask = utils.create_mask(self.cores)
> +        self.testcmd_start = self.testcmd % (self.coremask,
> self.memory_channel,
> +                                    self.socket_mem, self.virtio_mac1)
> +        self.vhost_user = self.dut.new_session(suite="user")
> +        self.vhost_user.send_expect("modprobe vhost-net", "#", 120)
> +        self.vhost_user.send_expect(self.testcmd_start, "testpmd> ", 120)
> +        self.vhost_user.send_expect("set fwd csum", "testpmd> ", 120)
> +        self.vhost_user.send_expect("stop", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port stop 0", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port stop 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port config 0 tx_offload tcp_cksum on",
> "testpmd> ", 120)
> +        self.vhost_user.send_expect("port config 0 tx_offload ipv4_cksum
> on", "testpmd> ", 120)
> +        self.vhost_user.send_expect("csum set ip sw 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("csum set tcp hw 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("csum set ip hw 0", "testpmd> ", 120)
> +        self.vhost_user.send_expect("csum set tcp hw 0", "testpmd> ", 120)
> +        self.vhost_user.send_expect("tso set 1448 0", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port start 0", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port start 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("start", "testpmd> ", 120)
> +
> +    def testpmd_reset(self):
> +        self.vhost_user.send_expect("stop", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port stop 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("csum set ip sw 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port start 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("start", "testpmd> ", 120)
> +
> +    def prepare_tap_device(self):
> +        self.dut.send_expect("ifconfig tap0 up", "#")
> +        self.dut.send_expect("ifconfig tap0 1.1.1.2", "#")
> +
>      def test_vhost_gso_dpdk_tcp(self):
>          """
>          DPDK GSO test with tcp traffic
>          """
>          # Config the NIC which will be assigned to another namespace
> +        self.type_row = "gso"
>          self.config_kernel_nic_host()
>          self.launch_testpmd_gso_on(0)
>          self.start_vm(0)
> @@ -323,6 +372,7 @@ class TestDPDKGsoLib(TestCase):
>          DPDK GSO test with udp traffic
>          """
>          # Config the NIC which will be assigned to another namespace
> +        self.type_row = "gso"
>          self.config_kernel_nic_host()
>          self.launch_testpmd_gso_on(1)
>          self.start_vm(0)
> @@ -352,6 +402,7 @@ class TestDPDKGsoLib(TestCase):
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> 
>      def test_vhost_tso_dpdk(self):
> +        self.type_row = "gso"
>          self.config_kernel_nic_host()
>          self.launch_testpmd_gso_on(3)
>          self.start_vm(0)
> @@ -387,6 +438,7 @@ class TestDPDKGsoLib(TestCase):
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> 
>      def test_kernel_gso_dpdk(self):
> +        self.type_row = "gso"
>          self.config_kernel_nic_host()
>          self.launch_testpmd_gso_on(4)
>          self.start_vm(1)
> @@ -423,6 +475,7 @@ class TestDPDKGsoLib(TestCase):
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> 
>      def test_no_gso_dpdk(self):
> +        self.type_row = "gso"
>          self.config_kernel_nic_host()
>          self.launch_testpmd_gso_on(4)
>          self.start_vm(1)
> @@ -461,6 +514,7 @@ class TestDPDKGsoLib(TestCase):
>          """
>          Test Performance with GSO for VXLAN traffic
>          """
> +        self.type_row = "gso"
>          self.config_kernel_nic_host_for_vxlan()
>          self.launch_testpmd_gso_on(2)
>          self.start_vm(2)
> @@ -493,6 +547,7 @@ class TestDPDKGsoLib(TestCase):
>          """
>          Test Performance with GSO for GRE traffic
>          """
> +        self.type_row = "gso"
>          self.config_kernel_nic_host_for_gre()
>          self.launch_testpmd_gso_on(2)
>          self.start_vm(2)
> @@ -520,6 +575,52 @@ class TestDPDKGsoLib(TestCase):
>          self.quit_testpmd()
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> 
> +    def test_vhost_exception_path_TAP_original(self):
> +        self.type_row = "exception_path"
> +        self.config_kernel_nic_host_for_exception_path()
> +        self.launch_testpmd_exception_path()
> +        self.dut.get_session_output(timeout=2)
> +        time.sleep(5)
> +        # Get the virtio-net device name
> +        self.prepare_tap_device()
> +        self.testpmd_reset()
> +        self.dut.send_expect('ip netns exec ns1 iperf -s -i 1', '', 10)
> +        self.iperf = self.dut.new_session(suite="iperf")
> +        self.iperf.send_expect('rm /root/iperf_client.log', '#', 10)
> +        self.iperf.send_expect('iperf -c 1.1.1.8 -i 1 -t 10 > /root/iperf_client.log
> &', '', 180)
> +        time.sleep(30)
> +        self.dut.send_expect('^C', '#', 10)
> +        self.iperf_result_verify(self.iperf)
> +        self.logger.info("TAP->virtio-user->Kernel_NIC %s " %
> (self.output_result))
> +        self.iperf.send_expect('rm /root/iperf_client.log', '#', 10)
> +        self.vhost_user.send_expect("quit", "#", 120)
> +        self.dut.close_session(self.vhost_user)
> +        self.dut.send_expect("ip netns del ns1", "#")
> +        self.dut.close_session(self.iperf)
> +
> +    def test_vhost_exception_path_NIC_original(self):
> +        self.type_row = "exception_path"
> +        self.config_kernel_nic_host_for_exception_path()
> +        self.launch_testpmd_exception_path()
> +        time.sleep(5)
> +        self.dut.get_session_output(timeout=2)
> +        self.prepare_tap_device()
> +        self.testpmd_reset()
> +        self.iperf = self.dut.new_session(suite="iperf")
> +        self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
> +        self.iperf.send_expect('iperf -s -i 1', '', 180)
> +        self.dut.send_expect('ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 10 >
> /root/iperf_client.log &', '', 10)
> +        time.sleep(30)
> +        self.iperf.send_expect('^C', '#', 10)
> +        self.iperf_result_verify(self.dut)
> +        self.dut.get_session_output(timeout=2)
> +        self.logger.info("Kernel_NIC<-virtio-user<-TAP %s " %
> (self.output_result))
> +        self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
> +        self.vhost_user.send_expect("quit", "#", 120)
> +        self.dut.close_session(self.vhost_user)
> +        self.dut.send_expect("ip netns del ns1", "#")
> +        self.dut.close_session(self.iperf)
> +
>      def tear_down(self):
>          """
>          Run after each test case.
> --
> 2.17.2


[-- Attachment #2: TestDPDKGsoLib.log --]
[-- Type: application/octet-stream, Size: 621678 bytes --]

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

* [dts] [PATCH V1] tests/dpdk_gso_lib:Put the same case to suite
@ 2019-09-05  8:07 zhuwenhui
  2019-09-05  8:06 ` Zhu, ShuaiX
  2019-09-18  5:32 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: zhuwenhui @ 2019-09-05  8:07 UTC (permalink / raw)
  To: dts; +Cc: zhuwenhui

Due to the different topology of cases in virtio_user_as_exceptional_path.
Put the same case as the dpdk_gso_lib topology into dpdk_gso_lib

Signed-off-by: zhuwenhui <wenhuix.zhu@intel.com>
---
 tests/TestSuite_dpdk_gso_lib.py | 103 +++++++++++++++++++++++++++++++-
 1 file changed, 102 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_dpdk_gso_lib.py b/tests/TestSuite_dpdk_gso_lib.py
index 68d09cb..fd50ba5 100644
--- a/tests/TestSuite_dpdk_gso_lib.py
+++ b/tests/TestSuite_dpdk_gso_lib.py
@@ -207,6 +207,14 @@ class TestDPDKGsoLib(TestCase):
             "ip netns exec ns1 ifconfig gre100 1.1.1.1/24 up",
             "#")
 
+    def config_kernel_nic_host_for_exception_path(self):
+        self.dut.send_expect("ip netns del ns1", "#")
+        self.dut.send_expect("ip netns add ns1", "#")
+        self.dut.send_expect("ip link set %s netns ns1" % self.nic_in_kernel, "#")
+        self.dut.send_expect("ip netns exec ns1 ifconfig %s 1.1.1.8 up" % self.nic_in_kernel, "#")
+        self.dut.send_expect("ip netns exec ns1 ethtool -K %s gro on" % self.nic_in_kernel, "#")
+        self.dut.send_expect("ip netns exec ns1 ethtool -K %s tso on" % self.nic_in_kernel, "#")
+
     def prepare_dpdk(self):
         # Changhe the testpmd checksum fwd code for mac change
         self.dut.send_expect(
@@ -282,18 +290,59 @@ class TestDPDKGsoLib(TestCase):
         print iperfdata
         self.verify(iperfdata, 'There no data about this case')
         self.result_table_create(['Data', 'Unit'])
-        results_row = ['GSO']
+        if self.type_row == "exception_path":
+            results_row = ['exception path']
+        else:
+            results_row = ['GSO']
         results_row.append(iperfdata[-1])
         self.result_table_add(results_row)
         self.result_table_print()
         self.output_result = "Iperf throughput is %s" % iperfdata[-1]
         self.logger.info(self.output_result)
 
+    def launch_testpmd_exception_path(self):
+        self.testcmd = self.target + "/app/testpmd -c %s -n %d --socket-mem %s --legacy-mem" \
+                + " --vdev=virtio_user0,mac=%s,path=/dev/vhost-net,queue_size=1024 -- -i" \
+                + " --rxd=1024 --txd=1024"
+        self.cores = self.dut.get_core_list("1S/2C/1T", socket=self.socket)
+        self.coremask = utils.create_mask(self.cores)
+        self.testcmd_start = self.testcmd % (self.coremask, self.memory_channel,
+                                    self.socket_mem, self.virtio_mac1)
+        self.vhost_user = self.dut.new_session(suite="user")
+        self.vhost_user.send_expect("modprobe vhost-net", "#", 120)
+        self.vhost_user.send_expect(self.testcmd_start, "testpmd> ", 120)
+        self.vhost_user.send_expect("set fwd csum", "testpmd> ", 120)
+        self.vhost_user.send_expect("stop", "testpmd> ", 120)
+        self.vhost_user.send_expect("port stop 0", "testpmd> ", 120)
+        self.vhost_user.send_expect("port stop 1", "testpmd> ", 120)
+        self.vhost_user.send_expect("port config 0 tx_offload tcp_cksum on", "testpmd> ", 120)
+        self.vhost_user.send_expect("port config 0 tx_offload ipv4_cksum on", "testpmd> ", 120)
+        self.vhost_user.send_expect("csum set ip sw 1", "testpmd> ", 120)
+        self.vhost_user.send_expect("csum set tcp hw 1", "testpmd> ", 120)
+        self.vhost_user.send_expect("csum set ip hw 0", "testpmd> ", 120)
+        self.vhost_user.send_expect("csum set tcp hw 0", "testpmd> ", 120)
+        self.vhost_user.send_expect("tso set 1448 0", "testpmd> ", 120)
+        self.vhost_user.send_expect("port start 0", "testpmd> ", 120)
+        self.vhost_user.send_expect("port start 1", "testpmd> ", 120)
+        self.vhost_user.send_expect("start", "testpmd> ", 120)
+
+    def testpmd_reset(self):
+        self.vhost_user.send_expect("stop", "testpmd> ", 120)
+        self.vhost_user.send_expect("port stop 1", "testpmd> ", 120)
+        self.vhost_user.send_expect("csum set ip sw 1", "testpmd> ", 120)
+        self.vhost_user.send_expect("port start 1", "testpmd> ", 120)
+        self.vhost_user.send_expect("start", "testpmd> ", 120)
+
+    def prepare_tap_device(self):
+        self.dut.send_expect("ifconfig tap0 up", "#")
+        self.dut.send_expect("ifconfig tap0 1.1.1.2", "#")
+
     def test_vhost_gso_dpdk_tcp(self):
         """
         DPDK GSO test with tcp traffic
         """
         # Config the NIC which will be assigned to another namespace
+        self.type_row = "gso"
         self.config_kernel_nic_host()
         self.launch_testpmd_gso_on(0)
         self.start_vm(0)
@@ -323,6 +372,7 @@ class TestDPDKGsoLib(TestCase):
         DPDK GSO test with udp traffic
         """
         # Config the NIC which will be assigned to another namespace
+        self.type_row = "gso"
         self.config_kernel_nic_host()
         self.launch_testpmd_gso_on(1)
         self.start_vm(0)
@@ -352,6 +402,7 @@ class TestDPDKGsoLib(TestCase):
         self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
 
     def test_vhost_tso_dpdk(self):
+        self.type_row = "gso"
         self.config_kernel_nic_host()
         self.launch_testpmd_gso_on(3)
         self.start_vm(0)
@@ -387,6 +438,7 @@ class TestDPDKGsoLib(TestCase):
         self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
 
     def test_kernel_gso_dpdk(self):
+        self.type_row = "gso"
         self.config_kernel_nic_host()
         self.launch_testpmd_gso_on(4)
         self.start_vm(1)
@@ -423,6 +475,7 @@ class TestDPDKGsoLib(TestCase):
         self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
 
     def test_no_gso_dpdk(self):
+        self.type_row = "gso"
         self.config_kernel_nic_host()
         self.launch_testpmd_gso_on(4)
         self.start_vm(1)
@@ -461,6 +514,7 @@ class TestDPDKGsoLib(TestCase):
         """
         Test Performance with GSO for VXLAN traffic
         """
+        self.type_row = "gso"
         self.config_kernel_nic_host_for_vxlan()
         self.launch_testpmd_gso_on(2)
         self.start_vm(2)
@@ -493,6 +547,7 @@ class TestDPDKGsoLib(TestCase):
         """
         Test Performance with GSO for GRE traffic
         """
+        self.type_row = "gso"
         self.config_kernel_nic_host_for_gre()
         self.launch_testpmd_gso_on(2)
         self.start_vm(2)
@@ -520,6 +575,52 @@ class TestDPDKGsoLib(TestCase):
         self.quit_testpmd()
         self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
 
+    def test_vhost_exception_path_TAP_original(self):
+        self.type_row = "exception_path"
+        self.config_kernel_nic_host_for_exception_path()
+        self.launch_testpmd_exception_path()
+        self.dut.get_session_output(timeout=2)
+        time.sleep(5)
+        # Get the virtio-net device name
+        self.prepare_tap_device()
+        self.testpmd_reset()
+        self.dut.send_expect('ip netns exec ns1 iperf -s -i 1', '', 10)
+        self.iperf = self.dut.new_session(suite="iperf")
+        self.iperf.send_expect('rm /root/iperf_client.log', '#', 10)
+        self.iperf.send_expect('iperf -c 1.1.1.8 -i 1 -t 10 > /root/iperf_client.log &', '', 180)
+        time.sleep(30)
+        self.dut.send_expect('^C', '#', 10)
+        self.iperf_result_verify(self.iperf)
+        self.logger.info("TAP->virtio-user->Kernel_NIC %s " % (self.output_result))
+        self.iperf.send_expect('rm /root/iperf_client.log', '#', 10)
+        self.vhost_user.send_expect("quit", "#", 120)
+        self.dut.close_session(self.vhost_user)
+        self.dut.send_expect("ip netns del ns1", "#")
+        self.dut.close_session(self.iperf)
+
+    def test_vhost_exception_path_NIC_original(self):
+        self.type_row = "exception_path"
+        self.config_kernel_nic_host_for_exception_path()
+        self.launch_testpmd_exception_path()
+        time.sleep(5)
+        self.dut.get_session_output(timeout=2)
+        self.prepare_tap_device()
+        self.testpmd_reset()
+        self.iperf = self.dut.new_session(suite="iperf")
+        self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
+        self.iperf.send_expect('iperf -s -i 1', '', 180)
+        self.dut.send_expect('ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 10 > /root/iperf_client.log &', '', 10)
+        time.sleep(30)
+        self.iperf.send_expect('^C', '#', 10)
+        self.iperf_result_verify(self.dut)
+        self.dut.get_session_output(timeout=2)
+        self.logger.info("Kernel_NIC<-virtio-user<-TAP %s " % (self.output_result))
+        self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
+        self.vhost_user.send_expect("quit", "#", 120)
+        self.dut.close_session(self.vhost_user)
+        self.dut.send_expect("ip netns del ns1", "#")
+        self.dut.close_session(self.iperf)
+
     def tear_down(self):
         """
         Run after each test case.
-- 
2.17.2


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

* Re: [dts] [PATCH V1] tests/dpdk_gso_lib:Put the same case to suite
  2019-09-05  8:07 [dts] [PATCH V1] tests/dpdk_gso_lib:Put the same case to suite zhuwenhui
  2019-09-05  8:06 ` Zhu, ShuaiX
@ 2019-09-18  5:32 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2019-09-18  5:32 UTC (permalink / raw)
  To: Zhu, WenhuiX, dts; +Cc: Zhu, WenhuiX

Disagree with the patch

1, This test suite called dpdk_gso_lib, it is meant the test cases if for GSO library, virtio_user_as_exeptional_path is not partial of it.
2, why you called "the same case" in the subject and comment. Exceptional path and gso are obviously different cases.
3, I saw moved 2 cases from virtio_user_as_exeptional_path to dpdk_gso_lib ,but does not remove it from the original file. Also, I don't found any change at test plan.


> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhuwenhui
> Sent: Thursday, September 5, 2019 4:08 PM
> To: dts@dpdk.org
> Cc: Zhu, WenhuiX <wenhuix.zhu@intel.com>
> Subject: [dts] [PATCH V1] tests/dpdk_gso_lib:Put the same case to suite
> 
> Due to the different topology of cases in virtio_user_as_exceptional_path.
> Put the same case as the dpdk_gso_lib topology into dpdk_gso_lib
> 
> Signed-off-by: zhuwenhui <wenhuix.zhu@intel.com>
> ---
>  tests/TestSuite_dpdk_gso_lib.py | 103 +++++++++++++++++++++++++++++++-
>  1 file changed, 102 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/TestSuite_dpdk_gso_lib.py
> b/tests/TestSuite_dpdk_gso_lib.py index 68d09cb..fd50ba5 100644
> --- a/tests/TestSuite_dpdk_gso_lib.py
> +++ b/tests/TestSuite_dpdk_gso_lib.py
> @@ -207,6 +207,14 @@ class TestDPDKGsoLib(TestCase):
>              "ip netns exec ns1 ifconfig gre100 1.1.1.1/24 up",
>              "#")
> 
> +    def config_kernel_nic_host_for_exception_path(self):
> +        self.dut.send_expect("ip netns del ns1", "#")
> +        self.dut.send_expect("ip netns add ns1", "#")
> +        self.dut.send_expect("ip link set %s netns ns1" % self.nic_in_kernel, "#")
> +        self.dut.send_expect("ip netns exec ns1 ifconfig %s 1.1.1.8 up" %
> self.nic_in_kernel, "#")
> +        self.dut.send_expect("ip netns exec ns1 ethtool -K %s gro on" %
> self.nic_in_kernel, "#")
> +        self.dut.send_expect("ip netns exec ns1 ethtool -K %s tso on" %
> + self.nic_in_kernel, "#")
> +
>      def prepare_dpdk(self):
>          # Changhe the testpmd checksum fwd code for mac change
>          self.dut.send_expect(
> @@ -282,18 +290,59 @@ class TestDPDKGsoLib(TestCase):
>          print iperfdata
>          self.verify(iperfdata, 'There no data about this case')
>          self.result_table_create(['Data', 'Unit'])
> -        results_row = ['GSO']
> +        if self.type_row == "exception_path":
> +            results_row = ['exception path']
> +        else:
> +            results_row = ['GSO']
>          results_row.append(iperfdata[-1])
>          self.result_table_add(results_row)
>          self.result_table_print()
>          self.output_result = "Iperf throughput is %s" % iperfdata[-1]
>          self.logger.info(self.output_result)
> 
> +    def launch_testpmd_exception_path(self):
> +        self.testcmd = self.target + "/app/testpmd -c %s -n %d --socket-mem %s
> --legacy-mem" \
> +                + " --vdev=virtio_user0,mac=%s,path=/dev/vhost-
> net,queue_size=1024 -- -i" \
> +                + " --rxd=1024 --txd=1024"
> +        self.cores = self.dut.get_core_list("1S/2C/1T", socket=self.socket)
> +        self.coremask = utils.create_mask(self.cores)
> +        self.testcmd_start = self.testcmd % (self.coremask,
> self.memory_channel,
> +                                    self.socket_mem, self.virtio_mac1)
> +        self.vhost_user = self.dut.new_session(suite="user")
> +        self.vhost_user.send_expect("modprobe vhost-net", "#", 120)
> +        self.vhost_user.send_expect(self.testcmd_start, "testpmd> ", 120)
> +        self.vhost_user.send_expect("set fwd csum", "testpmd> ", 120)
> +        self.vhost_user.send_expect("stop", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port stop 0", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port stop 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port config 0 tx_offload tcp_cksum on",
> "testpmd> ", 120)
> +        self.vhost_user.send_expect("port config 0 tx_offload ipv4_cksum on",
> "testpmd> ", 120)
> +        self.vhost_user.send_expect("csum set ip sw 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("csum set tcp hw 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("csum set ip hw 0", "testpmd> ", 120)
> +        self.vhost_user.send_expect("csum set tcp hw 0", "testpmd> ", 120)
> +        self.vhost_user.send_expect("tso set 1448 0", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port start 0", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port start 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("start", "testpmd> ", 120)
> +
> +    def testpmd_reset(self):
> +        self.vhost_user.send_expect("stop", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port stop 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("csum set ip sw 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("port start 1", "testpmd> ", 120)
> +        self.vhost_user.send_expect("start", "testpmd> ", 120)
> +
> +    def prepare_tap_device(self):
> +        self.dut.send_expect("ifconfig tap0 up", "#")
> +        self.dut.send_expect("ifconfig tap0 1.1.1.2", "#")
> +
>      def test_vhost_gso_dpdk_tcp(self):
>          """
>          DPDK GSO test with tcp traffic
>          """
>          # Config the NIC which will be assigned to another namespace
> +        self.type_row = "gso"
>          self.config_kernel_nic_host()
>          self.launch_testpmd_gso_on(0)
>          self.start_vm(0)
> @@ -323,6 +372,7 @@ class TestDPDKGsoLib(TestCase):
>          DPDK GSO test with udp traffic
>          """
>          # Config the NIC which will be assigned to another namespace
> +        self.type_row = "gso"
>          self.config_kernel_nic_host()
>          self.launch_testpmd_gso_on(1)
>          self.start_vm(0)
> @@ -352,6 +402,7 @@ class TestDPDKGsoLib(TestCase):
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> 
>      def test_vhost_tso_dpdk(self):
> +        self.type_row = "gso"
>          self.config_kernel_nic_host()
>          self.launch_testpmd_gso_on(3)
>          self.start_vm(0)
> @@ -387,6 +438,7 @@ class TestDPDKGsoLib(TestCase):
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> 
>      def test_kernel_gso_dpdk(self):
> +        self.type_row = "gso"
>          self.config_kernel_nic_host()
>          self.launch_testpmd_gso_on(4)
>          self.start_vm(1)
> @@ -423,6 +475,7 @@ class TestDPDKGsoLib(TestCase):
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> 
>      def test_no_gso_dpdk(self):
> +        self.type_row = "gso"
>          self.config_kernel_nic_host()
>          self.launch_testpmd_gso_on(4)
>          self.start_vm(1)
> @@ -461,6 +514,7 @@ class TestDPDKGsoLib(TestCase):
>          """
>          Test Performance with GSO for VXLAN traffic
>          """
> +        self.type_row = "gso"
>          self.config_kernel_nic_host_for_vxlan()
>          self.launch_testpmd_gso_on(2)
>          self.start_vm(2)
> @@ -493,6 +547,7 @@ class TestDPDKGsoLib(TestCase):
>          """
>          Test Performance with GSO for GRE traffic
>          """
> +        self.type_row = "gso"
>          self.config_kernel_nic_host_for_gre()
>          self.launch_testpmd_gso_on(2)
>          self.start_vm(2)
> @@ -520,6 +575,52 @@ class TestDPDKGsoLib(TestCase):
>          self.quit_testpmd()
>          self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
> 
> +    def test_vhost_exception_path_TAP_original(self):
> +        self.type_row = "exception_path"
> +        self.config_kernel_nic_host_for_exception_path()
> +        self.launch_testpmd_exception_path()
> +        self.dut.get_session_output(timeout=2)
> +        time.sleep(5)
> +        # Get the virtio-net device name
> +        self.prepare_tap_device()
> +        self.testpmd_reset()
> +        self.dut.send_expect('ip netns exec ns1 iperf -s -i 1', '', 10)
> +        self.iperf = self.dut.new_session(suite="iperf")
> +        self.iperf.send_expect('rm /root/iperf_client.log', '#', 10)
> +        self.iperf.send_expect('iperf -c 1.1.1.8 -i 1 -t 10 > /root/iperf_client.log
> &', '', 180)
> +        time.sleep(30)
> +        self.dut.send_expect('^C', '#', 10)
> +        self.iperf_result_verify(self.iperf)
> +        self.logger.info("TAP->virtio-user->Kernel_NIC %s " %
> (self.output_result))
> +        self.iperf.send_expect('rm /root/iperf_client.log', '#', 10)
> +        self.vhost_user.send_expect("quit", "#", 120)
> +        self.dut.close_session(self.vhost_user)
> +        self.dut.send_expect("ip netns del ns1", "#")
> +        self.dut.close_session(self.iperf)
> +
> +    def test_vhost_exception_path_NIC_original(self):
> +        self.type_row = "exception_path"
> +        self.config_kernel_nic_host_for_exception_path()
> +        self.launch_testpmd_exception_path()
> +        time.sleep(5)
> +        self.dut.get_session_output(timeout=2)
> +        self.prepare_tap_device()
> +        self.testpmd_reset()
> +        self.iperf = self.dut.new_session(suite="iperf")
> +        self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
> +        self.iperf.send_expect('iperf -s -i 1', '', 180)
> +        self.dut.send_expect('ip netns exec ns1 iperf -c 1.1.1.2 -i 1 -t 10 >
> /root/iperf_client.log &', '', 10)
> +        time.sleep(30)
> +        self.iperf.send_expect('^C', '#', 10)
> +        self.iperf_result_verify(self.dut)
> +        self.dut.get_session_output(timeout=2)
> +        self.logger.info("Kernel_NIC<-virtio-user<-TAP %s " %
> (self.output_result))
> +        self.dut.send_expect('rm /root/iperf_client.log', '#', 10)
> +        self.vhost_user.send_expect("quit", "#", 120)
> +        self.dut.close_session(self.vhost_user)
> +        self.dut.send_expect("ip netns del ns1", "#")
> +        self.dut.close_session(self.iperf)
> +
>      def tear_down(self):
>          """
>          Run after each test case.
> --
> 2.17.2


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05  8:07 [dts] [PATCH V1] tests/dpdk_gso_lib:Put the same case to suite zhuwenhui
2019-09-05  8:06 ` Zhu, ShuaiX
2019-09-18  5:32 ` Tu, Lijuan

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://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/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


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