test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1 2/2] test_plans/*interrupt_pmd: transfer test cases
  2023-01-13 13:50 ` [dts] [PATCH V1 2/2] test_plans/*interrupt_pmd: " Song Jiale
@ 2023-01-13  8:17   ` lijuan.tu
  0 siblings, 0 replies; 3+ messages in thread
From: lijuan.tu @ 2023-01-13  8:17 UTC (permalink / raw)
  To: dts, Song Jiale; +Cc: Song Jiale

On Fri, 13 Jan 2023 13:50:15 +0000, Song Jiale <songx.jiale@intel.com> wrote:
> transfer pf cases from vf_interrupt_pmd suite to interrupt_pmd suite.
> cases list:
>     test_nic_interrupt_PF_vfio_pci
>     test_nic_interrupt_PF_igb_uio
> 
> Signed-off-by: Song Jiale <songx.jiale@intel.com>

Reviewed-by: Lijuan Tu <lijuan.tu@intel.com>
Series applied, thanks

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

* [dts] [PATCH V1 1/2] tests/*interrupt_pmd: transfer test cases
@ 2023-01-13 13:50 Song Jiale
  2023-01-13 13:50 ` [dts] [PATCH V1 2/2] test_plans/*interrupt_pmd: " Song Jiale
  0 siblings, 1 reply; 3+ messages in thread
From: Song Jiale @ 2023-01-13 13:50 UTC (permalink / raw)
  To: dts; +Cc: Song Jiale

transfer pf cases from vf_interrupt_pmd suite to interrupt_pmd suite.
cases list:
    test_nic_interrupt_PF_vfio_pci
    test_nic_interrupt_PF_igb_uio

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
 tests/TestSuite_interrupt_pmd.py    | 96 ++++++++++++++++++++++++++---
 tests/TestSuite_vf_interrupt_pmd.py | 53 +---------------
 2 files changed, 91 insertions(+), 58 deletions(-)

diff --git a/tests/TestSuite_interrupt_pmd.py b/tests/TestSuite_interrupt_pmd.py
index 2b77e052..311b5751 100644
--- a/tests/TestSuite_interrupt_pmd.py
+++ b/tests/TestSuite_interrupt_pmd.py
@@ -11,7 +11,8 @@ import string
 import time
 
 import framework.utils as utils
-from framework.test_case import TestCase
+from framework.packet import Packet
+from framework.test_case import TestCase, skip_unsupported_host_driver
 
 
 class TestInterruptPmd(TestCase):
@@ -22,9 +23,14 @@ class TestInterruptPmd(TestCase):
 
         self.dut_ports = self.dut.get_ports(self.nic)
         self.verify(len(self.dut_ports) >= 2, "Insufficient ports")
-        cores = self.dut.get_core_list("1S/4C/1T")
+        self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
+        self.core_list = self.dut.get_core_list("1S/4C/1T", socket=self.ports_socket)
         self.eal_para = self.dut.create_eal_parameters(cores="1S/4C/1T")
-        self.coremask = utils.create_mask(cores)
+
+        userport = self.tester.get_local_port(self.dut_ports[0])
+        self.tport_iface = self.tester.get_interface(userport)
+        self.tx_mac = self.tester.get_mac(userport)
+        self.rx_mac = self.dut.get_mac_address(self.dut_ports[0])
 
         self.path = self.dut.apps_name["l3fwd-power"]
 
@@ -76,12 +82,36 @@ class TestInterruptPmd(TestCase):
         """
         pass
 
+    def begin_l3fwd_power(self, use_dut, cmd, timeout=60):
+        """
+        begin l3fwd-power
+        """
+        try:
+            self.logger.info("Launch l3fwd_sample sample:")
+            use_dut.send_expect(cmd, " Link up", timeout=timeout)
+        except Exception as e:
+            self.dut.kill_all()
+            self.verify(
+                False, "ERROR: Failed to launch  l3fwd-power sample: %s" % str(e)
+            )
+
+    def send_packet(self, mac, tport_iface, use_dut):
+        """
+        Send a packet and verify
+        """
+        res = self.tester.is_interface_up(tport_iface)
+        self.verify(res, "tester port %s link status is down" % tport_iface)
+        pkt = Packet(pkt_type="UDP")
+        pkt.config_layer("ether", {"dst": mac, "src": self.tx_mac})
+        pkt.send_pkt(self.tester, tx_port=tport_iface)
+        self.out2 = use_dut.get_session_output(timeout=2)
+
     def test_different_queue(self):
         cmd = "%s %s -- -p 0x3 -P --config='(0,0,1),(1,0,2)' " % (
             self.path,
             self.eal_para,
         )
-        self.dut.send_expect(cmd, "L3FWD_POWER", 60)
+        self.begin_l3fwd_power(self.dut, cmd)
         portQueueLcore = self.trafficFlow["Flow1"]
         self.verifier_result(2, 2, portQueueLcore)
 
@@ -92,7 +122,7 @@ class TestInterruptPmd(TestCase):
             "%s %s -- -p 0x3 -P --config='(0,0,0),(0,1,1),(0,2,2),(0,3,3),(0,4,4)' "
             % (self.path, eal_para)
         )
-        self.dut.send_expect(cmd, "L3FWD_POWER", 120)
+        self.begin_l3fwd_power(self.dut, cmd)
         portQueueLcore = self.trafficFlow["Flow2"]
         self.verifier_result(20, 1, portQueueLcore)
 
@@ -106,10 +136,62 @@ class TestInterruptPmd(TestCase):
             % (self.path, eal_para)
         )
 
-        self.dut.send_expect(cmd, "L3FWD_POWER", 60)
+        self.begin_l3fwd_power(self.dut, cmd)
         portQueueLcore = self.trafficFlow["Flow3"]
         self.verifier_result(40, 2, portQueueLcore)
 
+    def test_nic_interrupt_PF_vfio_pci(self):
+        """
+        Check Interrupt for PF with vfio-pci driver
+        """
+        eal_para = self.dut.create_eal_parameters(cores=self.core_list)
+        cmd = "%s %s -- -P -p 1 --config='(0,0,%s)'" % (
+            self.path,
+            eal_para,
+            self.core_list[0],
+        )
+
+        self.begin_l3fwd_power(self.dut, cmd)
+
+        self.send_packet(self.rx_mac, self.tport_iface, self.dut)
+
+        self.verify(
+            "lcore %s is waked up from rx interrupt on port 0" % self.core_list[0]
+            in self.out2,
+            "Wake up failed",
+        )
+        self.verify(
+            "lcore %s sleeps until interrupt triggers" % self.core_list[0] in self.out2,
+            "lcore %s not sleeps" % self.core_list[0],
+        )
+
+    @skip_unsupported_host_driver(["vfio-pci"])
+    def test_nic_interrupt_PF_igb_uio(self):
+        """
+        Check Interrupt for PF with igb_uio driver
+        """
+        self.dut.setup_modules_linux(self.target, "igb_uio", "")
+        self.dut.ports_info[0]["port"].bind_driver(driver="igb_uio")
+
+        eal_para = self.dut.create_eal_parameters(cores=self.core_list)
+        cmd = "%s %s -- -P -p 1 --config='(0,0,%s)'" % (
+            self.path,
+            eal_para,
+            self.core_list[0],
+        )
+        self.begin_l3fwd_power(self.dut, cmd)
+        self.send_packet(self.rx_mac, self.tport_iface, self.dut)
+
+        self.verify(
+            "lcore %s is waked up from rx interrupt on port 0" % self.core_list[0]
+            in self.out2,
+            "Wake up failed",
+        )
+        self.verify(
+            "lcore %s sleeps until interrupt triggers" % self.core_list[0] in self.out2,
+            "lcore %s not sleeps" % self.core_list[0],
+        )
+
     def verifier_result(self, num, portnum, portQueueLcore):
         self.scapy_send_packet(num, portnum)
         result = self.dut.get_session_output(timeout=5)
@@ -150,7 +232,7 @@ class TestInterruptPmd(TestCase):
         """
         Run after each test case.
         """
-        pass
+        self.dut.kill_all()
 
     def tear_down_all(self):
         """
diff --git a/tests/TestSuite_vf_interrupt_pmd.py b/tests/TestSuite_vf_interrupt_pmd.py
index 4f78aea0..4a84c917 100644
--- a/tests/TestSuite_vf_interrupt_pmd.py
+++ b/tests/TestSuite_vf_interrupt_pmd.py
@@ -13,7 +13,7 @@ import time
 
 import framework.utils as utils
 from framework.packet import Packet
-from framework.test_case import TestCase, skip_unsupported_host_driver
+from framework.test_case import TestCase
 from framework.virt_common import VM
 
 
@@ -104,9 +104,7 @@ class TestVfInterruptPmd(TestCase):
         )
         try:
             self.logger.info("Launch l3fwd_sample sample:")
-            self.out = use_dut.send_expect(
-                cmd_vhost_net, "Checking link statusdone", 60
-            )
+            self.out = use_dut.send_expect(cmd_vhost_net, "Link up", 60)
             if "Error" in self.out:
                 raise Exception("Launch l3fwd-power sample failed")
             else:
@@ -266,53 +264,6 @@ class TestVfInterruptPmd(TestCase):
             "lcore %s not sleeps" % self.core_user,
         )
 
-    def test_nic_interrupt_PF_vfio_pci(self):
-        """
-        Check Interrupt for PF with vfio-pci driver
-        """
-        self.prepare_l3fwd_power(self.dut)
-
-        self.dut.ports_info[0]["port"].bind_driver(driver="vfio-pci")
-
-        self.begin_l3fwd_power(self.dut)
-
-        self.send_packet(self.mac_port_0, self.rx_intf_0, self.dut)
-
-        self.verify(
-            "lcore %s is waked up from rx interrupt on port 0" % self.core_user
-            in self.out2,
-            "Wake up failed",
-        )
-        self.verify(
-            "lcore %s sleeps until interrupt triggers" % self.core_user in self.out2,
-            "lcore %s not sleeps" % self.core_user,
-        )
-
-    @skip_unsupported_host_driver(["vfio-pci"])
-    def test_nic_interrupt_PF_igb_uio(self):
-        """
-        Check Interrupt for PF with igb_uio driver
-        """
-        self.prepare_l3fwd_power(self.dut)
-
-        self.dut.setup_modules_linux(self.target, "igb_uio", "")
-
-        self.dut.ports_info[0]["port"].bind_driver(driver="igb_uio")
-
-        self.begin_l3fwd_power(self.dut)
-
-        self.send_packet(self.mac_port_0, self.rx_intf_0, self.dut)
-
-        self.verify(
-            "lcore %s is waked up from rx interrupt on port 0" % self.core_user
-            in self.out2,
-            "Wake up failed",
-        )
-        self.verify(
-            "lcore %s sleeps until interrupt triggers" % self.core_user in self.out2,
-            "lcore %s not sleeps" % self.core_user,
-        )
-
     def test_nic_multi_queues_interrupt_VF_vfio_pci(self, driver="default"):
         """
         Check Interrupt for VF with vfio driver, need test with i40e driver
-- 
2.25.1


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

* [dts] [PATCH V1 2/2] test_plans/*interrupt_pmd: transfer test cases
  2023-01-13 13:50 [dts] [PATCH V1 1/2] tests/*interrupt_pmd: transfer test cases Song Jiale
@ 2023-01-13 13:50 ` Song Jiale
  2023-01-13  8:17   ` lijuan.tu
  0 siblings, 1 reply; 3+ messages in thread
From: Song Jiale @ 2023-01-13 13:50 UTC (permalink / raw)
  To: dts; +Cc: Song Jiale

transfer pf cases from vf_interrupt_pmd suite to interrupt_pmd suite.
cases list:
    test_nic_interrupt_PF_vfio_pci
    test_nic_interrupt_PF_igb_uio

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
 test_plans/interrupt_pmd_test_plan.rst    | 52 +++++++++++++++++----
 test_plans/vf_interrupt_pmd_test_plan.rst | 56 ++---------------------
 2 files changed, 48 insertions(+), 60 deletions(-)

diff --git a/test_plans/interrupt_pmd_test_plan.rst b/test_plans/interrupt_pmd_test_plan.rst
index d812ad0c..38ee79d2 100644
--- a/test_plans/interrupt_pmd_test_plan.rst
+++ b/test_plans/interrupt_pmd_test_plan.rst
@@ -104,16 +104,50 @@ driver.
 Plug in Port1 cable, check that link up interrupt captured and handled by pmd
 driver.
 
+Test Case3: Check Interrupt for PF with vfio driver on ixgbe and i40e
+=====================================================================
 
-Test Case3: PF interrupt pmd latency test
-=========================================
+1. Bind NIC PF to vfio-pci drvier::
 
-Setup validation scenario the case as test1
-Send burst packet flow to Port0 and Port1, use IXIA capture the maximum
-latency.
+    modprobe vfio-pci;
 
-Compare latency(l3fwd-power PF interrupt pmd with uio) with l3fwd latency.
+    ./usertools/dpdk-devbind.py --bind=vfio-pci 0000:04:00.0
+
+2. start l3fwd-power with PF::
+
+    ./x86_64-native-linuxapp-gcc/examples/dpdk-l3fwd-power -l 1-4 -n 4 -- -P -p 0x01  --config '(0,0,2)'
+
+3. Send packet with packet generator to the pf NIC, check that thread core2 waked up::
+
+    sendp([Ether(dst='pf_mac')/IP()/UDP()/Raw(load='XXXXXXXXXXXXXXXXXX')], iface="tester_intf")
+
+    L3FWD_POWER: lcore 2 is waked up from rx interrupt on port 0 queue 0
+
+4. Check if threads on core 2 have returned to sleep mode::
+
+    L3FWD_POWER: lcore 2 sleeps until interrupt triggers
+
+Test Case4: Check Interrupt for PF with igb_uio driver on ixgbe and i40e
+========================================================================
+
+1. Bind NIC PF to igb_uio drvier::
+
+    modprobe uio;
+    insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko;
+
+    ./usertools/dpdk-devbind.py --bind=igb_uio 0000:04:00.0
+
+2. start l3fwd-power with PF::
+
+    ./x86_64-native-linuxapp-gcc/examples/dpdk-l3fwd-power -l 1-4 -n 4 -- -P -p 0x01  --config '(0,0,2)'
+
+3. Send packet with packet generator to the pf NIC, check that thread core2 waked up::
+
+    sendp([Ether(dst='pf_mac')/IP()/UDP()/Raw(load='XXXXXXXXXXXXXXXXXX')], iface="tester_intf")
+
+    L3FWD_POWER: lcore 2 is waked up from rx interrupt on port 0 queue 0
+
+4. Check if threads on core 2 have returned to sleep mode::
+
+    L3FWD_POWER: lcore 2 sleeps until interrupt triggers
 
-Setup validation scenario the case as test2
-Send burst packet flow to Port0 and Port1, use IXIA capture the maximum
-latency.
diff --git a/test_plans/vf_interrupt_pmd_test_plan.rst b/test_plans/vf_interrupt_pmd_test_plan.rst
index b7cdeb3e..910b5ee7 100644
--- a/test_plans/vf_interrupt_pmd_test_plan.rst
+++ b/test_plans/vf_interrupt_pmd_test_plan.rst
@@ -39,54 +39,7 @@ Modify the DPDK-l3fwd-power source code and recompile the l3fwd-power::
 Support igb_uio and vfio driver, if used vfio, kernel need 3.6+ and enable vt-d
 in bios. When used vfio, requested to insmod two drivers vfio and vfio-pci.
 
-Test Case1: Check Interrupt for PF with vfio driver on ixgbe and i40e
-=====================================================================
-
-1. Bind NIC PF to vfio-pci drvier::
-
-    modprobe vfio-pci;
-
-    ./usertools/dpdk-devbind.py --bind=vfio-pci 0000:04:00.0
-
-2. start l3fwd-power with PF::
-
-    ./x86_64-native-linuxapp-gcc/examples/dpdk-l3fwd-power -l 1-3 -n 4 -- -P -p 0x01  --config '(0,0,2)'
-
-3. Send packet with packet generator to the pf NIC, check that thread core2 waked up::
-
-    sendp([Ether(dst='pf_mac')/IP()/UDP()/Raw(load='XXXXXXXXXXXXXXXXXX')], iface="tester_intf")
-
-    L3FWD_POWER: lcore 2 is waked up from rx interrupt on port 0 queue 0
-
-4. Check if threads on core 2 have returned to sleep mode::
-
-    L3FWD_POWER: lcore 2 sleeps until interrupt triggers
-
-Test Case2: Check Interrupt for PF with igb_uio driver on ixgbe and i40e
-========================================================================
-
-1. Bind NIC PF to igb_uio drvier::
-
-    modprobe uio;
-    insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko;
-
-    ./usertools/dpdk-devbind.py --bind=igb_uio 0000:04:00.0
-
-2. start l3fwd-power with PF::
-
-    ./x86_64-native-linuxapp-gcc/examples/dpdk-l3fwd-power -l 1-3 -n 4 -- -P -p 0x01  --config '(0,0,2)'
-
-3. Send packet with packet generator to the pf NIC, check that thread core2 waked up::
-
-    sendp([Ether(dst='pf_mac')/IP()/UDP()/Raw(load='XXXXXXXXXXXXXXXXXX')], iface="tester_intf")
-
-    L3FWD_POWER: lcore 2 is waked up from rx interrupt on port 0 queue 0
-
-4. Check if threads on core 2 have returned to sleep mode::
-
-    L3FWD_POWER: lcore 2 sleeps until interrupt triggers
-
-Test Case3: Check Interrupt for VF with vfio driver on ixgbe and i40e
+Test Case1: Check Interrupt for VF with vfio driver on ixgbe and i40e
 =====================================================================
 
 1. Generate NIC VF, then bind it to vfio drvier::
@@ -112,7 +65,7 @@ Test Case3: Check Interrupt for VF with vfio driver on ixgbe and i40e
 
     L3FWD_POWER: lcore 2 sleeps until interrupt triggers
 
-Test Case4: VF interrupt pmd in VM with vfio-pci
+Test Case2: VF interrupt pmd in VM with vfio-pci
 ================================================
 
 1. Generate NIC VF, then bind it to vfio drvier::
@@ -160,7 +113,7 @@ Test Case4: VF interrupt pmd in VM with vfio-pci
 
     L3FWD_POWER: lcore 2 sleeps until interrupt triggers
 
-Test Case5: vf multi-queue interrupt with vfio-pci on i40e 
+Test Case3: vf multi-queue interrupt with vfio-pci on i40e
 ==========================================================
 
 1. Generate NIC VF, then bind it to vfio drvier::
@@ -187,7 +140,7 @@ Test Case5: vf multi-queue interrupt with vfio-pci on i40e
     L3FWD_POWER: lcore 3 is waked up from rx interrupt on port 0 queue 2
     L3FWD_POWER: lcore 4 is waked up from rx interrupt on port 0 queue 3
 
-Test Case6: VF multi-queue interrupt in VM with vfio-pci on i40e
+Test Case4: VF multi-queue interrupt in VM with vfio-pci on i40e
 ================================================================
     
 1. Generate NIC VF, then bind it to vfio drvier::
@@ -233,3 +186,4 @@ Test Case6: VF multi-queue interrupt in VM with vfio-pci on i40e
     L3FWD_POWER: lcore 1 is waked up from rx interrupt on port 0 queue 1
     L3FWD_POWER: lcore 2 is waked up from rx interrupt on port 0 queue 2
     L3FWD_POWER: lcore 3 is waked up from rx interrupt on port 0 queue 3
+
-- 
2.25.1


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

end of thread, other threads:[~2023-01-13  8:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13 13:50 [dts] [PATCH V1 1/2] tests/*interrupt_pmd: transfer test cases Song Jiale
2023-01-13 13:50 ` [dts] [PATCH V1 2/2] test_plans/*interrupt_pmd: " Song Jiale
2023-01-13  8:17   ` 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).