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 AACA74237F; Mon, 9 Jan 2023 12:09:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA54742D15; Mon, 9 Jan 2023 12:09:38 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id C48A14067C for ; Mon, 9 Jan 2023 12:09:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673262578; x=1704798578; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=MdIRnaYeh/URawbHx3QPt0BgFtHOStkXOt2SiiBK+/k=; b=EKRNoAr5zzYIDnpQLp6z8ADgeIt7TP/0kVSa3PZaBU0Gg+LJ6bi3XfBI yohf5O1zjxhWOfkcNF6Cx5j+ffsQcF6VcvF+4eRgKulKTHvuOIJdf5JtS Rto3P+d/qQ0nUJwZB1xIwaOojIhPv26NMxY/vndtupxaKk1ztcs7C4PXG UnvK6c8CmpzVApNVjgkyvafexe7Rjw5r/xP1O6UDU/o61zELpaF0nF3L2 mpUPfE7LKI9vMGdOeAQN9h7Rg2fYvgPq71deQk9ttjIrASXDFb16T5hT6 Tqgg5hff+MWz4CfRjJ+8kwqGpf52n4exs6Kg5PKB/RtYa8i0ej2vhxEeY Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="320549518" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="320549518" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 03:09:37 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="901963148" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="901963148" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 03:09:35 -0800 From: Lingli Chen To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Lingli Chen Subject: [dts][PATCH V1 2/2] tests/vf_rss: add case test_vf_rss_rxq_txq_inconsistent Date: Mon, 9 Jan 2023 05:09:43 -0500 Message-Id: <20230109100943.33128-2-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230109100943.33128-1-linglix.chen@intel.com> References: <20230109100943.33128-1-linglix.chen@intel.com> 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 add new case to cover rxq number not equal to txq number Signed-off-by: Lingli Chen --- tests/TestSuite_vf_rss.py | 80 +++++++++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py index a6772baf..4a211be0 100644 --- a/tests/TestSuite_vf_rss.py +++ b/tests/TestSuite_vf_rss.py @@ -11,6 +11,12 @@ import re import time testQueues = [4] +testRxqTxq = [ + {"rxq": 4, "txq": 8,}, + {"rxq": 6, "txq": 8,}, + {"rxq": 3, "txq": 9,}, + {"rxq": 6, "txq": 9,}, +] reta_entries = [] reta_lines = [] @@ -36,8 +42,13 @@ class TestVfRss(TestCase): self.tester.scapy_foreground() self.tester.scapy_append('sys.path.append("./")') self.tester.scapy_append("from sctp import *") - self.vm_dut_0.send_expect("start", "testpmd>") - mac = self.vm0_testpmd.get_port_mac(0) + + if self.setup_1pf_1vf_1vm_env_flag == 1: + self.vm_dut_0.send_expect("start", "testpmd>") + mac = self.vm0_testpmd.get_port_mac(0) + else: + mac = self.pmd_out.get_port_mac(0) + # send packet with different source and dest ip if tran_type == "ipv4-other": for i in range(packet_count): @@ -152,8 +163,11 @@ class TestVfRss(TestCase): else: print("\ntran_type error!\n") - - out = self.vm_dut_0.get_session_output() + if self.setup_1pf_1vf_1vm_env_flag == 1: + out = self.vm_dut_0.get_session_output() + else: + out = self.dut.get_session_output() + self.dut.send_expect("show fwd stats all", "testpmd>") print("*******************************************") print(out) if not reta_entries: @@ -195,7 +209,8 @@ class TestVfRss(TestCase): break else: pass - self.verifyResult() + if "pmdrss" in self.running_case: + self.verifyResult() def verifyResult(self): """ @@ -292,13 +307,16 @@ class TestVfRss(TestCase): self.host_testpmd = None self.setup_1pf_1vf_1vm_env_flag = 0 self.dcf_mode = load_global_setting(DPDK_DCFMODE_SETTING) - self.setup_1pf_1vf_1vm_env(driver="") + def set_up(self): """ Run before each test case. """ - pass + if "rxq_txq_inconsistent" in self.running_case: + self.destroy_1pf_1vf_1vm_env() + elif self.setup_1pf_1vf_1vm_env_flag == 0: + self.setup_1pf_1vf_1vm_env(driver="") def setup_1pf_1vf_1vm_env(self, driver="default"): @@ -362,7 +380,7 @@ class TestVfRss(TestCase): port = self.dut.ports_info[port_id]["port"] port.bind_driver() - self.setup_1pf_2vf_1vm_env_flag = 0 + self.setup_1pf_1vf_1vm_env_flag = 0 def launch_testpmd(self, **kwargs): dcf_flag = kwargs.get("dcf_flag") @@ -375,6 +393,13 @@ class TestVfRss(TestCase): port_options={self.vf0_guest_pci: "cap=dcf"}, socket=self.vm0_ports_socket, ) + elif self.setup_1pf_1vf_1vm_env_flag == 0: + self.pmd_out.start_testpmd( + cores="1S/9C/1T", + param=param, + eal_param="-a %s --file-prefix=vf" + % self.vf_port_pci, + ) else: self.vm0_testpmd.start_testpmd( "all", @@ -503,6 +528,45 @@ class TestVfRss(TestCase): self.send_packet(itf, iptype, queue, 128) self.vm_dut_0.send_expect("quit", "# ", 30) + def test_vf_rss_rxq_txq_inconsistent(self): + + self.pmd_out = PmdOutput(self.dut) + self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], 1) + self.vf_port = self.dut.ports_info[self.dut_ports[0]]["vfs_port"][0] + iptypes = { + "ipv4-other": "ip", + "ipv4-udp": "udp", + "ipv4-tcp": "tcp", + "ipv4-sctp": "sctp", + "ipv6-other": "ip", + "ipv6-udp": "udp", + "ipv6-tcp": "tcp", + "ipv6-sctp": "sctp", + } + + self.vf_port.bind_driver(driver="vfio-pci") + self.vf_port_pci = self.dut.ports_info[self.dut_ports[0]]["sriov_vfs_pci"][0] + localPort = self.tester.get_local_port(self.dut_ports[0]) + itf = self.tester.get_interface(localPort) + eal_param = "--nb-core=8" + # test with different rss queues + for i in testRxqTxq: + self.launch_testpmd( + dcf_flag=self.dcf_mode, + param="--rxq=%s --txq=%s %s" % (str(i["rxq"]), str(i["txq"]), eal_param), + ) + self.dut.send_expect("set fwd rxonly", "testpmd>") + self.dut.send_expect("set verbose 1", "testpmd>") + self.dut.send_expect("start", "testpmd>") + self.pmd_out.wait_link_status_up('all') + queue = i["rxq"] + for iptype, rsstype in list(iptypes.items()): + self.send_packet(itf, iptype, queue, 64) + + self.dut.send_expect("stop", "testpmd>") + self.dut.send_expect("quit", "# ", 30) + + def tear_down(self): """ Run after each test case. -- 2.17.1