From patchwork Fri May 12 09:55:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 126830 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 861D542AE3; Fri, 12 May 2023 11:54:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59A6342686; Fri, 12 May 2023 11:54:44 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id C1EF2406B7 for ; Fri, 12 May 2023 11:54:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683885283; x=1715421283; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=D6SbylZvmg+xqJyZapy51R8skFn1OI1kP0uXVyyxoLQ=; b=ITgBAkJYbzyP1a87Nm3JSHb6k90tAyaiLZEy+w8/WVQEHERf/mGg/5Sq MFM1wWw566RjUznQyztdy7mBH28jKBmRcuasnlO9NuAOWfFnM/9RTUUo9 B9LkU6F0oIwzWnnb5T5TfynnoI+0oJOAfNbtYaL7+kJpsfroRgGdIfujz YJEFIRbi+LzwALFcx5hxZeXIz3Umor3O5ftNqJf4BuWzXakb2gtn0UoJB rsdsXDZt4I+b7m1v0UVsnH2vaCLnKhqn4gIlxHPUkGziBeQxc2jl1UU8y 5Tfo5FLc61RftnaJaJIJJpLYwLzb1DOXtrOGWuEUs9ZYJLzAnd+CVb5Y/ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="331118034" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="331118034" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2023 02:54:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="1030016641" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="1030016641" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2023 02:54:39 -0700 From: Lingli Chen To: dts@dpdk.org Cc: Lingli Chen Subject: [dts][PATCH V2 1/2] test_plans/kernelpf_iavf: add vf_queue_start_stop test plan Date: Fri, 12 May 2023 17:55:03 +0800 Message-Id: <20230512095504.7343-1-linglix.chen@intel.com> X-Mailer: git-send-email 2.27.0 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 add vf queue start/stop test plan Signed-off-by: Lingli Chen --- test_plans/kernelpf_iavf_test_plan.rst | 56 ++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/test_plans/kernelpf_iavf_test_plan.rst b/test_plans/kernelpf_iavf_test_plan.rst index ed6d9488..4cbe8389 100644 --- a/test_plans/kernelpf_iavf_test_plan.rst +++ b/test_plans/kernelpf_iavf_test_plan.rst @@ -950,3 +950,59 @@ Test case: IAVF CRC strip and Vlan strip co-exists 10:29:19.995424 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500) 196.222.232.221 > 127.0.0.1: ip-proto-0 480 +Test Case: vf queue start/stop +============================== + +This case support VF (IntelĀ® Ethernet 700 Series/IntelĀ® Ethernet 800 Series) + +#. Launch testpmd:: + x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 1-2 -n 4 -a 0000:af:01.0 -- -i --portmask=0x1 --port-topology=loop + +#. Run "set verbose 1" to set verbose +#. Run "set fwd mac" to set fwd type +#. Run "start" to start fwd package + +#. Start a packet capture on the tester in the background:: + tcpdump -i ens7 'ether[12:2] != 0x88cc' -Q in -w /tmp/tester/sniff_ens7.pcap + +#. Start packet generator to transmit packets:: + sendp([Ether(dst='3c:fd:fe:c1:0f:4c', src='00:00:20:00:00:00')/IP()/UDP()/Raw(load=b'XXXXXXXXXXXXXXXXXX')],iface="ens7",count=4,inter=0,verbose=False) + +#. Stop testpmd:: + + --------------------- Forward statistics for port 0 ---------------------- + RX-packets: 4 RX-dropped: 0 RX-total: 4 + TX-packets: 4 TX-dropped: 0 TX-total: 4 + ---------------------------------------------------------------------------- + +#. Quit tcpdump and check tester port receive 4 packets + +#. Run "port 0 rxq 0 stop" to stop rxq 0 in port 0 +#. Start packet generator to transmit and check tester port not receive packets +#. Stop testpmd:: + + ---------------------- Forward statistics for port 0 ---------------------- + RX-packets: 0 RX-dropped: 4 RX-total: 4 + TX-packets: 0 TX-dropped: 0 TX-total: 0 + ---------------------------------------------------------------------------- + +#. Run "port 0 rxq 0 start" to start rxq 0 in port 0 +#. Run "port 0 txq 0 stop" to stop txq 0 in port 0 +#. Start packet generator to transmit and check tester port not receive packets + and in testpmd it not has "port 0/queue 0: received 1 packets" print +#. Stop testpmd:: + + ---------------------- Forward statistics for port 0 ---------------------- + RX-packets: 4 RX-dropped: 0 RX-total: 4 + TX-packets: 0 TX-dropped: 0 TX-total: 0 + ---------------------------------------------------------------------------- + +#. Run "port 0 txq 0 start" to start txq 0 in port 0 +#. Start packet generator to transmit and check tester port receive 4 packets + and in testpmd it has "port 0/queue 0: received 1 packets" print +#. Stop testpmd:: + + ---------------------- Forward statistics for port 0 ---------------------- + RX-packets: 4 RX-dropped: 0 RX-total: 4 + TX-packets: 4 TX-dropped: 0 TX-total: 4 + ---------------------------------------------------------------------------- \ No newline at end of file From patchwork Fri May 12 09:55:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 126831 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 7D4D242AE3; Fri, 12 May 2023 11:54:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 792B342F86; Fri, 12 May 2023 11:54:47 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 64665406B7 for ; Fri, 12 May 2023 11:54:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683885285; x=1715421285; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aEKWbrZcAfIj9fj/Z1mQddeB5h0wKyFGBdwOiMviX30=; b=mfc69RAi4vQuvWLlkT6mMHxFuxNKLXGIfbxa72d2MFj6oFE05Mrl5+HV LtVxu2XyyIJBMxmgKVr1iARVKvlwgthnUFAJ5PEUkcERaQSNATVbdSjpp W4AGfvf6gwa4qD9B92CZ/h1hesKnTol6mzgiIprCeQaMHDKzEHvD3YBcd Qz5dKAC9/DY71LdgYhsmzqpfg/cJ7ucvHeZyaV3g78XTJdxL1hvVedARH P1V68SQad07DhgxuwC7vUbBf/r2KvbjADTybrhtrh3KDOfj5Xytbicn4K c0VfmmEiUSE0pFOiqUDaaMestwaTZMGuCV2YBEl2PJfOnQNdwndhnddgI w==; X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="331118047" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="331118047" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2023 02:54:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="1030016650" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="1030016650" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2023 02:54:41 -0700 From: Lingli Chen To: dts@dpdk.org Cc: Lingli Chen Subject: [dts][PATCH V2 2/2] tests/kernelpf_iavf: add vf_queue_start_stop test script Date: Fri, 12 May 2023 17:55:04 +0800 Message-Id: <20230512095504.7343-2-linglix.chen@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230512095504.7343-1-linglix.chen@intel.com> References: <20230512095504.7343-1-linglix.chen@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 add vf_queue_start_stop test script Signed-off-by: Lingli Chen --- i40e:failed by bug: DPDK-37084 stop rxq, Forward statistics for RX-packets is error ice: failed by bug: DPDK-36737 tests/TestSuite_kernelpf_iavf.py | 127 ++++++++++++++++++++++++++++++- 1 file changed, 125 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py index c69b8748..49d82545 100644 --- a/tests/TestSuite_kernelpf_iavf.py +++ b/tests/TestSuite_kernelpf_iavf.py @@ -14,7 +14,7 @@ import re import time import framework.utils as utils -from framework.packet import Packet +from framework.packet import Packet, strip_pktload from framework.pmd_output import PmdOutput from framework.settings import ( DPDK_DCFMODE_SETTING, @@ -89,7 +89,7 @@ class TestKernelpfIavf(TestCase): def set_up(self): - if self.running_case == "test_vf_rx_interrupt": + if self.running_case in ["test_vf_rx_interrupt", "test_vf_queue_start_stop"]: self.destroy_vm_env() elif self.env_done is False: self.setup_vm_env() @@ -1240,6 +1240,124 @@ class TestKernelpfIavf(TestCase): self.tester_intf, pkt=pkt, pkt_len=pkt_len, crc_strip=True ) + def check_forwarding(self, dmac, rx_received=True, received=True): + self.send_packet_check_pktload(0, 0, dmac, rx_received, received) + + def send_packet_check_pktload( + self, txPort, rxPort, dmac, rx_received, received=True + ): + """ + Send packages according to parameters. + """ + rxitf = self.tester.get_interface(self.tester.get_local_port(rxPort)) + txitf = self.tester.get_interface(self.tester.get_local_port(txPort)) + + pkt = Packet(pkt_type="UDP", pkt_len=64) + inst = self.tester.tcpdump_sniff_packets(rxitf) + pkt.config_layer("ether", {"dst": dmac}) + pkt.send_pkt(self.tester, tx_port=txitf, count=4) + sniff_pkts = self.tester.load_tcpdump_sniff_packets(inst) + out = self.dut.get_session_output() + if rx_received: + self.verify( + "port 0/queue 0: received 1 packets" in out, + "start queue revice package failed, out = %s" % out, + ) + else: + self.verify( + "port 0/queue 0: received 1 packets" not in out, + "start queue revice package failed, out = %s" % out, + ) + + if received: + res = strip_pktload(sniff_pkts, layer="L4") + self.verify( + "58 58 58 58 58 58 58 58" in res, "receive queue not work as expected" + ) + else: + self.verify(len(sniff_pkts) == 0, "stop queue not work as expected") + + def test_vf_queue_start_stop(self): + """ + vf queue start/stop test + """ + self.pmd_out = PmdOutput(self.dut) + # generate vf + self.dut.bind_interfaces_linux(self.kdriver) + self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], 1) + self.vf_port = self.dut.ports_info[self.dut_ports[0]]["vfs_port"][0] + + self.vf_port.bind_driver(driver="vfio-pci") + self.vf_port_pci = self.dut.ports_info[self.dut_ports[0]]["sriov_vfs_pci"][0] + self.core_config = "1S/2C/1T" + self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) + cores = self.dut.get_core_list(self.core_config, socket=self.ports_socket) + # dpdk start + try: + self.pmd_out.start_testpmd( + cores=cores, + eal_param="-a %s --file-prefix=vf" % self.vf_port_pci, + param="--portmask=0x1 --port-topology=loop", + ) + self.dut.send_expect("set fwd mac", "testpmd>") + self.dut.send_expect("set verbose 1", "testpmd>") + self.dut.send_expect("start", "testpmd>") + self.pmd_out.wait_link_status_up("all") + dmac = self.pmd_out.get_port_mac(0) + self.check_forwarding(dmac) + out = self.dut.send_expect("stop", "testpmd>") + self.verify( + "RX-packets: 4" in out, "Forward statistics for RX-packets is error" + ) + self.verify( + "TX-packets: 4" in out, "Forward statistics for TX-packets is error" + ) + except Exception as e: + raise IOError("dpdk start and first forward failure: %s" % e) + + try: + # stop rx queue test + print("test stop rx queue") + self.dut.send_expect("port 0 rxq 0 stop", "testpmd>") + self.dut.send_expect("start", "testpmd>") + self.check_forwarding(dmac, rx_received=False, received=False) + + out = self.dut.send_expect("stop", "testpmd>") + self.verify( + "RX-packets: 0" in out, "Forward statistics for RX-packets is error" + ) + + # stop tx queue test + print("test start rx queue stop tx queue") + self.dut.send_expect("port 0 rxq 0 start", "testpmd>") + self.dut.send_expect("port 0 txq 0 stop", "testpmd>") + self.dut.send_expect("start", "testpmd>") + self.check_forwarding(dmac, rx_received=False, received=False) + out = self.dut.send_expect("stop", "testpmd>") + self.verify( + "TX-packets: 0" in out, "Forward statistics for TX-packets is error" + ) + except Exception as e: + raise IOError("queue stop forward failure: %s" % e) + + try: + # start tx queue test + print("test start rx and tx queue") + self.dut.send_expect("port 0 txq 0 start", "testpmd>") + self.dut.send_expect("start", "testpmd>") + self.check_forwarding(dmac) + out = self.dut.send_expect("stop", "testpmd>") + self.verify( + "RX-packets: 4" in out, + "restart txq Forward statistics for RX-packets is error", + ) + self.verify( + "TX-packets: 4" in out, + "restart txq Forward statistics for TX-packets is error", + ) + except Exception as e: + raise IOError("queue start forward failure: %s" % e) + def scapy_send_packet(self, mac, testinterface, vlan_flags=False, count=1): """ Send a packet to port @@ -1296,6 +1414,11 @@ class TestKernelpfIavf(TestCase): "killall %s" % self.l3fwdpower_name, "# ", 60, alt_session=True ) self.destroy_2vf_in_2pf() + elif self.running_case == "test_vf_queue_start_stop": + try: + self.dut.send_expect("quit", "#") + except: + print("Failed to quit testpmd") else: self.vm_testpmd.execute_cmd("quit", "#") time.sleep(1)