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 62E11A00C2; Wed, 30 Nov 2022 07:31:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D4EA40395; Wed, 30 Nov 2022 07:31:01 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 7CA484014F for ; Wed, 30 Nov 2022 07:30:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669789858; x=1701325858; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=84BHdJIQSM2DcN9fai72NrRRBm/QTudgovTo0mdE2+o=; b=QmHDqAccr84+M1A+6ZGFMmY32PgWs5+Hv1nn1QjdZhUrGnH8lZFeuHSk JfrdLidmo4kCdpNWU9+lZWwIcyOiOwZBJOXpQF1aItCNUznqK/1qF9Lnt AK4janiZyIGcJz1FeHRuySO6B6ldawjHYobKJ2RIaLr1lXyDus8V2TGto qBlIfpqpqtAFQ2E5QEc0XWy4Yf1ZwwOJWC3GM58HlmSCA91ZXt/vwLXgW vL/YfvdDNZGG+VbQTa0aN+F8Y0AWoqfrvYVqvUzQSuKLi+DwJ/hDriA+f xL3lGzTgEePvLj5Zatup1Gr55Wq9BHiV+A3K0cNsjVHlg9KGNkgR4q8Q/ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="298686759" X-IronPort-AV: E=Sophos;i="5.96,205,1665471600"; d="scan'208";a="298686759" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2022 22:30:57 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="676713164" X-IronPort-AV: E=Sophos;i="5.96,205,1665471600"; d="scan'208";a="676713164" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2022 22:30:55 -0800 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V2 2/2] tests/loopback_virtio_user_server_mode_dsa: add new testsuite Date: Wed, 30 Nov 2022 14:25:19 +0800 Message-Id: <20221130062519.1164535-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.Add the new testsuite TestSuite_loopback_virtio_user_server_mode_dsa.py. Signed-off-by: Wei Ling --- ...te_loopback_virtio_user_server_mode_dsa.py | 1932 +++++++++++++++++ 1 file changed, 1932 insertions(+) create mode 100644 tests/TestSuite_loopback_virtio_user_server_mode_dsa.py diff --git a/tests/TestSuite_loopback_virtio_user_server_mode_dsa.py b/tests/TestSuite_loopback_virtio_user_server_mode_dsa.py new file mode 100644 index 00000000..3990e2cc --- /dev/null +++ b/tests/TestSuite_loopback_virtio_user_server_mode_dsa.py @@ -0,0 +1,1932 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2022 Intel Corporation +# + +""" +DPDK Test suite. +Test loopback virtio-user server mode +""" +import re +import time + +from framework.packet import Packet +from framework.pmd_output import PmdOutput +from framework.test_case import TestCase + +from .virtio_common import dsa_common as DC + + +class TestLoopbackVirtioUserServerModeDsa(TestCase): + def set_up_all(self): + """ + Run at the start of each test suite. + """ + self.dut_ports = self.dut.get_ports() + self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) + self.core_list = self.dut.get_core_list(config="all", socket=self.ports_socket) + self.vhost_core_list = self.core_list[0:9] + self.virtio0_core_list = self.core_list[10:15] + self.path = self.dut.apps_name["test-pmd"] + self.testpmd_name = self.path.split("/")[-1] + self.app_pdump = self.dut.apps_name["pdump"] + self.dump_pcap_q0 = "/root/pdump-rx-q0.pcap" + self.dump_pcap_q1 = "/root/pdump-rx-q1.pcap" + self.device_str = None + self.cbdma_dev_infos = [] + self.vhost_user = self.dut.new_session(suite="vhost_user") + self.virtio_user = self.dut.new_session(suite="virtio-user") + self.pdump_session = self.dut.new_session(suite="pdump") + self.vhost_user_pmd = PmdOutput(self.dut, self.vhost_user) + self.virtio_user_pmd = PmdOutput(self.dut, self.virtio_user) + self.DC = DC(self) + + def set_up(self): + """ + Run before each test case. + """ + self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#") + self.dut.send_expect("rm -rf ./vhost-net*", "#") + self.table_header = [ + "Mode", + "Pkt_size", + "Throughput(Mpps)", + "Queue Number", + "Cycle", + ] + self.result_table_create(self.table_header) + self.use_dsa_list = [] + self.DC.reset_all_work_queue() + self.DC.bind_all_dsa_to_kernel() + + @property + def check_2M_env(self): + out = self.dut.send_expect( + "cat /proc/meminfo |grep Hugepagesize|awk '{print($2)}'", "# " + ) + return True if out == "2048" else False + + def send_6192_packets_from_vhost(self, set_csum=True): + if set_csum: + self.vhost_user_pmd.execute_cmd("set fwd csum") + self.vhost_user_pmd.execute_cmd("set txpkts 64,64,64,2000,2000,2000") + self.vhost_user_pmd.execute_cmd("set burst 1") + self.vhost_user_pmd.execute_cmd("start tx_first 1") + self.vhost_user_pmd.execute_cmd("stop") + + def send_960_packets_from_vhost(self): + self.vhost_user_pmd.execute_cmd("set fwd csum") + self.vhost_user_pmd.execute_cmd("set txpkts 64,128,256,512") + self.vhost_user_pmd.execute_cmd("set burst 1") + self.vhost_user_pmd.execute_cmd("start tx_first 1") + self.vhost_user_pmd.execute_cmd("stop") + + def send_chain_packets_from_vhost(self): + self.vhost_user_pmd.execute_cmd("set txpkts 65535,65535") + self.vhost_user_pmd.execute_cmd("start tx_first 32", timeout=30) + + def verify_virtio_user_receive_packets(self): + results = 0.0 + time.sleep(3) + for _ in range(10): + out = self.virtio_user_pmd.execute_cmd("show port stats all") + lines = re.search("Rx-pps:\s*(\d*)", out) + result = lines.group(1) + results += float(result) + Mpps = results / (1000000 * 10) + self.logger.info(Mpps) + self.verify(Mpps > 0, "virtio-user can not receive packets") + + def launch_pdump_to_capture_pkt(self): + command = ( + self.app_pdump + + " " + + "-v --file-prefix=virtio-user0 -- " + + "--pdump 'device_id=net_virtio_user0,queue=0,rx-dev=%s,mbuf-size=8000' " + + "--pdump 'device_id=net_virtio_user0,queue=1,rx-dev=%s,mbuf-size=8000'" + ) + self.pdump_session.send_expect( + command % (self.dump_pcap_q0, self.dump_pcap_q1), "Port" + ) + + def check_packet_payload_valid(self, pkt_len, check_payload=True): + self.pdump_session.send_expect("^c", "# ", 60) + dump_file_list = [self.dump_pcap_q0, self.dump_pcap_q1] + for pcap in dump_file_list: + self.dut.session.copy_file_from(src="%s" % pcap, dst="%s" % pcap) + pkt = Packet() + pkts = pkt.read_pcapfile(pcap) + expect_data = str(pkts[0]["Raw"]) + for i in range(len(pkts)): + self.verify( + len(pkts[i]) == pkt_len, + "virtio-user0 receive packet's length not equal %s Byte" % pkt_len, + ) + if check_payload: + check_data = str(pkts[i]["Raw"]) + self.verify( + check_data == expect_data, + "the payload in receive packets has been changed from %s" % i, + ) + + def start_vhost_testpmd( + self, + cores, + eal_param="", + param="", + no_pci=False, + ports="", + port_options="", + iova_mode="va", + ): + if iova_mode: + eal_param += " --iova=" + iova_mode + if not no_pci and port_options != "": + self.vhost_user_pmd.start_testpmd( + cores=cores, + eal_param=eal_param, + param=param, + port_options=port_options, + ports=ports, + prefix="vhost", + fixed_prefix=True, + ) + elif not no_pci and port_options == "": + self.vhost_user_pmd.start_testpmd( + cores=cores, + eal_param=eal_param, + param=param, + ports=ports, + prefix="vhost", + fixed_prefix=True, + ) + else: + self.vhost_user_pmd.start_testpmd( + cores=cores, + eal_param=eal_param, + param=param, + no_pci=no_pci, + prefix="vhost", + fixed_prefix=True, + ) + + def start_virtio_testpmd_with_vhost_net0( + self, cores, eal_param, param, set_fwd_csum=True + ): + """ + launch the testpmd as virtio with vhost_net0 + """ + if self.check_2M_env: + eal_param += " --single-file-segments" + self.virtio_user_pmd.start_testpmd( + cores=cores, + eal_param=eal_param, + param=param, + no_pci=True, + prefix="virtio-user0", + fixed_prefix=True, + ) + if set_fwd_csum: + self.virtio_user_pmd.execute_cmd("set fwd csum") + self.virtio_user_pmd.execute_cmd("start") + + def test_loopback_split_server_mode_large_chain_packets_stress_test_with_dpdk_driver( + self, + ): + """ + Test Case 1: Loopback split ring server mode large chain packets stress test with dsa dpdk driver + """ + if not self.check_2M_env: + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = "txq0@%s-q0;" "rxq0@%s-q0" % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + vhost_eal_param = ( + "--vdev 'net_vhost0,iface=vhost-net0,queues=1,dmas=[%s],client=1'" + % dmas + ) + vhost_param = "--nb-cores=1 --txd=1024 --rxd=1024 --mbuf-size=65535" + port_options = {self.use_dsa_list[0]: "max_queues=1"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=1,mrg_rxbuf=1,in_order=0,vectorized=1,queue_size=2048,server=1" + virtio_param = "--nb-cores=1 --rxq=1 --txq=1 --txd=2048 --rxd=2048" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=False, + ) + self.send_chain_packets_from_vhost() + self.verify_virtio_user_receive_packets() + + def test_loopback_packed_server_mode_large_chain_packets_stress_test_with_dpdk_driver( + self, + ): + """ + Test Case 2: Loopback packed ring server mode large chain packets stress test with dsa dpdk driver + """ + if not self.check_2M_env: + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = "txq0@%s-q0;" "rxq0@%s-q0" % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + vhost_eal_param = ( + "--vdev 'net_vhost0,iface=vhost-net0,queues=1,dmas=[%s],client=1'" + % dmas + ) + vhost_param = "--nb-cores=1 --txd=1024 --rxd=1024 --mbuf-size=65535" + port_options = {self.use_dsa_list[0]: "max_queues=1"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=1,mrg_rxbuf=1,in_order=0,vectorized=1,packed_vq=1,queue_size=2048,server=1" + virtio_param = " --nb-cores=1 --rxq=1 --txq=1 --txd=2048 --rxd=2048" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=False, + ) + self.send_chain_packets_from_vhost() + self.verify_virtio_user_receive_packets() + + def test_loopback_split_inorder_mergeable_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 3: Loopback split ring inorder mergeable path multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + def test_loopback_split_mergeable_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 4: Loopback split ring mergeable path multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=0,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + def test_loopback_split_non_mergeable_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 5: Loopback split ring non-mergeable path multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,server=1" + virtio_param = ( + "--enable-hw-vlan-strip --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + ) + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + def test_loopback_split_inorder_non_mergeable_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 6: Loopback split ring inorder non-mergeable path multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + def test_loopback_split_vectorized_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 7: Loopback split ring vectorized path multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,vectorized=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + def test_loopback_packed_inorder_mergeable_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 8: Loopback packed ring inorder mergeable path multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,packed_vq=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + def test_loopback_packed_mergeable_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 9: Loopback packed ring mergeable path multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=0,packed_vq=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + def test_loopback_packed_non_mergeable_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 10: Loopback packed ring non-mergeable path multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,packed_vq=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + def test_loopback_packed_inorder_non_mergeable_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 11: Loopback packed ring inorder non-mergeable path multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + def test_loopback_packed_vectorized_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 12: Loopback packed ring vectorized path multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--force-max-simd-bitwidth=512 --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,vectorized=1,packed_vq=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + def test_loopback_packed_vectorized_not_powerof_2_multi_queues_payload_check_with_server_mode_and_dpdk_driver( + self, + ): + """ + Test Case 13: Loopback packed ring vectorized path and ring size is not power of 2 multi-queues payload check with server mode and dsa dpdk driver + """ + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=1, driver_name="vfio-pci", socket=self.ports_socket + ) + dmas = ( + "txq0@%s-q0;" + "txq1@%s-q0;" + "txq2@%s-q0;" + "txq3@%s-q0;" + "txq4@%s-q1;" + "txq5@%s-q1;" + "rxq2@%s-q2;" + "rxq3@%s-q2;" + "rxq4@%s-q3;" + "rxq5@%s-q3;" + "rxq6@%s-q3;" + "rxq7@%s-q3" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=8"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list, + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--force-max-simd-bitwidth=512 --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,vectorized=1,packed_vq=1,queue_size=1025,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1025 --rxd=1025" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + def test_loopback_split_server_mode_large_chain_packets_stress_test_with_kernel_driver( + self, + ): + """ + Test Case 14: Loopback split ring server mode large chain packets stress test with dsa kernel driver + """ + if not self.check_2M_env: + self.DC.create_work_queue(work_queue_number=1, dsa_index=0) + dmas = "txq0@wq0.0;rxq0@wq0.0" + vhost_eal_param = ( + "--vdev 'net_vhost0,iface=vhost-net0,queues=1,dmas=[%s],client=1'" + % dmas + ) + vhost_param = "--nb-cores=1 --txd=1024 --rxd=1024 --mbuf-size=65535" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=1,mrg_rxbuf=1,in_order=0,vectorized=1,queue_size=2048,server=1" + virtio_param = "--nb-cores=1 --rxq=1 --txq=1 --txd=2048 --rxd=2048" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=False, + ) + self.send_chain_packets_from_vhost() + self.verify_virtio_user_receive_packets() + + def test_loopback_packed_server_mode_large_chain_packets_stress_test_with_kernel_driver( + self, + ): + """ + Test Case 15: Loopback packed ring server mode large chain packets stress test with dsa kernel driver + """ + if not self.check_2M_env: + self.DC.create_work_queue(work_queue_number=1, dsa_index=0) + dmas = "txq0@wq0.0;rxq0@wq0.0" + vhost_eal_param = ( + "--vdev 'net_vhost0,iface=vhost-net0,queues=1,dmas=[%s],client=1'" + % dmas + ) + vhost_param = "--nb-cores=1 --txd=1024 --rxd=1024 --mbuf-size=65535" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=1,mrg_rxbuf=1,in_order=0,vectorized=1,packed_vq=1,queue_size=2048,server=1" + virtio_param = " --nb-cores=1 --rxq=1 --txq=1 --txd=2048 --rxd=2048" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=False, + ) + self.send_chain_packets_from_vhost() + self.verify_virtio_user_receive_packets() + + def test_loopback_split_inorder_mergeable_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 16: Loopback split ring inorder mergeable path multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + def test_loopback_split_mergeable_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 17: Loopback split ring mergeable path multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=0,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + def test_loopback_split_non_mergeable_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 18: Loopback split ring non-mergeable path multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,server=1" + virtio_param = ( + "--enable-hw-vlan-strip --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + ) + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + + def test_loopback_split_inorder_non_mergeable_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 19: Loopback split ring inorder non-mergeable path multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + + def test_loopback_split_vectorized_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 20: Loopback split ring vectorized path multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,vectorized=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + + def test_loopback_packed_inorder_mergeable_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 21: Loopback packed ring inorder mergeable path multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,packed_vq=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + def test_loopback_packed_mergeable_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 22: Loopback packed ring mergeable path multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=0,packed_vq=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + self.launch_pdump_to_capture_pkt() + self.send_6192_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=6192) + + def test_loopback_packed_non_mergeable_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 23: Loopback packed ring non-mergeable path multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,packed_vq=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + + def test_loopback_packed_inorder_non_mergeable_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 24: Loopback packed ring inorder non-mergeable path multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + + def test_loopback_packed_vectorized_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 25: Loopback packed ring vectorized path multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--force-max-simd-bitwidth=512 --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,vectorized=1,packed_vq=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + + def test_loopback_packed_vectorized_not_powerof_2_multi_queues_payload_check_with_server_mode_and_kernel_driver( + self, + ): + """ + Test Case 26: Loopback packed ring vectorized path and ring size is not power of 2 multi-queues payload check with server mode and dsa kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@wq0.1;" + "txq5@wq0.1;" + "rxq2@wq1.0;" + "rxq3@wq1.0;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,queue_size=1025,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1025 --rxd=1025" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + self.vhost_user_pmd.quit() + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.1;" + "txq2@wq0.2;" + "txq3@wq0.3;" + "txq4@wq0.4;" + "txq5@wq0.5;" + "rxq2@wq1.2;" + "rxq3@wq1.3;" + "rxq4@wq1.4;" + "rxq5@wq1.5;" + "rxq6@wq1.6;" + "rxq7@wq1.7" + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + self.launch_pdump_to_capture_pkt() + self.send_960_packets_from_vhost() + self.check_packet_payload_valid(pkt_len=960) + + def test_pv_split_and_packed_server_mode_txonly_mode_with_dpdk_and_kernel_driver( + self, + ): + """ + Test Case 27: PV split and packed ring server mode test txonly mode with dsa dpdk and kernel driver + """ + self.DC.create_work_queue(work_queue_number=8, dsa_index=0) + self.DC.create_work_queue(work_queue_number=8, dsa_index=1) + self.use_dsa_list = self.DC.bind_dsa_to_dpdk( + dsa_number=2, + driver_name="vfio-pci", + dsa_index_list=[2, 3], + socket=self.ports_socket, + ) + dmas = ( + "txq0@wq0.0;" + "txq1@wq0.0;" + "txq2@wq0.0;" + "txq3@wq0.0;" + "txq4@%s-q0;" + "txq5@%s-q0;" + "rxq2@%s-q1;" + "rxq3@%s-q1;" + "rxq4@wq1.1;" + "rxq5@wq1.1;" + "rxq6@wq1.1;" + "rxq7@wq1.1" + % ( + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + self.use_dsa_list[0], + ) + ) + vhost_eal_param = ( + "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas + ) + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + port_options = {self.use_dsa_list[0]: "max_queues=2"} + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=False, + ports=self.use_dsa_list[0:1], + port_options=port_options, + iova_mode="va", + ) + virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1" + virtio_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_virtio_testpmd_with_vhost_net0( + cores=self.virtio0_core_list, + eal_param=virtio_eal_param, + param=virtio_param, + set_fwd_csum=True, + ) + self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd txonly") + self.vhost_user_pmd.execute_cmd("async_vhost tx poll completed on") + self.send_6192_packets_from_vhost(set_csum=False) + self.check_packet_payload_valid(pkt_len=6192, check_payload=False) + + self.vhost_user_pmd.quit() + vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1'" + vhost_param = "--nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024" + self.start_vhost_testpmd( + cores=self.vhost_core_list, + eal_param=vhost_eal_param, + param=vhost_param, + no_pci=True, + iova_mode="va", + ) + self.launch_pdump_to_capture_pkt() + self.vhost_user_pmd.execute_cmd("set fwd txonly") + self.vhost_user_pmd.execute_cmd("async_vhost tx poll completed on") + self.send_6192_packets_from_vhost(set_csum=False) + self.check_packet_payload_valid(pkt_len=6192, check_payload=False) + + def tear_down(self): + """ + Run after each test case. + """ + self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#") + self.dut.kill_all() + self.DC.reset_all_work_queue() + self.DC.bind_all_dsa_to_kernel() + + def tear_down_all(self): + """ + Run after each test suite. + """ + self.dut.close_session(self.vhost_user) + self.dut.close_session(self.virtio_user) -- 2.25.1