From patchwork Fri Jan 13 13:50:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 122001 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 6A48A423BE; Fri, 13 Jan 2023 06:52:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FBC9410EF; Fri, 13 Jan 2023 06:52:37 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 8F1DE410D4 for ; Fri, 13 Jan 2023 06:52:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673589155; x=1705125155; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=f6pAjZvC0CT01b+j40uNQ+bZWvAFoddZJ/hC2fjWII4=; b=kQgruv19P+CjUG5CpTG7oJ9BOzMx4l9D0CuzGT+I135tJyKCvaokwasa z8AVh0ptFygH9/7MceKAx7V1G1CDEjn7Oskd7CU3DiutIS2eA6MO4qjC9 w1/QP6fkuDqcBNcTG2LfKbR7R1fVj8KX9B9KRjiaYef2RKjG1N+LHE7kc QjIlzLqIgwOZ0mTydUM5l7ARQF85visPybpUWTjVQRPHRT0A56ctSkp8m ixarrtoIUgTnJ/WDkaNh6Okg6CO/j5izWrKQutzQ+W5EctmXndzsZ4Asj uFNG7uRjOksTY4rvk2wqK9vT3Y/ntKPg202sUDOIOO5Ge+KGlTRr2cSTK Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="323980546" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="323980546" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 21:52:34 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="688629949" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="688629949" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 21:52:33 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V1 1/2] tests/*interrupt_pmd: transfer test cases Date: Fri, 13 Jan 2023 13:50:14 +0000 Message-Id: <20230113135015.1317296-1-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.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 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 --- 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 From patchwork Fri Jan 13 13:50:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 122002 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 5FAA7423BE; Fri, 13 Jan 2023 06:52:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D33C42D53; Fri, 13 Jan 2023 06:52:38 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 7ED3B410D4 for ; Fri, 13 Jan 2023 06:52:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673589156; x=1705125156; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sfdrbkdVFGafQbr+Tx2tlEmf9n3d+Kq0QvzQNQI6eyc=; b=X4YlHY0/WwXlqp9gfJHnoTf7ChYtxcPGUMWxB5jACtPF08QqpYWcBVTO YtdfUzCEWbtGxAmEyyAdOw0rrsuEYiX0U1fomFz5xJpEKo3HOMaO4G+Ld nIiC4zx7Vm45b9+FRZFQCP4e4dnLos0b5VYcbwX+0i2c+G6d2C0Kngyfj RRGARg3hRhcekcuXm/7xBrprgIo1e7OZ/Cc55wsKCNJKyAvmb6vKp2Nxs qKWTC8hm6pgDdQXq0zoP95Mnp2bUk9iXPiNUM7HLzOCn8JaiaEZWB0LxO eJM+UMmlAbzbrfQuvxVXVEL9hqqFv7N139ieAkvRtxT1r7hgy8x3yNY1A A==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="323980549" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="323980549" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 21:52:36 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="688629953" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="688629953" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 21:52:34 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V1 2/2] test_plans/*interrupt_pmd: transfer test cases Date: Fri, 13 Jan 2023 13:50:15 +0000 Message-Id: <20230113135015.1317296-2-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230113135015.1317296-1-songx.jiale@intel.com> References: <20230113135015.1317296-1-songx.jiale@intel.com> 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 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 Reviewed-by: Lijuan Tu --- 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 +