From patchwork Tue Sep 29 06:20:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 79135 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CA1D9A04C0; Tue, 29 Sep 2020 08:19:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD70F1D630; Tue, 29 Sep 2020 08:19:01 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E5F231D62E for ; Tue, 29 Sep 2020 08:18:58 +0200 (CEST) IronPort-SDR: aMMb2S8zxRe6kwwNUdEc9PnXjzYxIk5WCM9xMAQHd8AMm5lps60cUhuUIHySAcTqIaeZfjhs8W TeAqFeYqXg8A== X-IronPort-AV: E=McAfee;i="6000,8403,9758"; a="159459540" X-IronPort-AV: E=Sophos;i="5.77,317,1596524400"; d="scan'208";a="159459540" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 23:18:52 -0700 IronPort-SDR: zPNNW7IQiwlLpMysKQ458wHjiBlBTh4yPdKDCR8J1XZu46g+PM9YcLHuIvFCimKLfgaRnnKhb6 Mhcqug1A6Bjg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,317,1596524400"; d="scan'208";a="384687731" Received: from unknown (HELO localhost.localdomain) ([10.240.183.80]) by orsmga001.jf.intel.com with ESMTP; 28 Sep 2020 23:18:50 -0700 From: JiangYuX To: dts@dpdk.org Cc: JiangYu Date: Tue, 29 Sep 2020 14:20:43 +0800 Message-Id: <20200929062043.28037-1-yux.jiang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] tests/TestSuite_dpdk_gro_lib: add test_vhost_gro_with_2queues_tcp_lightmode script X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" From: JiangYu Add test_vhost_gro_with_2queues_tcp_lightmode Signed-off-by: JiangYu Tested-by: Jiang, YuX Acked-by: Wang, Yinan --- tests/TestSuite_dpdk_gro_lib.py | 54 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/tests/TestSuite_dpdk_gro_lib.py b/tests/TestSuite_dpdk_gro_lib.py index 3f23e3e..1a4910a 100644 --- a/tests/TestSuite_dpdk_gro_lib.py +++ b/tests/TestSuite_dpdk_gro_lib.py @@ -298,8 +298,8 @@ class TestDPDKGROLib(TestCase): 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_queue'] = queue 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' @@ -466,15 +466,57 @@ class TestDPDKGROLib(TestCase): (self.virtio_ip1), '', 180) time.sleep(30) print(out) - tc4_perfdata = self.iperf_result_verify('GRO lib') + 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)) + exp_perfdata = self.dut.send_expect("cat /root/dpdk_gro_lib_on_iperf_tc5.log", "#") + self.verify("No such file or directory" not in exp_perfdata, "Cannot find dpdk_gro_lib_on_iperf_tc5.log, please run test_vhost_gro_with_2queues_tcp_lightmode firstly") + if exp_perfdata: + self.verify(float(perfdata) > float(exp_perfdata), "TestFailed: W/cbdma iperf data is %s Kbits/sec, W/O cbdma iperf data is %s Kbits/sec" %(perfdata, exp_perfdata)) + + def test_vhost_gro_with_2queues_tcp_lightmode(self): + """ + Test Case5: DPDK GRO test with 2 queues using tcp/ipv4 traffic + """ + self.config_kernel_nic_host(0) + self.launch_testpmd_gro_on(mode=1, queue=2) + self.start_vm(mode=1, 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' % + (self.vm1_intf, self.virtio_ip1), '#', 10) + self.vm1_dut.send_expect('ifconfig %s up' % 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) + self.dut.send_expect( + 'ip netns exec ns1 iperf -c %s -i 2 -t 60 -f g -m > /root/iperf_client.log &' % + (self.virtio_ip1), '', 180) + time.sleep(60) + 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 + self.set_testpmd_gro_off() + self.dut.send_expect( + 'ip netns exec ns1 iperf -c %s -i 2 -t 60 -f g -m > /root/iperf_client.log &' % + (self.virtio_ip1), '', 180) + time.sleep(60) + self.iperf_result_verify('Kernel GRO') + print(("the Kernel GRO %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", "#") + self.dut.send_expect('echo %s > /root/dpdk_gro_lib_on_iperf_tc5.log' % perfdata, '#', 10) def tear_down(self): """