From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3310D427EA; Tue, 21 Mar 2023 02:39:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D0C340697; Tue, 21 Mar 2023 02:39:05 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 7449240693 for ; Tue, 21 Mar 2023 02:39:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679362743; x=1710898743; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=SeqpbIxkwRszzzzIBUglWoUQ+YEe+U2DHdJn/jdM4rY=; b=oK6dZQZN5nt1zjpQM30TYRDpR/z3MIsQRTyPquaQdJ661Beg/zPtDDME F12/uPOnWdCrgH1ifsFpa/JxEWrhGghm8LO71VGKFlfFU21NMemIPhd9/ VxvEu27NChq/b9/kQyHH4ZgwUfFahCO/wxaKIoCoH410FKGltY+OYo2rQ WecDQ1dmex8BugEbf2IXT/DBPpdanoS6iRGEKh1aIF/mZI2mKOgHbHwev wOrhNIJgjfoKgVWvtDNMQqOe5BArsQj/Ra4tKmezZnB/kYKeTlHAbMNbu ejc1kvgc28NWD+IOugLthOkkKe5ogUcR1nVmjvqSjI4VjuwuvRXgHUSK1 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="319219873" X-IronPort-AV: E=Sophos;i="5.98,277,1673942400"; d="scan'208";a="319219873" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2023 18:39:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="791867506" X-IronPort-AV: E=Sophos;i="5.98,277,1673942400"; d="scan'208";a="791867506" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2023 18:39:01 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V2] tests/basic_4k_pages_dsa: fix start QEMU with wrong command issue Date: Tue, 21 Mar 2023 09:37:03 +0800 Message-Id: <20230321013703.3853092-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 1.When start QEMU with multi-queues, the command must include `mq=on,vectors=x` parameter. 2.When configure the hostname in conf/crbs.cfg will start QEMU failed, eg: `hostfwd=tcp:hostname:6000-:22`, so use the get_host_ip() to get the actual IP address, eg: `hostfwd=tcp:192.168.1.1:6000-:22`. Signed-off-by: Wei Ling --- tests/TestSuite_basic_4k_pages_dsa.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/TestSuite_basic_4k_pages_dsa.py b/tests/TestSuite_basic_4k_pages_dsa.py index bc5840d1..e6da250a 100644 --- a/tests/TestSuite_basic_4k_pages_dsa.py +++ b/tests/TestSuite_basic_4k_pages_dsa.py @@ -13,7 +13,7 @@ from framework.packet import Packet from framework.pktgen import PacketGeneratorHelper from framework.pmd_output import PmdOutput from framework.qemu_kvm import QEMUKvm -from framework.settings import CONFIG_ROOT_PATH, HEADER_SIZE +from framework.settings import CONFIG_ROOT_PATH, HEADER_SIZE, get_host_ip from framework.test_case import TestCase from .virtio_common import dsa_common as DC @@ -63,6 +63,8 @@ class TestBasic4kPagesDsa(TestCase): self.virtio_mac2 = "52:54:00:00:00:02" self.base_dir = self.dut.base_dir.replace("~", "/root") self.random_string = string.ascii_letters + string.digits + self.addr = str(self.dut.get_ip_address()) + self.host_addr = get_host_ip(self.addr).split(":")[0] self.headers_size = HEADER_SIZE["eth"] + HEADER_SIZE["ip"] + HEADER_SIZE["tcp"] self.DC = DC(self) @@ -125,6 +127,7 @@ class TestBasic4kPagesDsa(TestCase): def start_vm0(self, packed=False, queues=1, server=False): packed_param = ",packed=on" if packed else "" + mq_param = ",mq=on,vectors=%s" % (2 + 2 * queues) if queues > 1 else "" server = ",server" if server else "" self.qemu_cmd0 = ( f"taskset -c {self.vm0_lcore} {self.vm0_qemu_path} -name vm0 -enable-kvm " @@ -133,7 +136,7 @@ class TestBasic4kPagesDsa(TestCase): f"-chardev socket,id=char0,path=/root/dpdk/vhost-net0{server} " f"-netdev type=vhost-user,id=netdev0,chardev=char0,vhostforce,queues={queues} " f"-device virtio-net-pci,netdev=netdev0,mac=%s," - f"disable-modern=false,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on{packed_param} " + f"disable-modern=false,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on{packed_param}{mq_param} " f"-cpu host -smp {self.vm0_lcore_smp} -m {self.vm0_mem_size} -object memory-backend-file,id=mem,size={self.vm0_mem_size}M,mem-path=/mnt/tmpfs_nohuge0,share=on " f"-numa node,memdev=mem -mem-prealloc -drive file={self.vm0_image_path} " f"-chardev socket,path=/tmp/vm0_qga0.sock,server,nowait,id=vm0_qga0 -device virtio-serial " @@ -142,7 +145,7 @@ class TestBasic4kPagesDsa(TestCase): self.vm0_session = self.dut.new_session(suite="vm0_session") cmd0 = self.qemu_cmd0 % ( - self.dut.get_ip_address(), + self.host_addr, self.virtio_mac1, ) self.vm0_session.send_expect(cmd0, "# ") @@ -153,6 +156,7 @@ class TestBasic4kPagesDsa(TestCase): def start_vm1(self, packed=False, queues=1, server=False): packed_param = ",packed=on" if packed else "" + mq_param = ",mq=on,vectors=%s" % (2 + 2 * queues) if queues > 1 else "" server = ",server" if server else "" self.qemu_cmd1 = ( f"taskset -c {self.vm1_lcore} {self.vm1_qemu_path} -name vm1 -enable-kvm " @@ -161,7 +165,7 @@ class TestBasic4kPagesDsa(TestCase): f"-chardev socket,id=char0,path=/root/dpdk/vhost-net1{server} " f"-netdev type=vhost-user,id=netdev0,chardev=char0,vhostforce,queues={queues} " f"-device virtio-net-pci,netdev=netdev0,mac=%s," - f"disable-modern=false,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on{packed_param} " + f"disable-modern=false,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on{packed_param}{mq_param} " f"-cpu host -smp {self.vm1_lcore_smp} -m {self.vm1_mem_size} -object memory-backend-file,id=mem,size={self.vm1_mem_size}M,mem-path=/mnt/tmpfs_nohuge1,share=on " f"-numa node,memdev=mem -mem-prealloc -drive file={self.vm1_image_path} " f"-chardev socket,path=/tmp/vm1_qga0.sock,server,nowait,id=vm1_qga0 -device virtio-serial " @@ -169,7 +173,7 @@ class TestBasic4kPagesDsa(TestCase): ) self.vm1_session = self.dut.new_session(suite="vm1_session") cmd1 = self.qemu_cmd1 % ( - self.dut.get_ip_address(), + self.host_addr, self.virtio_mac2, ) self.vm1_session.send_expect(cmd1, "# ") @@ -181,7 +185,7 @@ class TestBasic4kPagesDsa(TestCase): def connect_vm0(self): self.vm0 = QEMUKvm(self.dut, "vm0", self.suite_name) self.vm0.net_type = "hostfwd" - self.vm0.hostfwd_addr = "%s:6000" % self.dut.get_ip_address() + self.vm0.hostfwd_addr = "%s:6000" % self.host_addr self.vm0.def_driver = "vfio-pci" self.vm0.driver_mode = "noiommu" self.wait_vm_net_ready(vm_index=0) @@ -194,7 +198,7 @@ class TestBasic4kPagesDsa(TestCase): def connect_vm1(self): self.vm1 = QEMUKvm(self.dut, "vm1", "vm_hotplug") self.vm1.net_type = "hostfwd" - self.vm1.hostfwd_addr = "%s:6001" % self.dut.get_ip_address() + self.vm1.hostfwd_addr = "%s:6001" % self.host_addr self.vm1.def_driver = "vfio-pci" self.vm1.driver_mode = "noiommu" self.wait_vm_net_ready(vm_index=1) -- 2.25.1