From patchwork Thu Jun 1 08:31:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 127826 Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 0E80542C01; Thu, 1 Jun 2023 10:32:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05A5140EF0; Thu, 1 Jun 2023 10:32:36 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 289A3406B3 for ; Thu, 1 Jun 2023 10:32:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685608354; x=1717144354; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=8esGlBeggOiu6SIeVwUM4NM0NZgqRsqSsoPmmRWzhDo=; b=LL1s/JPgE8qL8lRRFefJQLQR2rSgAcsIMKSlU0gmr6R5WHBXkuiegyiL IMEAC7oHivEZiY/uMweFkXCFGqgi+ULJvEQYFMlfO2JeVMsjAELGrFrqo Gu7hr2lirnPs+ILVUw/ndbWFvXOHD8CE1+FlOXFfC9FUHvSCdH6Z31HPZ 3p6gYLIWTc/Rr9YdkJR8L5oi/8RsG3ZWbl5to9VFOH4IvGq4jC52Fwj92 pW84wdM8pJieJOAfkwEoF0bF5Qz1Pb4A6R+YVgBRK/SkfFaGO4PUdojkf tL2+GrShoj651K42+J7Fk2nvf+0cQurwq4he6JSI8Qrjt9MRTFolfR01w Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10727"; a="441855282" X-IronPort-AV: E=Sophos;i="6.00,209,1681196400"; d="scan'208";a="441855282" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2023 01:32:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10727"; a="710396601" X-IronPort-AV: E=Sophos;i="6.00,209,1681196400"; d="scan'208";a="710396601" Received: from unknown (HELO dut222..) ([10.239.252.222]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2023 01:32:03 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V1] ntb: delete igb_uio driver related testcases Date: Thu, 1 Jun 2023 16:31:53 +0800 Message-Id: <20230601083153.82588-1-weix.ling@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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.Delete 3 igb_uio driver related testcases. 2.Optimize hard code to get the NTB device info to enable WC. Signed-off-by: Wei Ling --- test_plans/ntb_test_plan.rst | 119 ++++++++--------------------------- tests/TestSuite_ntb.py | 78 ++++++----------------- 2 files changed, 46 insertions(+), 151 deletions(-) diff --git a/test_plans/ntb_test_plan.rst b/test_plans/ntb_test_plan.rst index 8d788a19..4256a326 100644 --- a/test_plans/ntb_test_plan.rst +++ b/test_plans/ntb_test_plan.rst @@ -67,43 +67,20 @@ The application is console-driven using the cmdline DPDK interface: * ``set fwd file-trans/rxonly/txonly/iofwd``: Set packet forwarding mode. * ``quit``: Exit program. -Test Case1: NTB test with file-trans fwd mode using igb_uio -=========================================================== - -1. Insmod kernel module and bind Non-Transparent Bridge to igb_uio driver on two host machines separately:: - - insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko wc_activate=1 - ./usertools/dpdk-devbind.py -b igb_uio ae:00.0 - -2. Launch ntb_fwd sample on Machine1:: - - ./x86_64-native-linuxapp-gcc/examples/dpdk-ntb -l 28-32 -n 6 -- -i --buf-size=65407 - >set fwd file-trans - >start - -3. Launch ntb_fwd sample on Machine2:: - - ./x86_64-native-linuxapp-gcc/examples/dpdk-ntb -l 28-32 -n 6 -- -i --buf-size=65407 - >set fwd file-trans - >start - -4. Send file from Machine1:: - - >send xxx # [xxx] is srouce absolute path + file - -5. Check file can be received on Machine2 fixed path. - -Test Case2: NTB test with file-trans fwd mode using vfio-pci +Test Case1: NTB test with file-trans fwd mode using vfio-pci ============================================================ 1. Insmod kernel module and bind Non-Transparent Bridge to vfio-pci driver on two host machines separately:: - insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko insmod vfio-pci - lspci -vv -s ae:00.0 - echo "base=0x39bfa0000000 size=0x400000 type=write-combining" >> /proc/mtrr - echo "base=0x39bfa0000000 size=0x4000000 type=write-combining" >> /proc/mtrr - ./usertools/dpdk-devbind.py -b vfio-pci ae:00.0 + lspci -vv -s 97:09.0 + Region 2: Memory at cffc0000000 (64-bit, prefetchable) [size=512M] + Region 4: Memory at cffa0000000 (64-bit, prefetchable) [size=512M] + base is cffc0000000 and cffa0000000. + size is hex(512*1024*1024). + echo "base=0xcffa0000000 size=0x20000000 type=write-combining" >> /proc/mtrr + echo "base=0xcffc0000000 size=0x20000000 type=write-combining" >> /proc/mtrr + ./usertools/dpdk-devbind.py -b vfio-pci 97:09.0 2. Launch ntb_fwd sample on Machine1:: @@ -123,41 +100,20 @@ Test Case2: NTB test with file-trans fwd mode using vfio-pci 5. Check file can be received on Machine2 fixed path. -Test Case3: NTB test with rxonly/txonly fwd mode using igb_uio -============================================================== - -1. Insmod kernel module and bind Non-Transparent Bridge to igb_uio driver on two host machines separately:: - - insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko wc_activate=1 - ./usertools/dpdk-devbind.py -b igb_uio ae:00.0 - -2. Launch ntb_fwd sample on Machine1:: - - ./x86_64-native-linuxapp-gcc/examples/dpdk-ntb -l 28-32 -n 6 -- -i --buf-size=65407 - >set fwd rxonly - >start - >show port stats - -3. Launch ntb_fwd sample on Machine2:: - - ./x86_64-native-linuxapp-gcc/examples/dpdk-ntb -l 28-32 -n 6 -- -i --buf-size=65407 - >set fwd txonly - >start - >show port stats - -4. Check throughput with log info on two machines. - -Test Case4: NTB test with rxonly/txonly fwd mode using vfio-pci +Test Case2: NTB test with rxonly/txonly fwd mode using vfio-pci =============================================================== 1. Insmod kernel module and bind Non-Transparent Bridge to vfio-pci driver on two host machines separately:: - insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko insmod vfio-pci - lspci -vv -s ae:00.0 - echo "base=0x39bfa0000000 size=0x400000 type=write-combining" >> /proc/mtrr - echo "base=0x39bfa0000000 size=0x4000000 type=write-combining" >> /proc/mtrr - ./usertools/dpdk-devbind.py -b vfio-pci ae:00.0 + lspci -vv -s 97:09.0 + Region 2: Memory at cffc0000000 (64-bit, prefetchable) [size=512M] + Region 4: Memory at cffa0000000 (64-bit, prefetchable) [size=512M] + base is cffc0000000 and cffa0000000. + size is hex(512*1024*1024). + echo "base=0xcffa0000000 size=0x20000000 type=write-combining" >> /proc/mtrr + echo "base=0xcffc0000000 size=0x20000000 type=write-combining" >> /proc/mtrr + ./usertools/dpdk-devbind.py -b vfio-pci 97:09.0 2. Launch ntb_fwd sample on Machine1:: @@ -175,43 +131,20 @@ Test Case4: NTB test with rxonly/txonly fwd mode using vfio-pci 4. Check throughput with log info on two machines. -Test Case5: NTB test with io fwd mode using igb_uio -=================================================== -Test flow: TG <-> NIC1 <-> NTB1 <-> NTB2 <-> NIC2 <-> TG - -1. Insmod kernel module and bind Non-Transparent Bridge and NIC to igb_uio driver on two host machines separately:: - - insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko wc_activate=1 - ./usertools/dpdk-devbind.py -b igb_uio xx:xx.x # xx:xx.x is NTB - ./usertools/dpdk-devbind.py -b igb_uio xx:xx.x # xx:xx.x is NIC - -2. Launch ntb_fwd sample on Machine1:: - - ./x86_64-native-linuxapp-gcc/examples/dpdk-ntb -l 28-32 -n 6 -- -i --fwd-mode=iofwd --burst=32 - >set fwd iofwd - >start - >show port stats - -3. Launch ntb_fwd sample on Machine2:: - - ./x86_64-native-linuxapp-gcc/examples/dpdk-ntb -l 28-32 -n 6 -- -i --fwd-mode=iofwd --burst=32 - >set fwd iofwd - >start - >show port stats - -4. Send packets (dest mac= nic mac address) with TG and check throughput with log info on two machines. - -Test Case6: NTB test with io fwd mode using vfio-pci +Test Case3: NTB test with io fwd mode using vfio-pci ==================================================== Test flow: TG <-> NIC1 <-> NTB1 <-> NTB2 <-> NIC2 <-> TG 1. Insmod kernel module and bind Non-Transparent Bridge and NIC to vfio-pci driver on two host machines separately:: - insmod x86_64-native-linuxapp-gcc/kmod/vfio-pci.ko insmod vfio-pci - lspci -vv -s ae:00.0 - echo "base=0x39bfa0000000 size=0x400000 type=write-combining" >> /proc/mtrr - echo "base=0x39bfa0000000 size=0x4000000 type=write-combining" >> /proc/mtrr + lspci -vv -s 97:09.0 + Region 2: Memory at cffc0000000 (64-bit, prefetchable) [size=512M] + Region 4: Memory at cffa0000000 (64-bit, prefetchable) [size=512M] + base is cffc0000000 and cffa0000000. + size is hex(512*1024*1024). + echo "base=0xcffa0000000 size=0x20000000 type=write-combining" >> /proc/mtrr + echo "base=0xcffc0000000 size=0x20000000 type=write-combining" >> /proc/mtrr ./usertools/dpdk-devbind.py -b vfio-pci xx:xx.x # xx:xx.x is NTB ./usertools/dpdk-devbind.py -b vfio-pci xx:xx.x # xx:xx.x is NIC diff --git a/tests/TestSuite_ntb.py b/tests/TestSuite_ntb.py index 3c3d765a..38d36689 100644 --- a/tests/TestSuite_ntb.py +++ b/tests/TestSuite_ntb.py @@ -54,10 +54,6 @@ class TestNtb(TestCase): self.result_table_create(self.table_header) def prepare_dpdk_app(self, crb): - out = crb.send_expect("ls ./" + crb.target + "/kmod/igb_uio.ko", "#", 10) - if "No such file or directory" in out: - crb.build_install_dpdk(crb.target) - out = crb.build_dpdk_apps("./examples/ntb") self.verify("Error" not in out, "Compilation error") self.verify("No such" not in out, "Compilation error") @@ -74,9 +70,7 @@ class TestNtb(TestCase): ) def get_ntb_port(self, crb): - device = crb.send_expect( - "lspci -D | grep Non-Transparent |awk '{{print $1}}'", "# ", 10 - ) + device = crb.send_expect("lspci -D | grep 347e |awk '{{print $1}}'", "# ", 10) self.verify(device, "Falied to find ntb device") addr_array = device.strip().split(":") domain_id = addr_array[0] @@ -85,25 +79,26 @@ class TestNtb(TestCase): port = GetNicObj(crb, domain_id, bus_id, devfun_id) return port + def get_ntb_base_and_size(self, crb): + pci = self.get_ntb_port(crb).pci + out = crb.send_expect("lspci -vv -s %s" % pci, "# ", 10) + reg = "Region \d+: Memory at (\w+) \(64-bit, prefetchable\) \[size=(\d+)M\]" + ntb_infos = re.findall(reg, out) + return ntb_infos + def set_driver(self, driver=""): self.ntb_host.restore_interfaces() self.ntb_client.restore_interfaces() for crb in [self.ntb_host, self.ntb_client]: crb.setup_modules(crb.target, driver, None) - if driver == "igb_uio": - crb.send_expect("rmmod -f igb_uio", "#", 30) - crb.send_expect( - "insmod ./" + crb.target + "/kmod/igb_uio.ko wc_activate=1", "#", 30 - ) - if driver == "vfio-pci": + ntb_infos = self.get_ntb_base_and_size(crb) + for ntb_info in ntb_infos: + base = ntb_info[0] + size = hex(int(ntb_info[1]) * 1024 * 1024) crb.send_expect( - "echo 'base=0x39bfa0000000 size=0x400000 type=write-combining' >> /proc/mtrr", - "#", - 10, - ) - crb.send_expect( - "echo 'base=0x39bfa0000000 size=0x4000000 type=write-combining' >> /proc/mtrr", + "echo 'base=0x%s size=%s type=write-combining' >> /proc/mtrr" + % (base, size), "#", 10, ) @@ -127,15 +122,17 @@ class TestNtb(TestCase): self.get_core_list() app = self.dut.apps_name["ntb"] - eal_host = self.ntb_host.create_eal_parameters(cores=self.host_core_list) - eal_client = self.ntb_client.create_eal_parameters(cores=self.client_core_list) + eal_host = self.ntb_host.create_eal_parameters( + cores=self.host_core_list, ports=[self.get_ntb_port(self.ntb_host).pci] + ) + eal_client = self.ntb_client.create_eal_parameters( + cores=self.client_core_list, ports=[self.get_ntb_port(self.ntb_client).pci] + ) host_cmd_line = " ".join([app, eal_host, cmd_opt]) client_cmd_line = " ".join([app, eal_client, cmd_opt]) self.ntb_host.send_expect(host_cmd_line, "Checking ntb link status", 30) self.ntb_client.send_expect(client_cmd_line, "ntb>", 30) time.sleep(3) - # self.ntb_host.send_expect(" ", 'ntb> ', 10) - # self.ntb_client.send_expect(" ", 'ntb> ', 10) def start_ntb_fwd_on_dut(self, crb, fwd_mode="io"): crb.send_expect("set fwd %s" % fwd_mode, "ntb> ", 30) @@ -253,16 +250,6 @@ class TestNtb(TestCase): self.check_packets_for_iofwd() self.update_table_info(result) - def test_file_tran_mode_and_igb_uio(self): - driver = "igb_uio" - self.set_driver(driver) - self.ntb_bind_driver(driver) - - self.launch_ntb_fwd(**{"buf-size": 65407}) - self.start_ntb_fwd_on_dut(self.ntb_host, fwd_mode="file-trans") - self.start_ntb_fwd_on_dut(self.ntb_client, fwd_mode="file-trans") - self.send_file_and_verify() - def test_file_tran_mode_and_vfio_pci(self): driver = "vfio-pci" self.set_driver(driver) @@ -273,17 +260,6 @@ class TestNtb(TestCase): self.start_ntb_fwd_on_dut(self.ntb_client, fwd_mode="file-trans") self.send_file_and_verify() - def test_pkt_rxtx_mode_and_igb_uio(self): - driver = "igb_uio" - self.set_driver(driver) - self.ntb_bind_driver(driver) - - self.launch_ntb_fwd(**{"buf-size": 65407}) - self.start_ntb_fwd_on_dut(self.ntb_host, fwd_mode="rxonly") - self.start_ntb_fwd_on_dut(self.ntb_client, fwd_mode="txonly") - time.sleep(1) - self.check_packets_for_rxtx() - def test_pkt_rxtx_mode_and_vfio_pci(self): driver = "vfio-pci" self.set_driver(driver) @@ -295,20 +271,6 @@ class TestNtb(TestCase): time.sleep(1) self.check_packets_for_rxtx() - def test_perf_iofwd_mode_and_igb_uio(self): - driver = "igb_uio" - self.set_driver(driver) - self.ntb_bind_driver(driver) - self.port_bind_driver(driver) - - self.create_table() - self.launch_ntb_fwd(**{"burst": 32}) - self.start_ntb_fwd_on_dut(self.ntb_host, fwd_mode="iofwd") - self.start_ntb_fwd_on_dut(self.ntb_client, fwd_mode="iofwd") - self.send_pkg_and_verify() - - self.result_table_print() - def test_perf_iofwd_mode_and_vfio_pci(self): driver = "vfio-pci" self.set_driver(driver)