From patchwork Fri Mar 19 06:46:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 89529 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A981A0562; Fri, 19 Mar 2021 07:47:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51D90406B4; Fri, 19 Mar 2021 07:47:13 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 1D5474003F for ; Fri, 19 Mar 2021 07:47:11 +0100 (CET) IronPort-SDR: pLL7nVNDg/MECf2G+S0BxClktgEPCQrTNKJc+74prZrpA+sbap91UMTaFGOuy5QRfkKke3Bgr4 nwtx6lTT90ag== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="209859686" X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="209859686" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:11 -0700 IronPort-SDR: 6pckZRk+shXWgegjgJjZZgocWwHPCvu0w/66RTBcJASmidUE+emYiamwE5iV5OcHL5Jx9SzRDY 3JfUCTrGFcqg== X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="606504550" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:10 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Fri, 19 Mar 2021 14:46:09 +0800 Message-Id: <20210319064609.4412-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1 1/9] tests/cbdma:modify hard code bind cbdma device to igb_uio by drivername in execution.cfg X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" 1.Modify hard code bind cbdma device to igb_uio by drivername in execution.cfg. 2.Adjust code format. Signed-off-by: Ling Wei --- tests/TestSuite_cbdma.py | 48 ++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 32 deletions(-) mode change 100755 => 100644 tests/TestSuite_cbdma.py diff --git a/tests/TestSuite_cbdma.py b/tests/TestSuite_cbdma.py old mode 100755 new mode 100644 index f95e2942..0cf598dc --- a/tests/TestSuite_cbdma.py +++ b/tests/TestSuite_cbdma.py @@ -63,7 +63,6 @@ class TestCBDMA(TestCase): self.ioat_path = self.dut.apps_name['ioat'] self.verify('Error' not in out, 'compilation ioat error') - def set_up(self): """ Run before each test case. @@ -84,18 +83,18 @@ class TestCBDMA(TestCase): get cores list depend on thread_num """ core_config = '1S/%dC/1T' % self.cbdma_cores_num - self.core_list = self.dut.get_core_list( - core_config, socket=self.ports_socket) - self.verify(len(self.core_list) >= self.cbdma_cores_num, - 'There no enough cores to run this case') + self.core_list = self.dut.get_core_list(core_config, socket=self.ports_socket) + self.verify(len(self.core_list) >= self.cbdma_cores_num, 'There no enough cores to run this case') def get_cbdma_ports_info_and_bind_to_dpdk(self): """ get all cbdma ports """ + # check driver name in execution.cfg + self.verify(self.drivername == 'igb_uio', + "CBDMA test case only use igb_uio driver, need config drivername=igb_uio in execution.cfg") str_info = 'Misc (rawdev) devices using kernel driver' - out = self.dut.send_expect('./usertools/dpdk-devbind.py --status-dev misc', - '# ', 30) + 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) @@ -112,15 +111,13 @@ class TestCBDMA(TestCase): self.cbdma_dev_infos.append(pci_info.group(1)) self.verify(len(self.cbdma_dev_infos) >= 8, 'There no enough cbdma device to run this suite') self.device_str = ' '.join(self.cbdma_dev_infos[0:8]) - self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=igb_uio %s' % - self.device_str, '# ', 60) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s' % (self.drivername, 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) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=ioatdma %s' % self.device_str, '# ', 60) def get_ports_info(self): dev_info = [] @@ -183,7 +180,6 @@ class TestCBDMA(TestCase): pkt.config_layer('ether', {'dst': '%s' % dst_mac}) pkt.config_layer('udp', {'src': 1111, 'dst': 1112}) pkt.save_pcapfile(self.tester, "%s/cbdma_%d.pcap" % (self.tester.tmp_file, port)) - stream_option = { 'pcap': "%s/cbdma_%d.pcap" % (self.tester.tmp_file, port), 'fields_config': { @@ -197,7 +193,6 @@ class TestCBDMA(TestCase): "%s/cbdma_%d.pcap" % (self.tester.tmp_file, port)) self.tester.pktgen.config_stream(stream_id, stream_option) stream_ids.append(stream_id) - return stream_ids def send_and_verify_throughput(self, check_channel=False): @@ -256,8 +251,7 @@ class TestCBDMA(TestCase): self.cbdma_copy_mode = 'hw' self.get_core_list() dev_info = self.get_ports_info() - eal_params = self.dut.create_eal_parameters(cores=self.core_list, - ports=dev_info, prefix='cbdma') + eal_params = self.dut.create_eal_parameters(cores=self.core_list, ports=dev_info, prefix='cbdma') self.launch_ioatfwd_app(eal_params) self.send_and_verify_throughput(check_channel=False) self.result_table_print() @@ -274,8 +268,7 @@ class TestCBDMA(TestCase): self.cbdma_copy_mode = 'hw' self.get_core_list() dev_info = self.get_ports_info() - eal_params = self.dut.create_eal_parameters(cores=self.core_list, - ports=dev_info, prefix='cbdma') + eal_params = self.dut.create_eal_parameters(cores=self.core_list, ports=dev_info, prefix='cbdma') self.launch_ioatfwd_app(eal_params) self.send_and_verify_throughput(check_channel=False) self.result_table_print() @@ -292,8 +285,7 @@ class TestCBDMA(TestCase): self.cbdma_copy_mode = 'hw' self.get_core_list() dev_info = self.get_ports_info() - eal_params = self.dut.create_eal_parameters(cores=self.core_list, - ports=dev_info, prefix='cbdma') + eal_params = self.dut.create_eal_parameters(cores=self.core_list, ports=dev_info, prefix='cbdma') self.launch_ioatfwd_app(eal_params) self.send_and_verify_throughput(check_channel=True) self.result_table_print() @@ -309,12 +301,10 @@ class TestCBDMA(TestCase): self.cbdma_copy_mode = 'hw' queue_num_list = [2, 4, 8] self.get_core_list() - for queue_num in queue_num_list: self.cbdma_ioat_dev_num = queue_num dev_info = self.get_ports_info() - eal_params = self.dut.create_eal_parameters(cores=self.core_list, - ports=dev_info, prefix='cbdma') + eal_params = self.dut.create_eal_parameters(cores=self.core_list, ports=dev_info, prefix='cbdma') self.launch_ioatfwd_app(eal_params) self.send_and_verify_throughput(check_channel=True) self.send_session.send_expect('^c', '# ') @@ -332,11 +322,9 @@ class TestCBDMA(TestCase): self.cbdma_copy_mode = 'hw' self.get_core_list() dev_info = self.get_ports_info() - eal_params = self.dut.create_eal_parameters(cores=self.core_list, - ports=dev_info, prefix='cbdma') + eal_params = self.dut.create_eal_parameters(cores=self.core_list, ports=dev_info, prefix='cbdma') self.launch_ioatfwd_app(eal_params) self.send_and_verify_throughput(check_channel=False) - self.send_session.send_expect('^c', '# ') self.cbdma_updating_mac = 'disable' self.launch_ioatfwd_app(eal_params) @@ -355,11 +343,9 @@ class TestCBDMA(TestCase): self.cbdma_copy_mode = 'hw' self.get_core_list() dev_info = self.get_ports_info() - eal_params = self.dut.create_eal_parameters(cores=self.core_list, - ports=dev_info, prefix='cbdma') + eal_params = self.dut.create_eal_parameters(cores=self.core_list, ports=dev_info, prefix='cbdma') self.launch_ioatfwd_app(eal_params) self.send_and_verify_throughput(check_channel=False) - self.send_session.send_expect('^c', '# ') self.cbdma_copy_mode = 'sw' self.launch_ioatfwd_app(eal_params) @@ -381,12 +367,10 @@ class TestCBDMA(TestCase): dev_info.pop(0) self.get_core_list() self.pmdout = PmdOutput(self.dut) - self.pmdout.start_testpmd(cores='', eal_param='--vdev net_null_0 --proc-type=primary', - ports=dev_info) + self.pmdout.start_testpmd(cores='', eal_param='--vdev net_null_0 --proc-type=primary', ports=dev_info) self.pmdout.execute_cmd('port stop all') self.cbdma_proc = '--proc-type=secondary' - eal_params = self.dut.create_eal_parameters(cores=self.core_list, - ports=dev_info) + eal_params = self.dut.create_eal_parameters(cores=self.core_list, ports=dev_info) self.launch_ioatfwd_app(eal_params) self.send_session.send_expect('^C','#') self.pmdout.execute_cmd('^C') From patchwork Fri Mar 19 06:46:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 89530 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 834CAA0562; Fri, 19 Mar 2021 07:47:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D0464067C; Fri, 19 Mar 2021 07:47:21 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 028844003F for ; Fri, 19 Mar 2021 07:47:19 +0100 (CET) IronPort-SDR: LM8iclY9zyqPSabOd5WmI14QhSkKY4kI4Em19SLTqs9jURPiNFnHNx+c5RjB2Pl5N3yxw1x1qZ eDV94xnqMmJg== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="187486488" X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="187486488" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:19 -0700 IronPort-SDR: oQVMOUadOXQz503FjV/bNN+GRdu4FDAKJ42rRzUGMkC9KhYM7U+0OEy3oSC2IksmVWo6SuVhFr YYnNkksdxN2g== X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="606504592" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:17 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Fri, 19 Mar 2021 14:46:17 +0800 Message-Id: <20210319064617.4472-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1 2/9] tests/dpdk_gro_lib:modify hard code bind cbdma device to igb_uio by drivername in execution.cfg X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" 1.Modify hard code bind cbdma device to igb_uio by drivername in execution.cfg. 2.Adjust code format. 3.Delete invalid code about unbind driver because of framwork will auto bind and uinbind nic. Signed-off-by: Ling Wei --- tests/TestSuite_dpdk_gro_lib.py | 156 +++++++++----------------------- 1 file changed, 44 insertions(+), 112 deletions(-) diff --git a/tests/TestSuite_dpdk_gro_lib.py b/tests/TestSuite_dpdk_gro_lib.py index ed3c8103..37d2faa6 100644 --- a/tests/TestSuite_dpdk_gro_lib.py +++ b/tests/TestSuite_dpdk_gro_lib.py @@ -57,7 +57,6 @@ class TestDPDKGROLib(TestCase): for i in self.dut_ports: port = self.dut.ports_info[i]['port'] port.bind_driver() - # get and bind the port in config file self.pci = peer.get_pci_info() self.pci_drv = peer.get_pci_driver_info() @@ -80,8 +79,7 @@ class TestDPDKGROLib(TestCase): self.socket = 0 # get core list on this socket, 2 cores for testpmd, 1 core for qemu cores_config = '1S/3C/1T' - self.verify(self.dut.number_of_cores >= 3, - "There has not enought cores to test this case %s" % self.suite_name) + self.verify(self.dut.number_of_cores >= 3, "There has not enought cores to test this case %s" % self.suite_name) cores_list = self.dut.get_core_list("1S/3C/1T", socket=self.socket) self.vhost_list = cores_list[0:2] self.qemu_cpupin = cores_list[2:3][0] @@ -96,7 +94,6 @@ class TestDPDKGROLib(TestCase): self.socket_mem = '1024,1024' 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 = [] @@ -116,6 +113,9 @@ class TestDPDKGROLib(TestCase): """ get all cbdma ports """ + # check driver name in execution.cfg + self.verify(self.drivername == 'igb_uio', + "CBDMA test case only use igb_uio driver, need config drivername=igb_uio in execution.cfg") 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') @@ -141,8 +141,7 @@ class TestDPDKGROLib(TestCase): 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) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s' % (self.drivername, self.device_str), '# ', 60) def bind_cbdma_device_to_kernel(self): if self.device_str is not None: @@ -160,7 +159,6 @@ class TestDPDKGROLib(TestCase): # 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" self.vhost_user = self.dut.new_session(suite="user") @@ -218,47 +216,26 @@ class TestDPDKGROLib(TestCase): if (mode == 0): 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 tso on" % - self.nic_in_kernel, "#") + 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 tso on" %self.nic_in_kernel, "#") if (mode == 1): 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.2.4/24 up" % - self.nic_in_kernel, "#") - self.dut.send_expect( - "ip netns exec ns1 ip link add vxlan1 type vxlan id 42 dev %s dstport 4789" % - self.nic_in_kernel, "#") - self.dut.send_expect( - "ip netns exec ns1 bridge fdb append to 00:00:00:00:00:00 dst 1.1.2.3 dev vxlan1", "#") - self.dut.send_expect( - "ip netns exec ns1 ip addr add 50.1.1.1/24 dev vxlan1", "#") - self.dut.send_expect( - "ip netns exec ns1 ip link set up dev vxlan1", "#") + 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.2.4/24 up" %self.nic_in_kernel, "#") + self.dut.send_expect("ip netns exec ns1 ip link add vxlan1 type vxlan id 42 dev %s dstport 4789" %self.nic_in_kernel, "#") + self.dut.send_expect("ip netns exec ns1 bridge fdb append to 00:00:00:00:00:00 dst 1.1.2.3 dev vxlan1", "#") + self.dut.send_expect("ip netns exec ns1 ip addr add 50.1.1.1/24 dev vxlan1", "#") + self.dut.send_expect("ip netns exec ns1 ip link set up dev vxlan1", "#") def prepare_dpdk(self): # # Changhe the testpmd checksum fwd code for mac change - self.dut.send_expect( - "cp ./app/test-pmd/csumonly.c ./app/test-pmd/csumonly_backup.c", - "#") - self.dut.send_expect( - "cp ./drivers/net/vhost/rte_eth_vhost.c ./drivers/net/vhost/rte_eth_vhost-backup.c", - "#") - self.dut.send_expect( - "sed -i '/ether_addr_copy(&peer_eth/i\#if 0' ./app/test-pmd/csumonly.c", "#") - self.dut.send_expect( - "sed -i '/parse_ethernet(eth_hdr, &info/i\#endif' ./app/test-pmd/csumonly.c", "#") + self.dut.send_expect("cp ./app/test-pmd/csumonly.c ./app/test-pmd/csumonly_backup.c", "#") + self.dut.send_expect("cp ./drivers/net/vhost/rte_eth_vhost.c ./drivers/net/vhost/rte_eth_vhost-backup.c", "#") + self.dut.send_expect("sed -i '/ether_addr_copy(&peer_eth/i\#if 0' ./app/test-pmd/csumonly.c", "#") + self.dut.send_expect("sed -i '/parse_ethernet(eth_hdr, &info/i\#endif' ./app/test-pmd/csumonly.c", "#") # change offload of vhost tx_offload = 'DEV_TX_OFFLOAD_VLAN_INSERT | ' + \ 'DEV_TX_OFFLOAD_UDP_CKSUM | ' + \ @@ -270,20 +247,14 @@ class TestDPDKGROLib(TestCase): 'DEV_RX_OFFLOAD_UDP_CKSUM | ' + \ 'DEV_RX_OFFLOAD_IPV4_CKSUM | ' + \ 'DEV_RX_OFFLOAD_TCP_LRO;' - self.dut.send_expect( - "sed -i 's/DEV_TX_OFFLOAD_VLAN_INSERT;/%s/' drivers/net/vhost/rte_eth_vhost.c" % tx_offload, "#") - self.dut.send_expect( - "sed -i 's/DEV_RX_OFFLOAD_VLAN_STRIP;/%s/' drivers/net/vhost/rte_eth_vhost.c" % rx_offload, "#") + self.dut.send_expect("sed -i 's/DEV_TX_OFFLOAD_VLAN_INSERT;/%s/' drivers/net/vhost/rte_eth_vhost.c" % tx_offload, "#") + self.dut.send_expect("sed -i 's/DEV_RX_OFFLOAD_VLAN_STRIP;/%s/' drivers/net/vhost/rte_eth_vhost.c" % rx_offload, "#") self.dut.build_install_dpdk(self.dut.target) def unprepare_dpdk(self): # Recovery the DPDK code to original - self.dut.send_expect( - "cp ./app/test-pmd/csumonly_backup.c ./app/test-pmd/csumonly.c ", - "#") - self.dut.send_expect( - "cp ./drivers/net/vhost/rte_eth_vhost-backup.c ./drivers/net/vhost/rte_eth_vhost.c ", - "#") + self.dut.send_expect("cp ./app/test-pmd/csumonly_backup.c ./app/test-pmd/csumonly.c ", "#") + self.dut.send_expect("cp ./drivers/net/vhost/rte_eth_vhost-backup.c ./drivers/net/vhost/rte_eth_vhost.c ", "#") self.dut.send_expect("rm -rf ./app/test-pmd/csumonly_backup.c", "#") self.dut.send_expect("rm -rf ./drivers/net/vhost/rte_eth_vhost-backup.c", "#") self.dut.build_install_dpdk(self.dut.target) @@ -356,26 +327,19 @@ class TestDPDKGROLib(TestCase): 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 %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('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 1 -t 10 -P 1> /root/iperf_client.log &' % - (self.virtio_ip1), '', 180) + self.dut.send_expect('ip netns exec ns1 iperf -c %s -i 1 -t 10 -P 1> /root/iperf_client.log &' %(self.virtio_ip1), '', 180) time.sleep(30) 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 self.set_testpmd_gro_off() - self.dut.send_expect( - 'ip netns exec ns1 iperf -c %s -i 1 -t 10 -P 1 > /root/iperf_client.log &' % - (self.virtio_ip1), '', 180) + self.dut.send_expect('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('Kernel GRO') print(("the Kernel GRO %s " % (self.output_result))) @@ -396,18 +360,12 @@ class TestDPDKGROLib(TestCase): 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 %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('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 1 -t 10 -P 1> /root/iperf_client.log &' % - (self.virtio_ip1), '', 180) + self.dut.send_expect('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') print(("the GRO lib %s " % (self.output_result))) @@ -427,18 +385,12 @@ class TestDPDKGROLib(TestCase): 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 %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('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 1 -t 10 -P 1> /root/iperf_client.log &' % - (self.virtio_ip1), '', 180) + self.dut.send_expect('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') print(("the GRO lib %s " % (self.output_result))) @@ -458,17 +410,13 @@ class TestDPDKGROLib(TestCase): 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('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.set_testpmd_params() 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) + 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) perfdata = self.iperf_result_verify('GRO lib') @@ -477,9 +425,11 @@ class TestDPDKGROLib(TestCase): self.quit_testpmd() self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") 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") + 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)) + 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): """ @@ -495,26 +445,19 @@ class TestDPDKGROLib(TestCase): 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 %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('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) + 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) + 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))) @@ -532,24 +475,13 @@ class TestDPDKGROLib(TestCase): self.dut.send_expect("rm -rf %s/vhost-net" % self.base_dir, "#") time.sleep(2) self.dut.send_expect("ip netns del ns1", "# ", 30) - self.dut.send_expect( - "./usertools/dpdk-devbind.py -u %s" % (self.peer_pci), '# ', 30) - self.dut.send_expect( - "./usertools/dpdk-devbind.py -b %s %s" % - (self.pci_drv, self.peer_pci), '# ', 30) + self.dut.send_expect("./usertools/dpdk-devbind.py -u %s" % (self.peer_pci), '# ', 30) + 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): """ Run after each test suite. """ - for i in self.dut_ports: - port = self.dut.ports_info[i]['port'] - port.bind_driver(self.def_driver) self.unprepare_dpdk() self.dut.send_expect("ip netns del ns1", "# ", 30) - self.dut.send_expect( - "./usertools/dpdk-devbind.py -u %s" % (self.pci), '# ', 30) - self.dut.send_expect( - "./usertools/dpdk-devbind.py -b %s %s" % - (self.pci_drv, self.pci), '# ', 30) From patchwork Fri Mar 19 06:46:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 89531 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AED3CA0562; Fri, 19 Mar 2021 07:47:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9C08140E92; Fri, 19 Mar 2021 07:47:32 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id ACA674003F for ; Fri, 19 Mar 2021 07:47:30 +0100 (CET) IronPort-SDR: /dUvoY1Cr15YcIXbxglI103O6Ipx3QjlbJ4GObQgx49+WVUHPbZ0Rv9TXnZYnIRKep166n+3KQ nbihdOJwTADw== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="187486498" X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="187486498" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:27 -0700 IronPort-SDR: Mfzt+/rf3h1VPMNpdSKPqgQn7AO8igOrqLJLZ6f6Nsr/kXUuz3jcNNRqdp+AW3kcs0nqOveClH 8c+lequgtZIQ== X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="606504639" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:26 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Fri, 19 Mar 2021 14:46:25 +0800 Message-Id: <20210319064625.4532-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1 3/9] tests/vhost_cbdma:modify hard code bind cbdma device to igb_uio by drivername in execution.cfg X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" 1.Modify hard code bind cbdma device to igb_uio by drivername in execution.cfg. 2.Adjust code format. 3.Delete invalid code about unbind driver because of framwork will auto bind and uinbind nic. Signed-off-by: Ling Wei --- tests/TestSuite_vhost_cbdma.py | 119 ++++++--------------------------- 1 file changed, 19 insertions(+), 100 deletions(-) diff --git a/tests/TestSuite_vhost_cbdma.py b/tests/TestSuite_vhost_cbdma.py index 78d5523b..260c534e 100644 --- a/tests/TestSuite_vhost_cbdma.py +++ b/tests/TestSuite_vhost_cbdma.py @@ -59,7 +59,6 @@ class TestVirTioVhostCbdma(TestCase): # Get and verify the ports self.dut_ports = self.dut.get_ports() self.number_of_ports = 1 - self.vhost_user = self.dut.new_session(suite="vhost-user") self.virtio_user = self.dut.new_session(suite="virtio-user") self.virtio_user1 = self.dut.new_session(suite="virtio-user1") @@ -73,9 +72,7 @@ class TestVirTioVhostCbdma(TestCase): self.socket = self.dut.get_numa_id(self.dut_ports[0]) self.cores = self.dut.get_core_list("all", socket=self.socket) self.cbdma_dev_infos = [] - self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) - self.bind_nic_driver(self.dut_ports) # the path of pcap file self.out_path = '/tmp/%s' % self.suite_name out = self.tester.send_expect('ls -d %s' % self.out_path, '# ') @@ -97,48 +94,29 @@ class TestVirTioVhostCbdma(TestCase): self.table_header.append("Mpps") self.table_header.append("% linerate") self.result_table_create(self.table_header) - # test parameters include: frames size, descriptor numbers self.test_parameters = self.get_suite_cfg()['test_parameters'] - # traffic duraion in second self.test_duration = self.get_suite_cfg()['test_duration'] - # initilize throughput attribution # {'TestCase':{ 'Mode': {'$framesize':{"$nb_desc": 'throughput'}}} self.throughput = {} - # Accepted tolerance in Mpps self.gap = self.get_suite_cfg()['accepted_tolerance'] self.test_result = {} self.nb_desc = self.test_parameters[64][0] - self.dut.send_expect("killall -I %s" % self.testpmd_name, '#', 20) self.dut.send_expect("rm -rf %s/vhost-net*" % self.base_dir, "#") self.dut.send_expect("rm -rf /tmp/s0", "#") self.mode_list = [] - def bind_nic_driver(self, ports, driver=""): - if driver == "igb_uio": - for port in ports: - netdev = self.dut.ports_info[port]['port'] - driver = netdev.get_nic_driver() - if driver != 'igb_uio': - netdev.bind_driver(driver='igb_uio') - else: - for port in ports: - netdev = self.dut.ports_info[port]['port'] - driver_now = netdev.get_nic_driver() - if driver == "": - driver = netdev.default_driver - if driver != driver_now: - netdev.bind_driver(driver=driver) - def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num): """ get all cbdma ports """ - + # check driver name in execution.cfg + self.verify(self.drivername == 'igb_uio', + "CBDMA test case only use igb_uio driver, need config drivername=igb_uio in execution.cfg") out = self.dut.send_expect('./usertools/dpdk-devbind.py --status-dev misc', '# ', 30) device_info = out.split('\n') for device in device_info: @@ -155,20 +133,15 @@ class TestVirTioVhostCbdma(TestCase): 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') - self.used_cbdma = self.cbdma_dev_infos[0:cbdma_num] - self.device_str = ' '.join(self.used_cbdma) - self.dut.setup_modules(self.target, "igb_uio", "None") - self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s %s' % - ("igb_uio", self.device_str, self.pci_info), '# ', 60) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s' % (self.drivername, 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) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=ioatdma %s' % self.device_str, '# ', 60) def check_packets_of_each_queue(self, queue_list): """ @@ -187,7 +160,6 @@ class TestVirTioVhostCbdma(TestCase): queue_index + \ "rx-packets:%d, tx-packets:%d" % (rx_packets, tx_packets)) - self.vhost_user.send_expect("clear port stats all", "testpmd> ", 30) self.vhost_user.send_expect("start", "testpmd> ", 30) @@ -203,9 +175,7 @@ class TestVirTioVhostCbdma(TestCase): return True if out == '2048' else False def launch_testpmd_as_vhost_user(self, command, cores="Default", dev="", ports = ""): - self.pmdout_vhost_user.start_testpmd(cores=cores, param=command, vdevs=[dev], ports=ports, - prefix="vhost", fixed_prefix=True) - + self.pmdout_vhost_user.start_testpmd(cores=cores, param=command, vdevs=[dev], ports=ports, prefix="vhost") self.vhost_user.send_expect('set fwd mac', 'testpmd> ', 120) self.vhost_user.send_expect('start', 'testpmd> ', 120) @@ -213,8 +183,7 @@ class TestVirTioVhostCbdma(TestCase): eal_params = "" if self.check_2m_env: eal_params += " --single-file-segments" - self.pmdout_virtio_user1.start_testpmd(cores, command, vdevs=[dev], ports=[], no_pci=True, - prefix="virtio1", fixed_prefix=True, eal_param=eal_params) + self.pmdout_virtio_user1.start_testpmd(cores, command, vdevs=[dev], no_pci=True, prefix="virtio1", eal_param=eal_params) self.virtio_user1.send_expect('set fwd mac', 'testpmd> ', 30) self.virtio_user1.send_expect('start', 'testpmd> ', 30) self.virtio_user1.send_expect('show port info all', 'testpmd> ', 30) @@ -223,9 +192,7 @@ class TestVirTioVhostCbdma(TestCase): eal_params = "" if self.check_2m_env: eal_params += " --single-file-segments" - self.pmdout_virtio_user.start_testpmd(cores, command, vdevs=[dev], ports=[], no_pci=True, - prefix="virtio", fixed_prefix=True, eal_param=eal_params) - + self.pmdout_virtio_user.start_testpmd(cores, command, vdevs=[dev],no_pci=True, prefix="virtio", eal_param=eal_params) self.virtio_user.send_expect('set fwd mac', 'testpmd> ', 120) self.virtio_user.send_expect('start', 'testpmd> ', 120) self.virtio_user.send_expect('show port info all', 'testpmd> ', 30) @@ -233,7 +200,6 @@ class TestVirTioVhostCbdma(TestCase): def diff_param_launch_send_and_verify(self, mode, params, dev, cores, is_quit=True, launch_virtio=True): if launch_virtio: self.launch_testpmd_as_virtio_user(params, cores, dev=dev) - self.send_and_verify(mode) if is_quit: self.virtio_user.send_expect("quit", "# ") @@ -246,7 +212,6 @@ class TestVirTioVhostCbdma(TestCase): """ self.test_target = self.running_case self.expected_throughput = self.get_suite_cfg()['expected_throughput'][self.test_target] - txd_rxd = 1024 dmathr = 1024 eal_tx_rxd = ' --nb-cores=%d --txd=%d --rxd=%d' @@ -261,23 +226,16 @@ class TestVirTioVhostCbdma(TestCase): "non_mergeable_path": 'mrg_rxbuf=0,in_order=0', "vector_rx_path": 'mrg_rxbuf=0,in_order=0', } - - pvp_split_all_path_virtio_params = "--tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=%d --txd=%d " \ - "--rxd=%d" % (queue, txd_rxd, txd_rxd) + pvp_split_all_path_virtio_params = "--tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=%d --txd=%d --rxd=%d" % (queue, txd_rxd, txd_rxd) allow_pci = [self.dut.ports_info[0]['pci']] for index in range(used_cbdma_num): allow_pci.append(self.cbdma_dev_infos[index]) - self.launch_testpmd_as_vhost_user(eal_tx_rxd % (queue, txd_rxd, txd_rxd), self.cores[0:2], - dev=vhost_vdevs % (queue, dmathr), ports=allow_pci) - + self.launch_testpmd_as_vhost_user(eal_tx_rxd % (queue, txd_rxd, txd_rxd), self.cores[0:2], dev=vhost_vdevs % (queue, dmathr), ports=allow_pci) for key, path_mode in dev_path_mode_mapper.items(): if key == "vector_rx_path": - pvp_split_all_path_virtio_params = eal_tx_rxd % ( - queue, txd_rxd, txd_rxd) + pvp_split_all_path_virtio_params = eal_tx_rxd % (queue, txd_rxd, txd_rxd) vdevs = f"'net_virtio_user0,mac={self.virtio_mac},path=/tmp/s0,{path_mode},queues=%d'" % queue - self.diff_param_launch_send_and_verify(key, pvp_split_all_path_virtio_params, vdevs, - self.cores[2:4], is_quit=False, - ) + self.diff_param_launch_send_and_verify(key, pvp_split_all_path_virtio_params, vdevs, self.cores[2:4], is_quit=False) self.mode_list.append(key) # step3 restart vhost port, then check throughput again key += "_RestartVhost" @@ -289,7 +247,6 @@ class TestVirTioVhostCbdma(TestCase): self.diff_param_launch_send_and_verify(key, pvp_split_all_path_virtio_params, vdevs, self.cores[2:4], launch_virtio=False) self.mode_list.append(key) - self.vhost_user.send_expect("quit", "# ") self.result_table_print() self.handle_expected(mode_list=self.mode_list) @@ -302,7 +259,6 @@ class TestVirTioVhostCbdma(TestCase): """ self.test_target = self.running_case self.expected_throughput = self.get_suite_cfg()['expected_throughput'][self.test_target] - used_cbdma_num = 4 queue = 2 txd_rxd = 1024 @@ -312,55 +268,40 @@ class TestVirTioVhostCbdma(TestCase): path_mode = 'mrg_rxbuf=1,in_order=1' self.get_cbdma_ports_info_and_bind_to_dpdk(used_cbdma_num) vhost_dmas = f"dmas=[txq0@{self.used_cbdma[0]};txq1@{self.used_cbdma[1]}],dmathr={dmathr}" - eal_params = " --nb-cores=%d --txd=%d --rxd=%d --txq=%d --rxq=%d " % (nb_cores, txd_rxd, txd_rxd, queue, queue) - dynamic_queue_number_cbdma_virtio_params = f" --tx-offloads=0x0 --enable-hw-vlan-strip {eal_params}" - virtio_dev = f"net_virtio_user0,mac={self.virtio_mac},path={virtio_path},{path_mode},queues={queue},server=1" vhost_dev = f"'net_vhost0,iface={virtio_path},queues={queue},client=1,%s'" - # launch vhost testpmd allow_pci = [self.dut.ports_info[0]['pci']] for index in range(used_cbdma_num): if index < used_cbdma_num / 2: allow_pci.append(self.cbdma_dev_infos[index]) - self.launch_testpmd_as_vhost_user(eal_params, self.cores[0:2], - dev=vhost_dev % vhost_dmas, ports=allow_pci) - # + self.launch_testpmd_as_vhost_user(eal_params, self.cores[0:2], dev=vhost_dev % vhost_dmas, ports=allow_pci) # queue 2 start virtio testpmd, check perforamnce and RX/TX mode = "dynamic_queue2" self.mode_list.append(mode) - self.launch_testpmd_as_virtio_user(dynamic_queue_number_cbdma_virtio_params, - self.cores[2:4], - dev=virtio_dev) + self.launch_testpmd_as_virtio_user(dynamic_queue_number_cbdma_virtio_params, self.cores[2:4], dev=virtio_dev) self.send_and_verify(mode, queue_list=range(queue)) - # On virtio-user side, dynamic change rx/tx queue numbers from 2 queue to 1 queues self.vhost_or_virtio_set_one_queue(self.virtio_user) - self.send_and_verify("virtio_user_" + mode + "_change_to_1", queue_list=[0]) self.mode_list.append("virtio_user_" + mode + "_change_to_1") self.virtio_user.send_expect("stop", "testpmd> ") self.virtio_user.send_expect("quit", "# ") time.sleep(5) self.dut.send_expect(f"rm -rf {virtio_path}", "#") - # queue 2 start virtio testpmd, check perforamnce and RX/TX - self.launch_testpmd_as_virtio_user(dynamic_queue_number_cbdma_virtio_params, - self.cores[2:4], - dev=virtio_dev) + self.launch_testpmd_as_virtio_user(dynamic_queue_number_cbdma_virtio_params, self.cores[2:4], dev=virtio_dev) mode = "Relaunch_dynamic_queue2" self.mode_list.append(mode) self.send_and_verify(mode, queue_list=range(queue)) - # On vhost side, dynamic change rx queue numbers from 2 queue to 1 queues self.vhost_or_virtio_set_one_queue(self.vhost_user) self.send_and_verify("vhost_user" + mode + "_change_to_1") self.mode_list.append("vhost_user" + mode + "_change_to_1") self.vhost_user.send_expect("quit", "# ") time.sleep(2) - # Relaunch vhost with another two cbdma channels mode = "Relaunch_vhost_2_cbdma" self.mode_list.append(mode) @@ -370,14 +311,12 @@ class TestVirTioVhostCbdma(TestCase): for index in range(used_cbdma_num): if index >= used_cbdma_num / 2: allow_pci.append(self.cbdma_dev_infos[index]) - self.launch_testpmd_as_vhost_user(eal_params, self.cores[0:2], - dev=vhost_dev % vhost_dmas, ports=allow_pci) + self.launch_testpmd_as_vhost_user(eal_params, self.cores[0:2], dev=vhost_dev % vhost_dmas, ports=allow_pci) self.virtio_user.send_expect("clear port stats all", "testpmd> ", 30) self.send_and_verify(mode, queue_list=range(queue)) self.check_port_stats_result(self.virtio_user) self.virtio_user.send_expect("quit", "# ") self.vhost_user.send_expect("quit", "# ") - self.result_table_print() # result_rows = [[], [64, 'dynamic_queue2', 7.4959375, 12.593175], [1518, 'dynamic_queue2', 1.91900225, 59.028509209999996]] result_rows = self.result_table_getrows() # @@ -452,42 +391,31 @@ class TestVirTioVhostCbdma(TestCase): self.throughput[mode] = dict() for frame_size in self.frame_sizes: self.throughput[mode][frame_size] = dict() - payload_size = frame_size - self.headers_size tgenInput = [] port = self.tester.get_local_port(self.dut_ports[0]) - fields_config = {'ip': {'src': {'action': 'random'},},} if not multiple_queue: fields_config = None - pkt1 = Packet() pkt1.assign_layers(['ether', 'ipv4', 'raw']) pkt1.config_layers([('ether', {'dst': '%s' % self.virtio_mac}), ('ipv4', {'src': '1.1.1.1'}), ('raw', {'payload': ['01'] * int('%d' % payload_size)})]) - pkt1.save_pcapfile(self.tester, "%s/multiqueuerandomip_%s.pcap" % (self.out_path, frame_size)) tgenInput.append((port, port, "%s/multiqueuerandomip_%s.pcap" % (self.out_path, frame_size))) - self.tester.pktgen.clear_streams() streams = self.pktgen_helper.prepare_stream_from_tginput(tgenInput, 100, fields_config, self.tester.pktgen) trans_options = {'delay': 5, 'duration': 20} _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams, options=trans_options) - Mpps = pps / 1000000.0 - self.verify(Mpps > 0, - "%s can not receive packets of frame size %d" % (self.running_case, frame_size)) - throughput = Mpps * 100 / \ - float(self.wirespeed(self.nic, frame_size, 1)) - + self.verify(Mpps > 0, "%s can not receive packets of frame size %d" % (self.running_case, frame_size)) + throughput = Mpps * 100 / float(self.wirespeed(self.nic, frame_size, 1)) self.throughput[mode][frame_size][self.nb_desc] = Mpps - results_row = [frame_size] results_row.append(mode) results_row.append(Mpps) results_row.append(throughput) self.result_table_add(results_row) - if queue_list: # check RX/TX can work normally in each queues self.check_packets_of_each_queue(queue_list=queue_list) @@ -519,7 +447,6 @@ class TestVirTioVhostCbdma(TestCase): header.append("nb_desc") header.append("Expected Throughput") header.append("Throughput Difference") - for mode in mode_list: self.test_result[mode] = dict() for frame_size in self.test_parameters.keys(): @@ -551,7 +478,6 @@ class TestVirTioVhostCbdma(TestCase): table_row.append( self.test_result[mode][frame_size][nb_desc][header[i]]) self.result_table_add(table_row) - # present test results to screen self.result_table_print() # save test results as a file @@ -567,7 +493,6 @@ class TestVirTioVhostCbdma(TestCase): case_name = self.running_case self.json_obj[case_name] = list() status_result = [] - for mode in mode_list: for frame_size in self.test_parameters.keys(): for nb_desc in self.test_parameters[frame_size]: @@ -597,10 +522,7 @@ class TestVirTioVhostCbdma(TestCase): row_dict0['parameters'].append(row_dict3) self.json_obj[case_name].append(row_dict0) status_result.append(row_dict0['status']) - - with open(os.path.join(rst.path2Result, - '{0:s}_{1}.json'.format( - self.nic, self.suite_name)), 'w') as fp: + with open(os.path.join(rst.path2Result, '{0:s}_{1}.json'.format(self.nic, self.suite_name)), 'w') as fp: json.dump(self.json_obj, fp) self.verify("FAIL" not in status_result, "Exceeded Gap") @@ -611,14 +533,11 @@ class TestVirTioVhostCbdma(TestCase): """ self.dut.send_expect("killall -I %s" % self.testpmd_name, '#', 20) self.bind_cbdma_device_to_kernel() - self.bind_nic_driver(self.dut_ports) def tear_down_all(self): """ Run after each test suite. """ - - self.bind_nic_driver(self.dut_ports, self.drivername) self.dut.close_session(self.vhost_user) self.dut.close_session(self.virtio_user) self.dut.close_session(self.virtio_user1) From patchwork Fri Mar 19 06:46:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 89532 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DC4DEA0562; Fri, 19 Mar 2021 07:47:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D39D4140E9D; Fri, 19 Mar 2021 07:47:38 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 231774003F for ; Fri, 19 Mar 2021 07:47:36 +0100 (CET) IronPort-SDR: VA1f+2tgKjFg/6U1dJkIa11XjsIGAdDfiJQyaRERMdKPvylI58hw4pLoluSRDlGD3xKwy149rh r9rPjCPMryEA== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="176971900" X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="176971900" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:35 -0700 IronPort-SDR: DkrrbvYDfckCOZQ8NLPe9gqvnAJukrF2dgtiV49Pjx6JmtZ6EDo4ggWSVSZ6JC1H51iPHl4mkZ uvUL8FIHVkxA== X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="606504704" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:34 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Fri, 19 Mar 2021 14:46:33 +0800 Message-Id: <20210319064633.4592-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1 4/9] tests/vhost_user_interrupt:modify hard code bind cbdma device to igb_uio by drivername in execution.cfg X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" 1.Modify hard code bind cbdma device to igb_uio by drivername in execution.cfg. 2.Move bind cbdma to kernel from tear_down_all to tear_down. Signed-off-by: Ling Wei --- tests/TestSuite_vhost_user_interrupt.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_vhost_user_interrupt.py b/tests/TestSuite_vhost_user_interrupt.py index 2a101991..53f407fa 100644 --- a/tests/TestSuite_vhost_user_interrupt.py +++ b/tests/TestSuite_vhost_user_interrupt.py @@ -114,6 +114,9 @@ class TestVhostUserInterrupt(TestCase): """ get all cbdma ports """ + # check driver name in execution.cfg + self.verify(self.drivername == 'igb_uio', + "CBDMA test case only use igb_uio driver, need config drivername=igb_uio in execution.cfg") 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') @@ -139,9 +142,7 @@ class TestVhostUserInterrupt(TestCase): dmas_info += dmas self.dmas_info = dmas_info[:-1] self.device_str = ' '.join(used_cbdma) - self.dut.setup_modules(self.target, "igb_uio","None") - self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s %s' % - ("igb_uio", self.device_str, self.pci_info), '# ', 60) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s' % (self.drivername, self.device_str), '# ', 60) def bind_cbdma_device_to_kernel(self): if self.device_str is not None: @@ -285,13 +286,12 @@ class TestVhostUserInterrupt(TestCase): self.dut.send_expect("killall %s" % self.l3fwdpower_name, "#") self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#") self.dut.kill_all() + self.bind_cbdma_device_to_kernel() def tear_down_all(self): """ Run after each test suite. """ # revert the code - self.bind_cbdma_device_to_kernel() self.dut.send_expect("mv ./main.c ./examples/l3fwd-power/", "#") self.dut.build_dpdk_apps('examples/l3fwd-power') - pass From patchwork Fri Mar 19 06:46:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 89533 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E67EA0562; Fri, 19 Mar 2021 07:47:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 08F9640143; Fri, 19 Mar 2021 07:47:47 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 0B9344003F for ; Fri, 19 Mar 2021 07:47:44 +0100 (CET) IronPort-SDR: IC0r/YPHkphEnysakM5nGX1JlNp5jIwSPJaDqGIm12Uhe7p//xTPgl6Yb8lMhALFnjQanOjpyK KSOhGxAXY9xQ== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="169766485" X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="169766485" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:44 -0700 IronPort-SDR: 8BGRdrwHpMG/rzSdw2gBWhfTzLG8RMjoIFmLSznSrJ51gGO2BWIqTMPCfksg14pL+dbq1d3Pqa b/Nksr3yBcVg== X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="606504736" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:42 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Fri, 19 Mar 2021 14:46:41 +0800 Message-Id: <20210319064641.4652-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1 5/9] tests/vhost_virtio_pmd_interrupt:modify hard code bind cbdma device to igb_uio by drivername in execution.cfg X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" 1.Modify hard code bind cbdma device to igb_uio by drivername in execution.cfg. 2.Adjust code format. Signed-off-by: Ling Wei --- tests/TestSuite_vhost_virtio_pmd_interrupt.py | 38 +++++++------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/tests/TestSuite_vhost_virtio_pmd_interrupt.py b/tests/TestSuite_vhost_virtio_pmd_interrupt.py index af5e5eb6..57bcf6c7 100644 --- a/tests/TestSuite_vhost_virtio_pmd_interrupt.py +++ b/tests/TestSuite_vhost_virtio_pmd_interrupt.py @@ -56,14 +56,11 @@ class TestVhostVirtioPmdInterrupt(TestCase): self.dut_ports = self.dut.get_ports() self.verify(len(self.dut_ports) >= 1, "Insufficient ports for testing") self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) - self.cores_num = len([n for n in self.dut.cores if int(n['socket']) == - self.ports_socket]) + self.cores_num = len([n for n in self.dut.cores if int(n['socket']) == self.ports_socket]) self.pci_info = self.dut.ports_info[0]['pci'] self.tx_port = self.tester.get_local_port(self.dut_ports[0]) self.dst_mac = self.dut.get_mac_address(self.dut_ports[0]) - self.logger.info("Please comfirm the kernel of vm greater than 4.8.0 " - "and enable vfio-noiommu in kernel") - + self.logger.info("Please comfirm the kernel of vm greater than 4.8.0 and enable vfio-noiommu in kernel") self.out_path = '/tmp' out = self.tester.send_expect('ls -d %s' % self.out_path, '# ') if 'No such file or directory' in out: @@ -94,24 +91,19 @@ class TestVhostVirtioPmdInterrupt(TestCase): get core list about testpmd """ core_config = "1S/%dC/1T" % (self.nb_cores + 1) - self.verify(self.cores_num >= (self.nb_cores + 1), - "There has not enough cores to running case: %s" % - self.running_case) - self.core_list = self.dut.get_core_list('all', - socket=self.ports_socket) + self.verify(self.cores_num >= (self.nb_cores + 1), "There has not enough cores to running case: %s" %self.running_case) + self.core_list = self.dut.get_core_list('all', socket=self.ports_socket) def prepare_vm_env(self): """ rebuild l3fwd-power in vm and set the virtio-net driver """ self.vm_dut.send_expect("cp ./examples/l3fwd-power/main.c /tmp/", "#") - self.vm_dut.send_expect( - "sed -i '/DEV_RX_OFFLOAD_CHECKSUM/d' ./examples/l3fwd-power/main.c", "#", 10) + self.vm_dut.send_expect("sed -i '/DEV_RX_OFFLOAD_CHECKSUM/d' ./examples/l3fwd-power/main.c", "#", 10) self.vm_dut.send_expect( "sed -i 's/.mq_mode = ETH_MQ_RX_RSS,/.mq_mode = ETH_MQ_RX_NONE,/g' ./examples/l3fwd-power/main.c", "#", 10) out = self.vm_dut.build_dpdk_apps('examples/l3fwd-power') self.verify("Error" not in out, "compilation l3fwd-power error") - self.vm_dut.send_expect("modprobe vfio enable_unsafe_noiommu_mode=1", "#") self.vm_dut.send_expect("modprobe vfio-pci", "#") self.vm_dut.ports_info[0]['port'].bind_driver('vfio-pci') @@ -140,8 +132,7 @@ class TestVhostVirtioPmdInterrupt(TestCase): """ launch l3fwd-power with a virtual vhost device """ - self.verify(len(self.vm_dut.cores) >= self.nb_cores, - "The vm done not has enought cores to use, please config it") + self.verify(len(self.vm_dut.cores) >= self.nb_cores, "The vm done not has enought cores to use, please config it") core_config = "1S/%dC/1T" % self.nb_cores core_list_l3fwd = self.vm_dut.get_core_list(core_config) core_mask_l3fwd = utils.create_mask(core_list_l3fwd) @@ -215,8 +206,7 @@ class TestVhostVirtioPmdInterrupt(TestCase): for i in range(len(self.verify_info)): if status == "waked up": info = "lcore %s is waked up from rx interrupt on port %d queue %d" - info = info % (self.verify_info[i]["core"], self.verify_info[i]['port'], - self.verify_info[i]['queue']) + info = info % (self.verify_info[i]["core"], self.verify_info[i]['port'], self.verify_info[i]['queue']) elif status == "sleeps": info = "lcore %s sleeps until interrupt triggers" % self.verify_info[i]["core"] if info in out_result: @@ -227,8 +217,7 @@ class TestVhostVirtioPmdInterrupt(TestCase): if fix_ip is True: self.verify(change == 1, "There has other cores change the status") else: - self.verify(change == self.queues, - "There has cores not change the status") + self.verify(change == self.queues, "There has cores not change the status") def set_fields(self): """ @@ -280,7 +269,9 @@ class TestVhostVirtioPmdInterrupt(TestCase): """ get all cbdma ports """ - self.dut.setup_modules(self.target, "igb_uio","None") + # check driver name in execution.cfg + self.verify(self.drivername == 'igb_uio', + "CBDMA test case only use igb_uio driver, need config drivername=igb_uio in execution.cfg") out = self.dut.send_expect('./usertools/dpdk-devbind.py --status-dev misc', '# ', 30) cbdma_dev_infos = re.findall('\s*(0000:\d+:\d+.\d+)', out) self.verify(len(cbdma_dev_infos) >= cbdma_num, 'There no enough cbdma device to run this suite') @@ -292,10 +283,8 @@ class TestVhostVirtioPmdInterrupt(TestCase): dmas = 'txq{}@{};'.format(number, dmas) dmas_info += dmas self.dmas_info = dmas_info[:-1] - self.device_str = ' '.join(used_cbdma) - self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s %s' % - ("igb_uio", self.device_str, self.pci_info), '# ', 60) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s' % (self.drivername, self.device_str), '# ', 60) def bind_cbdma_device_to_kernel(self): if self.device_str is not None: @@ -318,7 +307,6 @@ class TestVhostVirtioPmdInterrupt(TestCase): self.vhost_user.send_expect("quit", "#", 10) self.dut.close_session(self.vhost_user) - def test_perf_virtio_pmd_interrupt_with_4queues(self): """ wake up virtio_user 0.95 core with l3fwd-power sample @@ -400,9 +388,9 @@ class TestVhostVirtioPmdInterrupt(TestCase): Run after each test case. """ self.stop_all_apps() - self.bind_cbdma_device_to_kernel() self.dut.kill_all() self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") + self.bind_cbdma_device_to_kernel() def tear_down_all(self): """ From patchwork Fri Mar 19 06:46:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 89534 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3E1FAA0562; Fri, 19 Mar 2021 07:47:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 358BB406B4; Fri, 19 Mar 2021 07:47:55 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id D4C924003F for ; Fri, 19 Mar 2021 07:47:52 +0100 (CET) IronPort-SDR: 4mnU11GC01QqxbVpIQtP61woQp3Ac2tghSR9HTjq7Kk9oi0X2iA7ELToWlalCff9zMBK/m0KMr mdPylXWtbSOw== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="209859755" X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="209859755" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:52 -0700 IronPort-SDR: S0eboeA+ERnKJcWc172c3rfowZZs2BQVSFhQQp4ATGNF+rU5PdhMYnFy2B0PF847RpEbHcZGzn xH5rUW/v18tA== X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="606504783" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:50 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Fri, 19 Mar 2021 14:46:50 +0800 Message-Id: <20210319064650.4712-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1 6/9] tests/vhost_virtio_user_interrupt:modify hard code bind cbdma device to igb_uio by drivername in execution.cfg X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" 1.Modify hard code bind cbdma device to igb_uio by drivername in execution.cfg. 2.Adjust code format. Signed-off-by: Ling Wei --- tests/TestSuite_vhost_virtio_user_interrupt.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/TestSuite_vhost_virtio_user_interrupt.py b/tests/TestSuite_vhost_virtio_user_interrupt.py index 29693f43..04c86769 100644 --- a/tests/TestSuite_vhost_virtio_user_interrupt.py +++ b/tests/TestSuite_vhost_virtio_user_interrupt.py @@ -62,7 +62,6 @@ class TestVirtioUserInterrupt(TestCase): self.cbdma_dev_infos = [] self.dmas_info = None self.device_str = None - self.prepare_l3fwd_power() self.tx_port = self.tester.get_local_port(self.dut_ports[0]) self.tx_interface = self.tester.get_interface(self.tx_port) @@ -78,7 +77,6 @@ class TestVirtioUserInterrupt(TestCase): self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#") self.dut.send_expect("killall %s" % self.l3fwdpower_name, "#") self.dut.send_expect("rm -rf vhost-net*", "#") - self.l3fwd = self.dut.new_session(suite="l3fwd") self.vhost = self.dut.new_session(suite="vhost") self.virtio = self.dut.new_session(suite="virito") @@ -145,7 +143,6 @@ class TestVirtioUserInterrupt(TestCase): else: eal_params = self.dut.create_eal_parameters(cores=self.core_list_vhost, prefix='vhost', no_pci=True, vdevs=vdev) cmd_vhost_user = testcmd + eal_params + para - self.vhost.send_expect(cmd_vhost_user, "testpmd>", 30) self.vhost.send_expect("set fwd mac", "testpmd>", 30) self.vhost.send_expect("start", "testpmd>", 30) @@ -186,6 +183,9 @@ class TestVirtioUserInterrupt(TestCase): """ get all cbdma ports """ + # check driver name in execution.cfg + self.verify(self.drivername == 'igb_uio', + "CBDMA test case only use igb_uio driver, need config drivername=igb_uio in execution.cfg") 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') @@ -211,9 +211,7 @@ class TestVirtioUserInterrupt(TestCase): dmas_info += dmas self.dmas_info = dmas_info[:-1] self.device_str = ' '.join(self.used_cbdma) - self.dut.setup_modules(self.target, "igb_uio", "None") - self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s %s' % - ("igb_uio", self.device_str, self.pci_info), '# ', 60) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s' % (self.drivername, self.device_str), '# ', 60) def bind_cbdma_device_to_kernel(self): if self.device_str is not None: @@ -309,7 +307,6 @@ class TestVirtioUserInterrupt(TestCase): self.start_vhost_testpmd(pci="--no-pci") self.start_virtio_user(packed=True) self.check_virtio_side_link_status("up") - self.vhost.send_expect("quit", "#", 20) self.check_virtio_side_link_status("down") @@ -321,7 +318,6 @@ class TestVirtioUserInterrupt(TestCase): self.start_vhost_testpmd(pci=self.used_cbdma, dmas=self.dmas_info) self.start_virtio_user() self.check_virtio_side_link_status("up") - self.vhost.send_expect("quit", "#", 20) self.check_virtio_side_link_status("down") self.dut.send_expect("killall %s" % self.l3fwdpower_name, "#") From patchwork Fri Mar 19 06:46:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 89535 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 62E10A0562; Fri, 19 Mar 2021 07:48:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D6E74067C; Fri, 19 Mar 2021 07:48:02 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 52E754003F for ; Fri, 19 Mar 2021 07:48:01 +0100 (CET) IronPort-SDR: 7a5tBsrykk7SuwiUXCOV4X4JypJyNMB2GdJ7HnEZrA8K+Nc9z+G2O896O1WvQx1VwL74PRMS+Q I91icFPAMYXA== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="251191917" X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="251191917" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:48:00 -0700 IronPort-SDR: CD+jFa/4DuSIhHBCnHk/IRadKTUhm9/1cUuSlV9SeLXuN2VXAjmcC69s3qgZgkUT0uOaA4spK4 mwWpO2Ap21CA== X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="606504805" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:47:58 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Fri, 19 Mar 2021 14:46:58 +0800 Message-Id: <20210319064658.4774-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1 7/9] tests/virtio_event_idx_interrupt:modify hard code bind cbdma device to igb_uio by drivername in execution.cfg X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" 1.Modify hard code bind cbdma device to igb_uio by drivername in execution.cfg. 2.Adjust code format. Signed-off-by: Ling Wei --- tests/TestSuite_virtio_event_idx_interrupt.py | 32 ++++++------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/tests/TestSuite_virtio_event_idx_interrupt.py b/tests/TestSuite_virtio_event_idx_interrupt.py index f92298e2..b4c9de15 100644 --- a/tests/TestSuite_virtio_event_idx_interrupt.py +++ b/tests/TestSuite_virtio_event_idx_interrupt.py @@ -55,12 +55,10 @@ class TestVirtioIdxInterrupt(TestCase): self.dut_ports = self.dut.get_ports() self.verify(len(self.dut_ports) >= 1, "Insufficient ports for testing") self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) - self.cores_num = len([n for n in self.dut.cores if int(n['socket']) - == self.ports_socket]) + self.cores_num = len([n for n in self.dut.cores if int(n['socket'])== self.ports_socket]) self.dst_mac = self.dut.get_mac_address(self.dut_ports[0]) self.base_dir = self.dut.base_dir.replace('~', '/root') self.pf_pci = self.dut.ports_info[0]['pci'] - self.out_path = '/tmp' out = self.tester.send_expect('ls -d %s' % self.out_path, '# ') if 'No such file or directory' in out: @@ -84,20 +82,19 @@ class TestVirtioIdxInterrupt(TestCase): def get_core_mask(self): self.core_config = "1S/%dC/1T" % (self.nb_cores + 1) - self.verify(self.cores_num >= (self.nb_cores + 1), - "There has not enough cores to test this case %s" % - self.running_case) + self.verify(self.cores_num >= (self.nb_cores + 1),"There has not enough cores to test this case %s" %self.running_case) self.core_list = self.dut.get_core_list(self.core_config) def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num): """ get all cbdma ports """ - self.dut.setup_modules(self.target, "igb_uio","None") + # check driver name in execution.cfg + self.verify(self.drivername == 'igb_uio', + "CBDMA test case only use igb_uio driver, need config drivername=igb_uio in execution.cfg") out = self.dut.send_expect('./usertools/dpdk-devbind.py --status-dev misc', '# ', 30) cbdma_dev_infos = re.findall('\s*(0000:\d+:\d+.\d+)', out) self.verify(len(cbdma_dev_infos) >= cbdma_num, 'There no enough cbdma device to run this suite') - used_cbdma = cbdma_dev_infos[0:cbdma_num] dmas_info = '' for dmas in used_cbdma: @@ -106,8 +103,7 @@ class TestVirtioIdxInterrupt(TestCase): dmas_info += dmas self.dmas_info = dmas_info[:-1] self.device_str = ' '.join(used_cbdma) - self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s %s' % - ("igb_uio", self.device_str, self.pf_pci), '# ', 60) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s' % (self.drivername, self.device_str), '# ', 60) def bind_cbdma_device_to_kernel(self): if self.device_str is not None: @@ -177,8 +173,7 @@ class TestVirtioIdxInterrupt(TestCase): self.verify(self.vm_intf not in out, "the virtio-pci down failed") self.vm_dut.send_expect("ifconfig %s up" % self.vm_intf, "#") if self.queues > 1: - self.vm_dut.send_expect("ethtool -L %s combined %d" % - (self.vm_intf, self.queues), "#", 20) + self.vm_dut.send_expect("ethtool -L %s combined %d" %(self.vm_intf, self.queues), "#", 20) def start_to_send_packets(self, delay): """ @@ -189,7 +184,6 @@ class TestVirtioIdxInterrupt(TestCase): self.tester.scapy_append('a=[Ether(dst="%s")/IP(src="0.240.74.101",proto=255)/UDP()/("X"*18)]' % (self.dst_mac)) self.tester.scapy_append('wrpcap("%s/interrupt.pcap", a)' % self.out_path) self.tester.scapy_execute() - tgen_input.append((port, port, "%s/interrupt.pcap" % self.out_path)) self.tester.pktgen.clear_streams() fields_config = {'ip': {'dst': {'action': 'random'}, }, } @@ -210,26 +204,21 @@ class TestVirtioIdxInterrupt(TestCase): # reload virtio device to check the virtio-net can receive packets for i in range(reload_times+1): if time.time() - start_time > reload_times*30: - self.logger.error("The ixia has stop to send packets, " - "please change the delay time of ixia") + self.logger.error("The ixia has stop to send packets, please change the delay time of ixia") self.logger.info("The virtio device has reload %d times" % i) return False self.logger.info("The virtio net device reload %d times" % i) - self.vm_dut.send_expect("tcpdump -n -vv -i %s" % self.vm_intf, - "tcpdump", 30) + self.vm_dut.send_expect("tcpdump -n -vv -i %s" % self.vm_intf, "tcpdump", 30) time.sleep(5) out = self.vm_dut.get_session_output(timeout=3) self.vm_dut.send_expect("^c", "#", 30) - self.verify("ip-proto-255" in out, - "The virtio device can not receive packets" - "after reload %d times" % i) + self.verify("ip-proto-255" in out, "The virtio device can not receive packets after reload %d times" % i) time.sleep(2) # reload virtio device self.vm_dut.restore_interfaces() time.sleep(3) self.vm_dut.send_expect("ifconfig %s down" % self.vm_intf, "#") self.vm_dut.send_expect("ifconfig %s up" % self.vm_intf, "#") - # wait ixia thread exit self.logger.info("wait the thread of ixia to exit") while(1): @@ -257,7 +246,6 @@ class TestVirtioIdxInterrupt(TestCase): queue_index + \ "rx-packets:%d, tx-packets:%d" % (rx_packets, tx_packets)) - self.vhost.send_expect("clear port stats all", "testpmd> ", 60) def stop_all_apps(self): From patchwork Fri Mar 19 06:47:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 89536 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9343BA0562; Fri, 19 Mar 2021 07:48:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87CEB140EA6; Fri, 19 Mar 2021 07:48:11 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 0C0604003F for ; Fri, 19 Mar 2021 07:48:09 +0100 (CET) IronPort-SDR: 4D97KESZC/Z42LqMjxVB2NniuQQgsc53YOrkm1F9LoBhxnIIkPMBGQjkKL/4gg1IrrERfRq3GI +If1q23ifcfA== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="189878348" X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="189878348" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:48:08 -0700 IronPort-SDR: NJwoXe4pvytVprPIgCooaIxmfvZK5DYsL+uXesxdJwVVsP5q0fHZsvH3DLt5LjMXxRgVCS05vA cbmdr+R23OLw== X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="606504833" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:48:06 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Fri, 19 Mar 2021 14:47:05 +0800 Message-Id: <20210319064705.4834-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1 8/9] tests/vm2vm_virtio_net_perf:modify hard code bind cbdma device to igb_uio by drivername in execution.cfg X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" 1.Modify hard code bind cbdma device to igb_uio by drivername in execution.cfg. 2.Adjust code format. 3.Use the same socket of dut's nic to start testpmd. Signed-off-by: Ling Wei --- tests/TestSuite_vm2vm_virtio_net_perf.py | 79 ++++++++++++++---------- 1 file changed, 47 insertions(+), 32 deletions(-) diff --git a/tests/TestSuite_vm2vm_virtio_net_perf.py b/tests/TestSuite_vm2vm_virtio_net_perf.py index 89dad610..83035b07 100644 --- a/tests/TestSuite_vm2vm_virtio_net_perf.py +++ b/tests/TestSuite_vm2vm_virtio_net_perf.py @@ -49,8 +49,10 @@ from pmd_output import PmdOutput class TestVM2VMVirtioNetPerf(TestCase): def set_up_all(self): + self.dut_ports = self.dut.get_ports() + self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) core_config = "1S/5C/1T" - self.cores_list = self.dut.get_core_list(core_config, socket=0) + self.cores_list = self.dut.get_core_list(core_config, socket=self.ports_socket) self.verify(len(self.cores_list) >= 4, "There has not enough cores to test this suite %s" % self.suite_name) @@ -86,6 +88,9 @@ class TestVM2VMVirtioNetPerf(TestCase): """ get all cbdma ports """ + # check driver name in execution.cfg + self.verify(self.drivername == 'igb_uio', + "CBDMA test case only use igb_uio driver, need config drivername=igb_uio in execution.cfg") 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') @@ -117,8 +122,7 @@ class TestVM2VMVirtioNetPerf(TestCase): dmas_info += dmas self.dmas_info = dmas_info[:-1] self.device_str = ' '.join(used_cbdma) - 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) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s' % (self.drivername, self.device_str), '# ', 60) def bind_cbdma_device_to_kernel(self): if self.device_str is not None: @@ -155,6 +159,7 @@ class TestVM2VMVirtioNetPerf(TestCase): params = " -- -i --nb-cores=%d --txd=1024 --rxd=1024 --rxq=%d --txq=%d" % (nb_cores, used_queues, used_queues) self.command_line = testcmd + eal_params + vdev1 + vdev2 + params self.pmd_vhost.execute_cmd(self.command_line, timeout=30) + self.pmd_vhost.execute_cmd('vhost enable tx all', timeout=30) self.pmd_vhost.execute_cmd('start', timeout=30) def start_vms(self, path_mode, server_mode=False, opt_queue=1): @@ -217,11 +222,13 @@ class TestVM2VMVirtioNetPerf(TestCase): self.vm_dut[0].send_expect("arp -s %s %s" % (self.virtio_ip2, self.virtio_mac2), "#", 10) self.vm_dut[1].send_expect("arp -s %s %s" % (self.virtio_ip1, self.virtio_mac1), "#", 10) - def prepare_test_env(self, path_mode, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, server_mode=False, opt_queue=1, combined=False, used_queues=1): + def prepare_test_env(self, path_mode, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, + server_mode=False, opt_queue=1, combined=False, used_queues=1): """ start vhost testpmd and qemu, and config the vm env """ - self.start_vhost_testpmd(cbdma=cbdma, no_pci=no_pci, client_mode=client_mode, enable_queues=enable_queues, nb_cores=nb_cores, used_queues=used_queues) + self.start_vhost_testpmd(cbdma=cbdma, no_pci=no_pci, client_mode=client_mode, enable_queues=enable_queues, + nb_cores=nb_cores, used_queues=used_queues) self.start_vms(path_mode=path_mode, server_mode=server_mode, opt_queue=opt_queue) self.config_vm_env(combined=combined, used_queues=used_queues) @@ -232,12 +239,13 @@ class TestVM2VMVirtioNetPerf(TestCase): # clear the port xstats before iperf self.vhost.send_expect("clear port xstats all", "testpmd> ", 10) + # add -f g param, use Gbits/sec report teste result if iperf_mode == "tso": - iperf_server = "iperf -s -i 1" - iperf_client = "iperf -c 1.1.1.2 -i 1 -t 60" + iperf_server = "iperf -f g -s -i 1" + iperf_client = "iperf -f g -c 1.1.1.2 -i 1 -t 60" else: - iperf_server = "iperf -s -u -i 1" - iperf_client = "iperf -c 1.1.1.2 -i 1 -t 30 -P 4 -u -b 1G -l 9000" + iperf_server = "iperf -f g -s -u -i 1" + iperf_client = "iperf -f g -c 1.1.1.2 -i 1 -t 30 -P 4 -u -b 1G -l 9000" self.vm_dut[0].send_expect("%s > iperf_server.log &" % iperf_server, "", 10) self.vm_dut[1].send_expect("%s > iperf_client.log &" % iperf_client, "", 60) time.sleep(90) @@ -349,7 +357,8 @@ class TestVM2VMVirtioNetPerf(TestCase): """ TestCase1: VM2VM split ring vhost-user/virtio-net test with tcp traffic """ - self.prepare_test_env(path_mode=1, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, server_mode=False, opt_queue=1, combined=False, used_queues=1) + self.prepare_test_env(path_mode=1, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, + server_mode=False, opt_queue=1, combined=False, used_queues=1) self.start_iperf_and_verify_vhost_xstats_info(iperf_mode='tso') def test_vm2vm_split_ring_with_tso_and_cbdma_enable(self): @@ -357,7 +366,8 @@ class TestVM2VMVirtioNetPerf(TestCase): TestCase2: VM2VM split ring vhost-user/virtio-net CBDMA enable test with tcp traffic """ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2) - self.prepare_test_env(path_mode=1, cbdma=True, no_pci=False, client_mode=False, enable_queues=1, nb_cores=2, server_mode=False, opt_queue=1, combined=False, used_queues=1) + self.prepare_test_env(path_mode=1, cbdma=True, no_pci=False, client_mode=False, enable_queues=1, nb_cores=2, + server_mode=False, opt_queue=1, combined=False, used_queues=1) cbdma_value = self.start_iperf_and_verify_vhost_xstats_info(iperf_mode='tso') expect_value = self.get_suite_cfg()['expected_throughput'][self.running_case] self.verify(cbdma_value > expect_value, "CBDMA enable performance: %s is lower than CBDMA disable: %s." %(cbdma_value, expect_value)) @@ -366,21 +376,24 @@ class TestVM2VMVirtioNetPerf(TestCase): """ TestCase7: VM2VM packed ring vhost-user/virtio-net test with tcp traffic """ - self.prepare_test_env(path_mode=4, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, server_mode=False, opt_queue=1, combined=False, used_queues=1) + self.prepare_test_env(path_mode=4, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, + server_mode=False, opt_queue=1, combined=False, used_queues=1) self.start_iperf_and_verify_vhost_xstats_info() def test_vm2vm_split_ring_iperf_with_ufo(self): """ TestCase3: VM2VM split ring vhost-user/virtio-net test with udp traffic """ - self.prepare_test_env(path_mode=2, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=1, server_mode=False, opt_queue=1, combined=False, used_queues=1) + self.prepare_test_env(path_mode=2, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=1, + server_mode=False, opt_queue=1, combined=False, used_queues=1) self.start_iperf_and_verify_vhost_xstats_info(iperf_mode='ufo') def test_vm2vm_packed_ring_iperf_with_ufo(self): """ TestCase8: VM2VM packed ring vhost-user/virtio-net test with udp traffic """ - self.prepare_test_env(path_mode=4, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, server_mode=False, opt_queue=1, combined=False, used_queues=1) + self.prepare_test_env(path_mode=4, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, + server_mode=False, opt_queue=1, combined=False, used_queues=1) self.start_iperf_and_verify_vhost_xstats_info(iperf_mode='other') def test_vm2vm_split_ring_device_capbility(self): @@ -410,27 +423,28 @@ class TestVM2VMVirtioNetPerf(TestCase): self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, allow_diff_socket=True) self.logger.info("Launch vhost-testpmd with CBDMA and used 8 queue") - self.prepare_test_env(path_mode=5, cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, server_mode=True, opt_queue=8, combined=True, used_queues=8) - self.check_scp_file_valid_between_vms(file_size=1024) + self.prepare_test_env(path_mode=5, cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, + server_mode=True, opt_queue=8, combined=True, used_queues=8) + self.check_scp_file_valid_between_vms(file_size=1) iperf_data_cbdma_enable_8_queue = self.start_iperf_and_verify_vhost_xstats_info(iperf_mode='tso') - ipef_result.append(['Eabled', 'mergeable path', 8, iperf_data_cbdma_enable_8_queue]) + ipef_result.append(['Enable', 'mergeable path', 8, iperf_data_cbdma_enable_8_queue]) self.logger.info("Re-launch without CBDMA and used 8 queue") self.vhost.send_expect("quit", "# ", 30) self.start_vhost_testpmd(cbdma=False, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, used_queues=8) - self.check_scp_file_valid_between_vms(file_size=1024) + self.check_scp_file_valid_between_vms(file_size=1) iperf_data_cbdma_disable_8_queue = self.start_iperf_and_verify_vhost_xstats_info(iperf_mode='tso') - ipef_result.append(['Disabled','mergeable path', 8, iperf_data_cbdma_disable_8_queue]) + ipef_result.append(['Disable','mergeable path', 8, iperf_data_cbdma_disable_8_queue]) self.logger.info("Re-launch without CBDMA and used 1 queue") self.vhost.send_expect("quit", "# ", 30) self.start_vhost_testpmd(cbdma=False, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, used_queues=1) self.config_vm_env(combined=True, used_queues=1) - self.check_scp_file_valid_between_vms(file_size=1024) + self.check_scp_file_valid_between_vms(file_size=1) iperf_data_cbdma_disable_1_queue = self.start_iperf_and_verify_vhost_xstats_info(iperf_mode='tso') - ipef_result.append(['Disabled', 'mergeable path', 1, iperf_data_cbdma_disable_1_queue]) + ipef_result.append(['Disable', 'mergeable path', 1, iperf_data_cbdma_disable_1_queue]) - self.table_header = ['CBDMA Enable/Disable', 'Mode', 'rxq/txq', '[M|G]bits/sec'] + self.table_header = ['CBDMA Enable/Disable', 'Mode', 'rxq/txq', 'Gbits/sec'] self.result_table_create(self.table_header) for table_row in ipef_result: self.result_table_add(table_row) @@ -448,17 +462,18 @@ class TestVM2VMVirtioNetPerf(TestCase): self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, allow_diff_socket=True) self.logger.info("Launch vhost-testpmd with CBDMA and used 8 queue") - self.prepare_test_env(path_mode=6, cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, server_mode=True, opt_queue=8, combined=True, used_queues=8) + self.prepare_test_env(path_mode=6, cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, + server_mode=True, opt_queue=8, combined=True, used_queues=8) self.check_scp_file_valid_between_vms(file_size=1024) iperf_data_cbdma_enable_8_queue = self.start_iperf_and_verify_vhost_xstats_info(iperf_mode='tso') - ipef_result.append(['Eabled', 'no-mergeable path', 8, iperf_data_cbdma_enable_8_queue]) + ipef_result.append(['Enable', 'no-mergeable path', 8, iperf_data_cbdma_enable_8_queue]) self.logger.info("Re-launch without CBDMA and used 8 queue") self.vhost.send_expect("quit", "# ", 30) self.start_vhost_testpmd(cbdma=False, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, used_queues=8) self.check_scp_file_valid_between_vms(file_size=1024) iperf_data_cbdma_disable_8_queue = self.start_iperf_and_verify_vhost_xstats_info(iperf_mode='tso') - ipef_result.append(['Disabled','no-mergeable path', 8, iperf_data_cbdma_disable_8_queue]) + ipef_result.append(['Disable','no-mergeable path', 8, iperf_data_cbdma_disable_8_queue]) self.logger.info("Re-launch without CBDMA and used 1 queue") self.vhost.send_expect("quit", "# ", 30) @@ -466,9 +481,9 @@ class TestVM2VMVirtioNetPerf(TestCase): self.config_vm_env(combined=True, used_queues=1) self.check_scp_file_valid_between_vms(file_size=1024) iperf_data_cbdma_disable_1_queue = self.start_iperf_and_verify_vhost_xstats_info(iperf_mode='tso') - ipef_result.append(['Disabled','no-mergeable path', 1, iperf_data_cbdma_disable_1_queue]) + ipef_result.append(['Disable','no-mergeable path', 1, iperf_data_cbdma_disable_1_queue]) - self.table_header = ['CBDMA Enable/Disable', 'Mode', 'rxq/txq', '[M|G]bits/sec'] + self.table_header = ['CBDMA Enable/Disable', 'Mode', 'rxq/txq', 'Gbits/sec'] self.result_table_create(self.table_header) for table_row in ipef_result: self.result_table_add(table_row) @@ -481,25 +496,25 @@ class TestVM2VMVirtioNetPerf(TestCase): """ TestCase10: VM2VM packed ring virtio-net mergeable with large packet payload valid check """ - self.prepare_test_env(path_mode=10, cbdma=False, no_pci=True, client_mode=True, enable_queues=8, nb_cores=4, server_mode=True, opt_queue=8, combined=True, used_queues=8) + self.prepare_test_env(path_mode=10, cbdma=False, no_pci=True, client_mode=True, enable_queues=8, nb_cores=4, + server_mode=True, opt_queue=8, combined=True, used_queues=8) self.check_scp_file_valid_between_vms(file_size=1024) def test_vm2vm_packed_ring_no_mergeable_path_check_large_packet(self): """ TestCase11: VM2VM packed ring virtio-net non-mergeable with large packet payload valid check """ - self.prepare_test_env(path_mode=11, cbdma=False, no_pci=True, client_mode=True, enable_queues=8, nb_cores=4, server_mode=True, opt_queue=8, combined=True, used_queues=8) + self.prepare_test_env(path_mode=11, cbdma=False, no_pci=True, client_mode=True, enable_queues=8, nb_cores=4, + server_mode=True, opt_queue=8, combined=True, used_queues=8) self.check_scp_file_valid_between_vms(file_size=1024) def tear_down(self): """ run after each test case. """ - if "cbdma_enable" in self.running_case: - self.bind_cbdma_device_to_kernel() self.stop_all_apps() self.dut.kill_all() - time.sleep(2) + self.bind_cbdma_device_to_kernel() def tear_down_all(self): """ From patchwork Fri Mar 19 06:47:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 89537 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4865A0562; Fri, 19 Mar 2021 07:48:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF3E7140E92; Fri, 19 Mar 2021 07:48:17 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 6305D4003F for ; Fri, 19 Mar 2021 07:48:16 +0100 (CET) IronPort-SDR: qgtYSivoZhmV3nHzr5v38Ady/gQnCZPJ5fBJXAsz/KceWIxEp1w2SU873O7zovBKM1f4erqviX 9rs9uozaEsgQ== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="209859782" X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="209859782" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:48:15 -0700 IronPort-SDR: VN1RHfk9ntBIu+o+39veJCviiJ9sbpQHY5nJo+MjAmf0ijChAjWiH6q839MJmrfTHNTi7aQiNp OVO9thlJ4EPg== X-IronPort-AV: E=Sophos;i="5.81,261,1610438400"; d="scan'208";a="606504871" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 23:48:14 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Fri, 19 Mar 2021 14:47:13 +0800 Message-Id: <20210319064713.4894-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1 9/9] tests/vswitch_sample_cbdma:modify hard code bind cbdma device to igb_uio by drivername in execution.cfg X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" 1.Modify hard code bind cbdma device to igb_uio by drivername in execution.cfg. 2.Adjust code format. Signed-off-by: Ling Wei --- tests/TestSuite_vswitch_sample_cbdma.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/TestSuite_vswitch_sample_cbdma.py b/tests/TestSuite_vswitch_sample_cbdma.py index b067cc09..df3ab6f3 100644 --- a/tests/TestSuite_vswitch_sample_cbdma.py +++ b/tests/TestSuite_vswitch_sample_cbdma.py @@ -228,6 +228,9 @@ class TestVswitchSampleCBDMA(TestCase): """ get all cbdma ports """ + # check driver name in execution.cfg + self.verify(self.drivername == 'igb_uio', + "CBDMA test case only use igb_uio driver, need config drivername=igb_uio in execution.cfg") 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') @@ -252,8 +255,7 @@ class TestVswitchSampleCBDMA(TestCase): dmas_info += dmas self.dmas_info = dmas_info[:-1] self.device_str = ' '.join(used_cbdma) - 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) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=%s %s' % (self.drivername, self.device_str), '# ', 60) def send_vlan_packet(self, dts_mac, pkt_size=64, pkt_count=1): """ @@ -338,7 +340,6 @@ class TestVswitchSampleCBDMA(TestCase): self.set_async_threshold(1518) self.build_vhost_app() cbmda_copy = self.pvp_test_with_cbdma(socket_num=1, with_cbdma=True, cbdma_num=1) - self.virtio_user0_pmd.execute_cmd("quit", "#") self.vhost_user.send_expect("^C", "# ", 20) @@ -348,14 +349,12 @@ class TestVswitchSampleCBDMA(TestCase): self.set_async_threshold(0) self.build_vhost_app() sync_copy = self.pvp_test_with_cbdma(socket_num=1, with_cbdma=True, cbdma_num=1) - self.virtio_user0_pmd.execute_cmd("quit", "#") self.vhost_user.send_expect("^C", "# ", 20) # test CPU copy # CPU copy means vhost enqueue w/o cbdma channel cpu_copy = self.pvp_test_with_cbdma(socket_num=1, with_cbdma=False, cbdma_num=0) - self.virtio_user0_pmd.execute_cmd("quit", "#") self.vhost_user.send_expect("^C", "# ", 20) @@ -414,7 +413,6 @@ class TestVswitchSampleCBDMA(TestCase): self.logger.info("Relaunch vhost app perf test") after_relunch = self.pvp_test_with_multi_cbdma(socket_num=2, with_cbdma=True, cbdma_num=2, launch_virtio=False, quit_vhost=False) - self.virtio_user0_pmd.execute_cmd("quit", "#") self.virtio_user1_pmd.execute_cmd("quit", "#") self.vhost_user.send_expect("^C", "# ", 20) @@ -492,13 +490,11 @@ class TestVswitchSampleCBDMA(TestCase): self.build_vhost_app() cbdma_enable = self.vm2vm_check_with_two_cbdma(with_cbdma=True, cbdma_num=2, socket_num=2) - self.virtio_user0_pmd.execute_cmd("quit", "#") self.virtio_user1_pmd.execute_cmd("quit", "#") self.vhost_user.send_expect("^C", "# ", 20) cbdma_disable = self.vm2vm_check_with_two_cbdma(with_cbdma=False, cbdma_num=2, socket_num=2) - self.virtio_user0_pmd.execute_cmd("quit", "#") self.virtio_user1_pmd.execute_cmd("quit", "#") self.vhost_user.send_expect("^C", "# ", 20) @@ -545,7 +541,6 @@ class TestVswitchSampleCBDMA(TestCase): self.result_table_add([frame_size, rx_pps]) rx_throughput[frame_size] = rx_pps self.result_table_print() - return rx_throughput def start_vms_testpmd_and_test(self, launch, quit_vm_testpmd=False):