Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/110502/?format=api
http://patchwork.dpdk.org/api/patches/110502/?format=api", "web_url": "http://patchwork.dpdk.org/project/dts/patch/20220429075736.21043-1-weix.ling@intel.com/", "project": { "id": 3, "url": "http://patchwork.dpdk.org/api/projects/3/?format=api", "name": "DTS", "link_name": "dts", "list_id": "dts.dpdk.org", "list_email": "dts@dpdk.org", "web_url": "", "scm_url": "git://dpdk.org/tools/dts", "webscm_url": "http://git.dpdk.org/tools/dts/", "list_archive_url": "https://inbox.dpdk.org/dts", "list_archive_url_format": "https://inbox.dpdk.org/dts/{}", "commit_url_format": "" }, "msgid": "<20220429075736.21043-1-weix.ling@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/20220429075736.21043-1-weix.ling@intel.com", "date": "2022-04-29T07:57:36", "name": "[V2,3/3] tests/basic_4k_pages_cbdma: add basic_4k_pages_cbdma testsuite", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "affa8a4f58ba59e83b69fc814f536942f6df1c78", "submitter": { "id": 1828, "url": "http://patchwork.dpdk.org/api/people/1828/?format=api", "name": "Ling, WeiX", "email": "weix.ling@intel.com" }, "delegate": null, "mbox": "http://patchwork.dpdk.org/project/dts/patch/20220429075736.21043-1-weix.ling@intel.com/mbox/", "series": [ { "id": 22731, "url": "http://patchwork.dpdk.org/api/series/22731/?format=api", "web_url": "http://patchwork.dpdk.org/project/dts/list/?series=22731", "date": "2022-04-29T07:56:14", "name": "add basic_4k_pages_cbdma", "version": 2, "mbox": "http://patchwork.dpdk.org/series/22731/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/110502/comments/", "check": "pending", "checks": "http://patchwork.dpdk.org/api/patches/110502/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dts-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 0C535A034C;\n\tFri, 29 Apr 2022 09:57:57 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 05E0742819;\n\tFri, 29 Apr 2022 09:57:57 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id 48877410E3\n for <dts@dpdk.org>; Fri, 29 Apr 2022 09:57:54 +0200 (CEST)", "from fmsmga008.fm.intel.com ([10.253.24.58])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 29 Apr 2022 00:57:53 -0700", "from unknown (HELO localhost.localdomain) ([10.239.251.222])\n by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 29 Apr 2022 00:57:51 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1651219074; x=1682755074;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=eRCCcqtLeojweDQtA0maiYKahy286HPGfFhfXh+wMZY=;\n b=FEpkydN4//aLTY0e0Ez1WBI/oqSe3i1d5jSG3RbgxEHiFoMmqrt+HTR6\n giIxOBqKzIa0Xftfi28cTy+/9T/W5mKfLL1V9ZZAQAkCjtlag8WRWzkJI\n j5WHtt56lk04uLtoBHTvey4OgbGAFnxVbK1lodZT+UvJXxKd9Vs1cDYcY\n 5YJ6vifCpPuZL1iIROcFsRSAo9vWbacAtXSodZnP6NEioVx2P14dOOTpd\n BZuIHwCcCh3dOUnw+91ezylu22P68IX+QxrE2qD0gfW0ayB1YURN9Wngr\n b4YJUH89lPyeww7jNo7Utz33vsopxawy9+MY4VhXAzsxSkB8RzIiUyBWU w==;", "X-IronPort-AV": [ "E=McAfee;i=\"6400,9594,10331\"; a=\"246484353\"", "E=Sophos;i=\"5.91,297,1647327600\"; d=\"scan'208\";a=\"246484353\"", "E=Sophos;i=\"5.91,297,1647327600\"; d=\"scan'208\";a=\"618563305\"" ], "From": "Wei Ling <weix.ling@intel.com>", "To": "dts@dpdk.org", "Cc": "Wei Ling <weix.ling@intel.com>", "Subject": "[dts][PATCH V2 3/3] tests/basic_4k_pages_cbdma: add\n basic_4k_pages_cbdma testsuite", "Date": "Fri, 29 Apr 2022 07:57:36 +0000", "Message-Id": "<20220429075736.21043-1-weix.ling@intel.com>", "X-Mailer": "git-send-email 2.34.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 <dts.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dts>,\n <mailto:dts-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dts/>", "List-Post": "<mailto:dts@dpdk.org>", "List-Help": "<mailto:dts-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dts>,\n <mailto:dts-request@dpdk.org?subject=subscribe>", "Errors-To": "dts-bounces@dpdk.org" }, "content": "As commit 53d3f4778c(vhost: integrate dmadev in asynchronous data-path),\nadd new testsuite basic_4k_pages_cbdma for coverage the pvp\nvirtio-user 4k pages with cbdma.\n1) Add new testsuite TestSuite_basic_4k_pages_cbdma.py into tests.\n\nSigned-off-by: Wei Ling <weix.ling@intel.com>\n---\n tests/TestSuite_basic_4k_pages_cbdma.py | 445 ++++++++++++++++++++++++\n 1 file changed, 445 insertions(+)\n create mode 100644 tests/TestSuite_basic_4k_pages_cbdma.py", "diff": "diff --git a/tests/TestSuite_basic_4k_pages_cbdma.py b/tests/TestSuite_basic_4k_pages_cbdma.py\nnew file mode 100644\nindex 00000000..e175c3d9\n--- /dev/null\n+++ b/tests/TestSuite_basic_4k_pages_cbdma.py\n@@ -0,0 +1,445 @@\n+# BSD LICENSE\n+#\n+# Copyright(c) <2022> Intel Corporation.\n+# All rights reserved.\n+#\n+# Redistribution and use in source and binary forms, with or without\n+# modification, are permitted provided that the following conditions\n+# are met:\n+#\n+# * Redistributions of source code must retain the above copyright\n+# notice, this list of conditions and the following disclaimer.\n+# * Redistributions in binary form must reproduce the above copyright\n+# notice, this list of conditions and the following disclaimer in\n+# the documentation and/or other materials provided with the\n+# distribution.\n+# * Neither the name of Intel Corporation nor the names of its\n+# contributors may be used to endorse or promote products derived\n+# from this software without specific prior written permission.\n+#\n+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+\"\"\"\n+DPDK Test suite.\n+vhost/virtio-user pvp with 4K pages.\n+\"\"\"\n+\n+import re\n+import time\n+\n+import framework.utils as utils\n+from framework.packet import Packet\n+from framework.pktgen import PacketGeneratorHelper\n+from framework.pmd_output import PmdOutput\n+from framework.test_case import TestCase\n+from framework.virt_common import VM\n+\n+\n+class TestBasic4kPagesCbdma(TestCase):\n+ def set_up_all(self):\n+ \"\"\"\n+ Run at the start of each test suite.\n+ \"\"\"\n+ self.dut_ports = self.dut.get_ports()\n+ self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])\n+ self.cores_num = len([n for n in self.dut.cores if int(n[\"socket\"]) == 0])\n+ self.verify(len(self.dut_ports) >= 1, \"Insufficient ports for testing\")\n+ self.verify(\n+ self.cores_num >= 4,\n+ \"There has not enought cores to test this suite %s\" % self.suite_name,\n+ )\n+ self.cores_list = self.dut.get_core_list(config=\"all\", socket=self.ports_socket)\n+ self.vhost_core_list = self.cores_list[0:9]\n+ self.virtio0_core_list = self.cores_list[9:11]\n+ self.vhost_user = self.dut.new_session(suite=\"vhost-user\")\n+ self.virtio_user0 = self.dut.new_session(suite=\"virtio-user\")\n+ self.vhost_user_pmd = PmdOutput(self.dut, self.vhost_user)\n+ self.virtio_user0_pmd = PmdOutput(self.dut, self.virtio_user0)\n+ self.pci_info = self.dut.ports_info[0][\"pci\"]\n+ self.dst_mac = self.dut.get_mac_address(self.dut_ports[0])\n+ self.frame_sizes = [64, 128, 256, 512, 1024, 1518]\n+ self.out_path = \"/tmp/%s\" % self.suite_name\n+ out = self.tester.send_expect(\"ls -d %s\" % self.out_path, \"# \")\n+ if \"No such file or directory\" in out:\n+ self.tester.send_expect(\"mkdir -p %s\" % self.out_path, \"# \")\n+ # create an instance to set stream field setting\n+ self.pktgen_helper = PacketGeneratorHelper()\n+ self.number_of_ports = 1\n+ self.app_testpmd_path = self.dut.apps_name[\"test-pmd\"]\n+ self.testpmd_name = self.app_testpmd_path.split(\"/\")[-1]\n+ self.vm_num = 2\n+ self.virtio_ip1 = \"1.1.1.1\"\n+ self.virtio_ip2 = \"1.1.1.2\"\n+ self.virtio_mac1 = \"52:54:00:00:00:01\"\n+ self.virtio_mac2 = \"52:54:00:00:00:02\"\n+ self.base_dir = self.dut.base_dir.replace(\"~\", \"/root\")\n+\n+ def set_up(self):\n+ \"\"\"\n+ Run before each test case.\n+ \"\"\"\n+ self.dut.send_expect(\"rm -rf /tmp/vhost-net*\", \"# \")\n+ self.dut.send_expect(\"killall -s INT %s\" % self.testpmd_name, \"# \")\n+ self.umount_tmpfs_for_4k()\n+ # Prepare the result table\n+ self.table_header = [\"Frame\"]\n+ self.table_header.append(\"Mode\")\n+ self.table_header.append(\"Mpps\")\n+ self.table_header.append(\"Queue Num\")\n+ self.table_header.append(\"% linerate\")\n+ self.result_table_create(self.table_header)\n+ self.vm_dut = []\n+ self.vm = []\n+\n+ def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num, allow_diff_socket=False):\n+ \"\"\"\n+ get and bind cbdma ports into DPDK driver\n+ \"\"\"\n+ self.all_cbdma_list = []\n+ self.cbdma_list = []\n+ self.cbdma_str = \"\"\n+ out = self.dut.send_expect(\n+ \"./usertools/dpdk-devbind.py --status-dev dma\", \"# \", 30\n+ )\n+ device_info = out.split(\"\\n\")\n+ for device in device_info:\n+ pci_info = re.search(\"\\s*(0000:\\S*:\\d*.\\d*)\", device)\n+ if pci_info is not None:\n+ dev_info = pci_info.group(1)\n+ # the numa id of ioat dev, only add the device which on same socket with nic dev\n+ bus = int(dev_info[5:7], base=16)\n+ if bus >= 128:\n+ cur_socket = 1\n+ else:\n+ cur_socket = 0\n+ if allow_diff_socket:\n+ self.all_cbdma_list.append(pci_info.group(1))\n+ else:\n+ if self.ports_socket == cur_socket:\n+ self.all_cbdma_list.append(pci_info.group(1))\n+ self.verify(\n+ len(self.all_cbdma_list) >= cbdma_num, \"There no enough cbdma device\"\n+ )\n+ self.cbdma_list = self.all_cbdma_list[0:cbdma_num]\n+ self.cbdma_str = \" \".join(self.cbdma_list)\n+ self.dut.send_expect(\n+ \"./usertools/dpdk-devbind.py --force --bind=%s %s\"\n+ % (self.drivername, self.cbdma_str),\n+ \"# \",\n+ 60,\n+ )\n+\n+ def bind_cbdma_device_to_kernel(self):\n+ self.dut.send_expect(\"modprobe ioatdma\", \"# \")\n+ self.dut.send_expect(\n+ \"./usertools/dpdk-devbind.py -u %s\" % self.cbdma_str, \"# \", 30\n+ )\n+ self.dut.send_expect(\n+ \"./usertools/dpdk-devbind.py --force --bind=ioatdma %s\" % self.cbdma_str,\n+ \"# \",\n+ 60,\n+ )\n+\n+ def send_and_verify(self):\n+ \"\"\"\n+ Send packet with packet generator and verify\n+ \"\"\"\n+ for frame_size in self.frame_sizes:\n+ tgen_input = []\n+ rx_port = self.tester.get_local_port(self.dut_ports[0])\n+ tx_port = self.tester.get_local_port(self.dut_ports[0])\n+ pkt = Packet(pkt_type=\"UDP\", pkt_len=frame_size)\n+ pkt.config_layer(\"ether\", {\"dst\": \"%s\" % self.dst_mac})\n+ pkt.save_pcapfile(self.tester, \"%s/vhost.pcap\" % self.out_path)\n+ tgen_input.append((tx_port, rx_port, \"%s/vhost.pcap\" % self.out_path))\n+\n+ self.tester.pktgen.clear_streams()\n+ streams = self.pktgen_helper.prepare_stream_from_tginput(\n+ tgen_input, 100, None, self.tester.pktgen\n+ )\n+ _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams)\n+ Mpps = pps / 1000000.0\n+ # self.verify(Mpps > self.check_value[frame_size],\n+ # \"%s of frame size %d speed verify failed, expect %s, result %s\" % (\n+ # self.running_case, frame_size, self.check_value[frame_size], Mpps))\n+ throughput = Mpps * 100 / float(self.wirespeed(self.nic, 64, 1))\n+ results_row = [frame_size]\n+ results_row.append(\"4K pages\")\n+ results_row.append(Mpps)\n+ results_row.append(\"1\")\n+ results_row.append(throughput)\n+ self.result_table_add(results_row)\n+\n+ def start_vhost_user_testpmd(self, cores, param=\"\", eal_param=\"\", ports=\"\"):\n+ \"\"\"\n+ launch the testpmd as virtio with vhost_user\n+ \"\"\"\n+ self.vhost_user_pmd.start_testpmd(\n+ cores=cores,\n+ param=param,\n+ eal_param=eal_param,\n+ ports=ports,\n+ prefix=\"vhost\",\n+ fixed_prefix=True,\n+ )\n+\n+ def start_virtio_user0_testpmd(self, cores, eal_param=\"\", param=\"\"):\n+ \"\"\"\n+ launch the testpmd as virtio with vhost_net0\n+ \"\"\"\n+ self.virtio_user0_pmd.start_testpmd(\n+ cores=cores,\n+ eal_param=eal_param,\n+ param=param,\n+ no_pci=True,\n+ prefix=\"virtio-user0\",\n+ fixed_prefix=True,\n+ )\n+\n+ def start_vms(\n+ self,\n+ setting_args=\"\",\n+ server_mode=False,\n+ opt_queue=None,\n+ vm_config=\"vhost_sample\",\n+ ):\n+ \"\"\"\n+ start one VM, each VM has one virtio device\n+ \"\"\"\n+ vm_params = {}\n+ if opt_queue is not None:\n+ vm_params[\"opt_queue\"] = opt_queue\n+\n+ for i in range(self.vm_num):\n+ vm_dut = None\n+ vm_info = VM(self.dut, \"vm%d\" % i, vm_config)\n+\n+ vm_params[\"driver\"] = \"vhost-user\"\n+ if not server_mode:\n+ vm_params[\"opt_path\"] = self.base_dir + \"/vhost-net%d\" % i\n+ else:\n+ vm_params[\"opt_path\"] = self.base_dir + \"/vhost-net%d\" % i + \",server\"\n+ vm_params[\"opt_mac\"] = \"52:54:00:00:00:0%d\" % (i + 1)\n+ vm_params[\"opt_settings\"] = setting_args\n+ vm_info.set_vm_device(**vm_params)\n+ time.sleep(3)\n+ try:\n+ vm_dut = vm_info.start(set_target=False)\n+ if vm_dut is None:\n+ raise Exception(\"Set up VM ENV failed\")\n+ except Exception as e:\n+ print((utils.RED(\"Failure for %s\" % str(e))))\n+ raise e\n+ self.vm_dut.append(vm_dut)\n+ self.vm.append(vm_info)\n+\n+ def config_vm_ip(self):\n+ \"\"\"\n+ set virtio device IP and run arp protocal\n+ \"\"\"\n+ vm1_intf = self.vm_dut[0].ports_info[0][\"intf\"]\n+ vm2_intf = self.vm_dut[1].ports_info[0][\"intf\"]\n+ self.vm_dut[0].send_expect(\n+ \"ifconfig %s %s\" % (vm1_intf, self.virtio_ip1), \"#\", 10\n+ )\n+ self.vm_dut[1].send_expect(\n+ \"ifconfig %s %s\" % (vm2_intf, self.virtio_ip2), \"#\", 10\n+ )\n+ self.vm_dut[0].send_expect(\n+ \"arp -s %s %s\" % (self.virtio_ip2, self.virtio_mac2), \"#\", 10\n+ )\n+ self.vm_dut[1].send_expect(\n+ \"arp -s %s %s\" % (self.virtio_ip1, self.virtio_mac1), \"#\", 10\n+ )\n+\n+ def config_vm_combined(self, combined=1):\n+ \"\"\"\n+ set virtio device combined\n+ \"\"\"\n+ vm1_intf = self.vm_dut[0].ports_info[0][\"intf\"]\n+ vm2_intf = self.vm_dut[1].ports_info[0][\"intf\"]\n+ self.vm_dut[0].send_expect(\n+ \"ethtool -L %s combined %d\" % (vm1_intf, combined), \"#\", 10\n+ )\n+ self.vm_dut[1].send_expect(\n+ \"ethtool -L %s combined %d\" % (vm2_intf, combined), \"#\", 10\n+ )\n+\n+ def start_iperf(self):\n+ \"\"\"\n+ run perf command between to vms\n+ \"\"\"\n+ iperf_server = \"iperf -s -i 1\"\n+ iperf_client = \"iperf -c {} -i 1 -t 60\".format(self.virtio_ip1)\n+ self.vm_dut[0].send_expect(\n+ \"{} > iperf_server.log &\".format(iperf_server), \"\", 10\n+ )\n+ self.vm_dut[1].send_expect(\n+ \"{} > iperf_client.log &\".format(iperf_client), \"\", 60\n+ )\n+ time.sleep(60)\n+\n+ def get_iperf_result(self):\n+ \"\"\"\n+ get the iperf test result\n+ \"\"\"\n+ self.table_header = [\"Mode\", \"[M|G]bits/sec\"]\n+ self.result_table_create(self.table_header)\n+ self.vm_dut[0].send_expect(\"pkill iperf\", \"# \")\n+ self.vm_dut[1].session.copy_file_from(\"%s/iperf_client.log\" % self.dut.base_dir)\n+ fp = open(\"./iperf_client.log\")\n+ fmsg = fp.read()\n+ fp.close()\n+ # remove the server report info from msg\n+ index = fmsg.find(\"Server Report\")\n+ if index != -1:\n+ fmsg = fmsg[:index]\n+ iperfdata = re.compile(\"\\S*\\s*[M|G]bits/sec\").findall(fmsg)\n+ # the last data of iperf is the ave data from 0-30 sec\n+ self.verify(len(iperfdata) != 0, \"The iperf data between to vms is 0\")\n+ self.logger.info(\"The iperf data between vms is %s\" % iperfdata[-1])\n+\n+ # put the result to table\n+ results_row = [\"vm2vm\", iperfdata[-1]]\n+ self.result_table_add(results_row)\n+\n+ # print iperf resut\n+ self.result_table_print()\n+ # rm the iperf log file in vm\n+ self.vm_dut[0].send_expect(\"rm iperf_server.log\", \"#\", 10)\n+ self.vm_dut[1].send_expect(\"rm iperf_client.log\", \"#\", 10)\n+\n+ def verify_xstats_info_on_vhost(self):\n+ \"\"\"\n+ check both 2VMs can receive and send big packets to each other\n+ \"\"\"\n+ self.vhost_user_pmd.execute_cmd(\"show port stats all\")\n+ out_tx = self.vhost_user_pmd.execute_cmd(\"show port xstats 0\")\n+ out_rx = self.vhost_user_pmd.execute_cmd(\"show port xstats 1\")\n+\n+ tx_info = re.search(\"tx_size_1523_to_max_packets:\\s*(\\d*)\", out_tx)\n+ rx_info = re.search(\"rx_size_1523_to_max_packets:\\s*(\\d*)\", out_rx)\n+\n+ self.verify(\n+ int(rx_info.group(1)) > 0, \"Port 1 not receive packet greater than 1522\"\n+ )\n+ self.verify(\n+ int(tx_info.group(1)) > 0, \"Port 0 not forward packet greater than 1522\"\n+ )\n+\n+ def mount_tmpfs_for_4k(self, number=1):\n+ \"\"\"\n+ Prepare tmpfs with 4K-pages\n+ \"\"\"\n+ for num in range(number):\n+ self.dut.send_expect(\"mkdir /mnt/tmpfs_nohuge{}\".format(num), \"# \")\n+ self.dut.send_expect(\n+ \"mount tmpfs /mnt/tmpfs_nohuge{} -t tmpfs -o size=4G\".format(num), \"# \"\n+ )\n+\n+ def umount_tmpfs_for_4k(self):\n+ \"\"\"\n+ Prepare tmpfs with 4K-pages\n+ \"\"\"\n+ out = self.dut.send_expect(\n+ \"mount |grep 'mnt/tmpfs' |awk -F ' ' {'print $3'}\", \"#\"\n+ )\n+ mount_infos = out.replace(\"\\r\", \"\").split(\"\\n\")\n+ if len(mount_infos) != 0:\n+ for mount_info in mount_infos:\n+ self.dut.send_expect(\"umount {}\".format(mount_info), \"# \")\n+\n+ def umount_huge_pages(self):\n+ self.dut.send_expect(\"mount |grep '/mnt/huge' |awk -F ' ' {'print $3'}\", \"#\")\n+ self.dut.send_expect(\"umount /mnt/huge\", \"# \")\n+\n+ def mount_huge_pages(self):\n+ self.dut.send_expect(\"mkdir -p /mnt/huge\", \"# \")\n+ self.dut.send_expect(\"mount -t hugetlbfs nodev /mnt/huge\", \"# \")\n+\n+ def test_perf_pvp_virtio_user_split_ring_with_4K_pages_and_cbdma_enable(self):\n+ \"\"\"\n+ Test Case 1: Basic test vhost/virtio-user split ring with 4K-pages and cbdma enable\n+ \"\"\"\n+ self.get_cbdma_ports_info_and_bind_to_dpdk(1)\n+ lcore_dma = f\"lcore{self.vhost_core_list[1]}@{self.cbdma_list[0]}\"\n+ vhost_eal_param = \"--no-huge -m 1024 --vdev 'net_vhost0,iface=./vhost-net,queues=1,dmas=[txq0]'\"\n+ vhost_param = \" --no-numa --socket-num={} --lcore-dma=[{}]\".format(\n+ self.ports_socket, lcore_dma\n+ )\n+ ports = [self.dut.ports_info[0][\"pci\"]]\n+ for i in self.cbdma_list:\n+ ports.append(i)\n+ self.start_vhost_user_testpmd(\n+ cores=self.vhost_core_list[0:2],\n+ eal_param=vhost_eal_param,\n+ param=vhost_param,\n+ ports=ports,\n+ )\n+ self.vhost_user_pmd.execute_cmd(\"start\")\n+ self.mount_tmpfs_for_4k(number=1)\n+ virtio_eal_param = \"--no-huge -m 1024 --vdev net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net,queues=1\"\n+ self.start_virtio_user0_testpmd(\n+ cores=self.virtio0_core_list, eal_param=virtio_eal_param\n+ )\n+ self.virtio_user0_pmd.execute_cmd(\"set fwd mac\")\n+ self.virtio_user0_pmd.execute_cmd(\"start\")\n+ self.send_and_verify()\n+ self.result_table_print()\n+\n+ def test_perf_pvp_virtio_user_packed_ring_with_4K_pages_and_cbdma_enable(self):\n+ \"\"\"\n+ Test Case 2: Basic test vhost/virtio-user packed ring with 4K-pages and cbdma enable\n+ \"\"\"\n+ self.get_cbdma_ports_info_and_bind_to_dpdk(1)\n+ lcore_dma = f\"lcore{self.vhost_core_list[1]}@{self.cbdma_list[0]}\"\n+ vhost_eal_param = \"--no-huge -m 1024 --vdev 'net_vhost0,iface=./vhost-net,queues=1,dmas=[txq0]'\"\n+ vhost_param = \" --no-numa --socket-num={} --lcore-dma=[{}]\".format(\n+ self.ports_socket, lcore_dma\n+ )\n+ ports = [self.dut.ports_info[0][\"pci\"]]\n+ for i in self.cbdma_list:\n+ ports.append(i)\n+ self.start_vhost_user_testpmd(\n+ cores=self.vhost_core_list[0:2],\n+ eal_param=vhost_eal_param,\n+ param=vhost_param,\n+ ports=ports,\n+ )\n+ self.vhost_user_pmd.execute_cmd(\"start\")\n+ self.mount_tmpfs_for_4k(number=1)\n+ virtio_eal_param = \"--no-huge -m 1024 --vdev net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net,packed_vq=1,queues=1\"\n+ self.start_virtio_user0_testpmd(\n+ cores=self.virtio0_core_list, eal_param=virtio_eal_param\n+ )\n+ self.virtio_user0_pmd.execute_cmd(\"set fwd mac\")\n+ self.virtio_user0_pmd.execute_cmd(\"start\")\n+ self.send_and_verify()\n+ self.result_table_print()\n+\n+ def tear_down(self):\n+ \"\"\"\n+ Run after each test case.\n+ \"\"\"\n+ self.virtio_user0_pmd.quit()\n+ self.vhost_user_pmd.quit()\n+ self.dut.send_expect(\"killall -s INT %s\" % self.testpmd_name, \"# \")\n+ self.bind_cbdma_device_to_kernel()\n+ self.umount_tmpfs_for_4k()\n+\n+ def tear_down_all(self):\n+ \"\"\"\n+ Run after each test suite.\n+ \"\"\"\n+ self.dut.close_session(self.vhost_user)\n+ self.dut.close_session(self.virtio_user0)\n", "prefixes": [ "V2", "3/3" ] }{ "id": 110502, "url": "