test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V1] ntb: delete igb_uio driver related testcases
@ 2023-06-01  8:31 Wei Ling
  2023-06-07  7:53 ` lijuan.tu
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Ling @ 2023-06-01  8:31 UTC (permalink / raw)
  To: dts; +Cc: Wei Ling

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 <weix.ling@intel.com>
---
 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)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dts][PATCH V1] ntb: delete igb_uio driver related testcases
  2023-06-01  8:31 [dts][PATCH V1] ntb: delete igb_uio driver related testcases Wei Ling
@ 2023-06-07  7:53 ` lijuan.tu
  0 siblings, 0 replies; 2+ messages in thread
From: lijuan.tu @ 2023-06-07  7:53 UTC (permalink / raw)
  To: dts, Wei Ling; +Cc: Wei Ling

On Thu,  1 Jun 2023 16:31:53 +0800, Wei Ling <weix.ling@intel.com> wrote:
> 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 <weix.ling@intel.com>


Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-07  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-01  8:31 [dts][PATCH V1] ntb: delete igb_uio driver related testcases Wei Ling
2023-06-07  7:53 ` lijuan.tu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).