From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1C9FAA058A; Wed, 25 Mar 2020 09:17:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E2FB1C06B; Wed, 25 Mar 2020 09:17:42 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 585BD1C068 for ; Wed, 25 Mar 2020 09:17:40 +0100 (CET) IronPort-SDR: kiZAu/4znJwV9IJ+6nI/2FK0WOVA+7ho3BgHmP1HCykbDW15hsMauwznKxzJP7H5wTbpPnd4AP vEbXrcUzMATg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 01:17:40 -0700 IronPort-SDR: eSd8hog709guUrl12rpRuhqVbf63hHAmt20vWXEy67ngCR1ooYRmzLe2W30QLsSOkmbWkscgvw irY/taNzp3iw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,303,1580803200"; d="scan'208";a="282071849" Received: from unknown (HELO dpdk-zhaohy-t.sh.intel.com) ([10.240.183.68]) by fmsmga002.fm.intel.com with ESMTP; 25 Mar 2020 01:17:38 -0700 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Wed, 25 Mar 2020 16:10:55 +0800 Message-Id: <1585123857-130281-9-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1585123857-130281-1-git-send-email-qimaix.xiao@intel.com> References: <1585123857-130281-1-git-send-email-qimaix.xiao@intel.com> Subject: [dts] [PATCH V1 09/11]vhost_virtio_user_interrupt: update script according to testplan's update X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Signed-off-by: Xiao Qimai --- tests/TestSuite_vhost_virtio_user_interrupt.py | 72 +++++++++++++++++++++----- 1 file changed, 59 insertions(+), 13 deletions(-) diff --git a/tests/TestSuite_vhost_virtio_user_interrupt.py b/tests/TestSuite_vhost_virtio_user_interrupt.py index 610e56e..69d5668 100644 --- a/tests/TestSuite_vhost_virtio_user_interrupt.py +++ b/tests/TestSuite_vhost_virtio_user_interrupt.py @@ -89,13 +89,13 @@ class TestVirtioUserInterrupt(TestCase): out = self.dut.build_dpdk_apps("./examples/l3fwd-power") self.verify("Error" not in out, "compilation l3fwd-power error") - def launch_l3fwd(self, path): + def launch_l3fwd(self, path, packed=False): self.core_interrupt = self.core_list_l3fwd[0] example_para = "./examples/l3fwd-power/build/l3fwd-power " - vdev = " --log-level='user1,7' --vdev=virtio_user0,path=%s,cq=1 -- -p 1" % path - eal_params = self.dut.create_eal_parameters(cores=self.core_list_l3fwd, prefix='l3fwd-pwd', no_pci=True, ports=[self.pci_info]) + vdev = "virtio_user0,path=%s,cq=1" % path if not packed else "virtio_user0,path=%s,cq=1,packed_vq=1" % path + eal_params = self.dut.create_eal_parameters(cores=self.core_list_l3fwd, prefix='l3fwd-pwd', no_pci=True, ports=[self.pci_info], vdevs=[vdev]) para = " --config='(0,0,%s)' --parse-ptype" % self.core_interrupt - cmd_l3fwd = example_para + eal_params + vdev + para + cmd_l3fwd = example_para + eal_params + " --log-level='user1,7' -- -p 1 " + para self.l3fwd.get_session_before(timeout=2) self.l3fwd.send_expect(cmd_l3fwd, "POWER", 40) time.sleep(10) @@ -110,27 +110,27 @@ class TestVirtioUserInterrupt(TestCase): start testpmd on vhost side """ testcmd = self.dut.target + "/app/testpmd " - vdev = [r"'net_vhost0,iface=vhost-net,queues=1,client=0'"] + vdev = ["net_vhost0,iface=vhost-net,queues=1,client=0"] para = " -- -i --rxq=1 --txq=1" if len(pci) == 0: eal_params = self.dut.create_eal_parameters(cores=self.core_list_vhost, ports=[self.pci_info], vdevs=vdev) else: - eal_params = self.dut.create_eal_parameters(cores=self.core_list_vhost, prefix='vhost', no_pci=True, ports=[self.pci_info], vdevs=vdev) + 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) - def start_virtio_user(self): + def start_virtio_user(self, packed=False): """ start testpmd on virtio side """ testcmd = self.dut.target + "/app/testpmd " - vdev = " --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net" - eal_params = self.dut.create_eal_parameters(cores=self.core_list_l3fwd, prefix='virtio', no_pci=True, ports=[self.pci_info]) + vdev = "net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net" if not packed else "net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,packed_vq=1" + eal_params = self.dut.create_eal_parameters(cores=self.core_list_l3fwd, prefix='virtio', no_pci=True, vdevs=[vdev]) para = " -- -i --txd=512 --rxd=128 --tx-offloads=0x00" - cmd_virtio_user = testcmd + eal_params + vdev + para + cmd_virtio_user = testcmd + eal_params + para self.virtio.send_expect(cmd_virtio_user, "testpmd>", 120) self.virtio.send_expect("set fwd mac", "testpmd>", 20) self.virtio.send_expect("start", "testpmd>", 20) @@ -154,7 +154,7 @@ class TestVirtioUserInterrupt(TestCase): else: self.logger.error("Wrong link status not right, status is %s" % result) - def test_interrupt_with_vhost_net_as_backed(self): + def test_split_ring_virtio_user_interrupt_with_vhost_net_as_backed(self): """ Check the virtio-user interrupt can work when use vhost-net as backend """ @@ -175,7 +175,7 @@ class TestVirtioUserInterrupt(TestCase): self.check_interrupt_log(status="waked up") self.dut.send_expect("killall -s INT ping", "#") - def test_interrupt_with_vhost_user_as_backed(self): + def test_split_ring_virtio_user_interrupt_with_vhost_user_as_backed(self): """ Check the virtio-user interrupt can work when use vhost-user as backend """ @@ -189,7 +189,7 @@ class TestVirtioUserInterrupt(TestCase): time.sleep(3) self.check_interrupt_log(status="waked up") - def test_lsc_event_between_vhost_and_virtio_user(self): + def test_lsc_event_between_vhost_user_and_virtio_user_with_split_ring(self): """ LSC event between vhost-user and virtio-user """ @@ -200,6 +200,52 @@ class TestVirtioUserInterrupt(TestCase): self.vhost.send_expect("quit", "#", 20) self.check_virtio_side_link_status("down") + def test_packed_ring_virtio_user_interrupt_with_vhost_user_as_backed(self): + """ + Check the virtio-user interrupt can work when use vhost-user as backend + """ + self.start_vhost_testpmd(pci="") + self.launch_l3fwd(path="./vhost-net", packed=True) + # double check the status of interrupt core + for i in range(2): + self.tester.scapy_append('pk=[Ether(dst="52:54:00:00:00:01")/IP()/("X"*64)]') + self.tester.scapy_append('sendp(pk, iface="%s", count=100)' % self.tx_interface) + self.tester.scapy_execute() + time.sleep(3) + self.check_interrupt_log(status="waked up") + + def test_packed_ring_virtio_user_interrupt_with_vhost_net_as_backed(self): + """ + Check the virtio-user interrupt can work when use vhost-net as backend + """ + self.launch_l3fwd(path="/dev/vhost-net", packed=True) + self.virtio.send_expect("ifconfig tap0 up", "#", 20) + self.virtio.send_expect("ifconfig tap0 1.1.1.2", "#", 20) + # start to ping, check the status of interrupt core + self.virtio.send_command("ping -I tap0 1.1.1.1 > aa &", 20) + time.sleep(3) + self.check_interrupt_log(status="waked up") + # stop ping, check the status of interrupt core + self.dut.send_expect("killall -s INT ping", "#") + time.sleep(2) + self.check_interrupt_log(status="sleeps") + # restart ping, check the status of interrupt core + self.virtio.send_command("ping -I tap0 1.1.1.1 > aa &", 20) + time.sleep(3) + self.check_interrupt_log(status="waked up") + self.dut.send_expect("killall -s INT ping", "#") + + def test_lsc_event_between_vhost_user_and_virtio_user_with_packed_ring(self): + """ + LSC event between vhost-user and virtio-user + """ + 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") + def tear_down(self): """ run after each test case. -- 1.8.3.1