From patchwork Tue Sep 7 19:13:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, ZhiminX" X-Patchwork-Id: 98165 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 0465FA0C46; Tue, 7 Sep 2021 12:41:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F327D41169; Tue, 7 Sep 2021 12:41:55 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 8B08A410EC for ; Tue, 7 Sep 2021 12:41:53 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10099"; a="283873629" X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="283873629" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 03:41:53 -0700 X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="469145904" Received: from unknown (HELO localhost.localdomain) ([10.240.183.103]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 03:41:52 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Date: Wed, 8 Sep 2021 03:13:16 +0800 Message-Id: <20210907191319.15494-2-zhiminx.huang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907191319.15494-1-zhiminx.huang@intel.com> References: <20210907191319.15494-1-zhiminx.huang@intel.com> Subject: [dts] [PATCH V1 1/4] test_plans/kernelpf_iavf_test_plan:rich test point in plan 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 Sender: "dts" add some new test point in plan: kernelpf_iavf: add remove mac test. add check rss reta changed. add rss hash key test. Signed-off-by: Zhimin Huang --- test_plans/kernelpf_iavf_test_plan.rst | 94 +++++++++++++++++++++++--- 1 file changed, 85 insertions(+), 9 deletions(-) diff --git a/test_plans/kernelpf_iavf_test_plan.rst b/test_plans/kernelpf_iavf_test_plan.rst index 31ba975..e0360d2 100644 --- a/test_plans/kernelpf_iavf_test_plan.rst +++ b/test_plans/kernelpf_iavf_test_plan.rst @@ -105,6 +105,27 @@ packets can be received and forwarded by the VF:: Use scapy to send 100 random packets with a wrong MAC to VF0, verify the packets can't be received by the VF. +Remove the MAC 00:11:22:33:44:55:: + + testpmd> mac_addr remove 0 00:11:22:33:44:55 + +Use scapy to send 100 random packets with removed VF0's MAC, verify the +packets can't be received and forwarded by the VF:: + +Set the defaul mac address to other mac, check the mac address has be changed +to new set mac:: + + testpmd> mac_addr set 0 00:01:23:45:67:11 + testpmd> show port info 0 + +Use scapy to send 100 random packets with original VF0's MAC, verify the +packets can't be received and forwarded by the VF + +Use scapy to send 100 random packets with new set VF0's MAC, verify the +packets can be received and forwarded by the VF + +Reset to original mac address + Note:: Not set VF MAC from kernel PF for this case, if set, will print "not permitted error" when add new MAC for VF. @@ -350,17 +371,35 @@ Start command with multi-queues like below:: ./testpmd -c f -n 4 -- -i --txq=4 --rxq=4 +Show RSS RETA configuration:: + + testpmd> show port 0 rss reta 64 (0xffffffffffffffff) + + RSS RETA configuration: hash index=0, queue=0 + RSS RETA configuration: hash index=1, queue=1 + RSS RETA configuration: hash index=2, queue=2 + RSS RETA configuration: hash index=3, queue=3 + ... + RSS RETA configuration: hash index=60, queue=0 + RSS RETA configuration: hash index=61, queue=1 + RSS RETA configuration: hash index=62, queue=2 + RSS RETA configuration: hash index=63, queue=3 + Config hash reta table:: - testpmd> port config 0 rss reta (0,0) - testpmd> port config 0 rss reta (1,1) - testpmd> port config 0 rss reta (2,2) - testpmd> port config 0 rss reta (3,3) - ... - testpmd> port config 0 rss reta (60,0) - testpmd> port config 0 rss reta (61,1) - testpmd> port config 0 rss reta (62,2) - testpmd> port config 0 rss reta (63,3) + testpmd> port config 0 rss reta (0,3) + testpmd> port config 0 rss reta (1,2) + testpmd> port config 0 rss reta (2,1) + testpmd> port config 0 rss reta (3,0) + +Check RSS RETA configuration has changed:: + + testpmd> show port 0 rss reta 64 (0xffffffffffffffff) + + RSS RETA configuration: hash index=0, queue=3 + RSS RETA configuration: hash index=1, queue=2 + RSS RETA configuration: hash index=2, queue=2 + RSS RETA configuration: hash index=3, queue=1 Enable IP/TCP/UDP RSS:: @@ -369,6 +408,43 @@ Enable IP/TCP/UDP RSS:: Send different flow types' IP/TCP/UDP packets to VF port, check packets are received by different configured queues. +Test case: VF RSS hash key +========================== + +Start command with multi-queues like below:: + + ./testpmd -c f -n 4 -- -i --txq=4 --rxq=4 + +Show port rss hash key:: + + testpmd> show port 0 rss-hash key + +Set rxonly fwd, enable print, start testpmd:: + + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + +Send ipv4 packets, mark the RSS hash value:: + + p=Ether(dst="56:0A:EC:50:A4:28")/IP(src="1.2.3.4")/Raw(load='X'*30) + +Update ipv4 different hash key:: + + testpmd> port config 0 rss-hash-key ipv4 1b9d58a4b961d9cd1c56ad1621c3ad51632c16a5d16c21c3513d132c135d132c13ad1531c23a51d6ac49879c499d798a7d949c8a + +Show port rss hash key, check the key is same to configured key:: + + testpmd> show port 0 rss-hash key + RSS functions: + all ipv4 ipv6 ip + RSS key: + 1B9D58A4B961D9CD1C56AD1621C3AD51632C16A5D16C21C3513D132C135D132C13AD1531C23A51D6AC49879C499D798A7D949C8A + +Send ipv4 packets, check RSS hash value is different:: + + p=Ether(dst="56:0A:EC:50:A4:28")/IP(src="1.2.3.4")/Raw(load='X'*30) + Test case: VF HW checksum offload ================================= From patchwork Tue Sep 7 19:13:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, ZhiminX" X-Patchwork-Id: 98166 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 326D1A0C41; Tue, 7 Sep 2021 12:42:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A1A141168; Tue, 7 Sep 2021 12:42:06 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 91577410EC for ; Tue, 7 Sep 2021 12:42:05 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10099"; a="283873631" X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="283873631" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 03:41:54 -0700 X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="469145913" Received: from unknown (HELO localhost.localdomain) ([10.240.183.103]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 03:41:53 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Date: Wed, 8 Sep 2021 03:13:17 +0800 Message-Id: <20210907191319.15494-3-zhiminx.huang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907191319.15494-1-zhiminx.huang@intel.com> References: <20210907191319.15494-1-zhiminx.huang@intel.com> Subject: [dts] [PATCH V1 2/4] test_plans/stats_checks_test_plan:rich test point in plan 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 Sender: "dts" add some new test points in plan: stats_checks: add clear stats test. Signed-off-by: Zhimin Huang --- test_plans/stats_checks_test_plan.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test_plans/stats_checks_test_plan.rst b/test_plans/stats_checks_test_plan.rst index 51ec36d..327aaf2 100644 --- a/test_plans/stats_checks_test_plan.rst +++ b/test_plans/stats_checks_test_plan.rst @@ -264,6 +264,21 @@ FVL does not support hardware per queue stats, so rx_qx_packets and rx_qx_bytes are both 0. tx_qx_packets and tx_qx_bytes are both 0 too. +6. Clear stats:: + + testpmd> clear port stats all + +7. Check stats and xstats, verify rx_good_packets, RX-packets of port 0 and tx_good_packets, TX-packets of port 1 are both 0. + +8. Repeat above 4 and 5 steps. + +9. Clear xstats:: + + testpmd> clear port xstats all + +10. Check stats and xstats, verify rx_good_packets, RX-packets of port 0 and tx_good_packets, TX-packets of port 1 are both 0. + + Test Case: VF xstats Checks ============================ 1. Create one VF port on a kernel PF, then bind the VF to pmd driver:: From patchwork Tue Sep 7 19:13:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, ZhiminX" X-Patchwork-Id: 98167 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 51BBEA0C41; Tue, 7 Sep 2021 12:42:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C6FF4116C; Tue, 7 Sep 2021 12:42:07 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 38E344116E for ; Tue, 7 Sep 2021 12:42:06 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10099"; a="283873634" X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="283873634" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 03:41:56 -0700 X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="469145925" Received: from unknown (HELO localhost.localdomain) ([10.240.183.103]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 03:41:54 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Date: Wed, 8 Sep 2021 03:13:18 +0800 Message-Id: <20210907191319.15494-4-zhiminx.huang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907191319.15494-1-zhiminx.huang@intel.com> References: <20210907191319.15494-1-zhiminx.huang@intel.com> Subject: [dts] [PATCH V1 3/4] tests/kernelpf_iavf:rich test point in case 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 Sender: "dts" add some new test points in test case: add remove mac test. add check rss reta changed. add rss hash key test. Signed-off-by: Zhimin Huang --- tests/TestSuite_kernelpf_iavf.py | 42 +++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py index 5db1ec0..6a858fc 100644 --- a/tests/TestSuite_kernelpf_iavf.py +++ b/tests/TestSuite_kernelpf_iavf.py @@ -277,6 +277,17 @@ class TestKernelpfIavf(TestCase): # send packet with wrong mac self.send_random_pkt(self.wrong_mac, count=100) self.verify_packet_count(0) + self.vm_testpmd.execute_cmd('clear port stats all') + self.vm_testpmd.execute_cmd("mac_addr remove 0 %s" % self.add_addr) + self.send_random_pkt(self.add_addr, count=100) + self.verify_packet_count(0) + self.vm_testpmd.execute_cmd('clear port stats all') + self.vm_testpmd.execute_cmd("mac_addr add 0 00:01:23:45:67:11") + self.send_random_pkt(self.add_addr, count=100) + self.verify_packet_count(0) + self.vm_testpmd.execute_cmd('clear port stats all') + self.send_random_pkt("00:01:23:45:67:11", count=100) + self.verify_packet_count(100) def get_testpmd_vf_mac(self, out): result = re.search("([a-f0-9]{2}:){5}[a-f0-9]{2}", out, re.IGNORECASE) @@ -635,8 +646,11 @@ class TestKernelpfIavf(TestCase): self.vm_testpmd.start_testpmd("all", "--txq=4 --rxq=4") self.vm_testpmd.execute_cmd("set fwd mac") self.vm_testpmd.execute_cmd("set verbose 1") - for i, j in zip(list(range(64)), [0, 1, 2, 3]*16): + default_rss_reta = self.vm_testpmd.execute_cmd("show port 0 rss reta 64 (0xffffffffffffffff)") + for i, j in zip(list(range(64)), [3, 2, 1, 0]*16): self.vm_testpmd.execute_cmd("port config 0 rss reta (%d,%d)" % (i, j)) + change_rss_reta = self.vm_testpmd.execute_cmd("show port 0 rss reta 64 (0xffffffffffffffff)") + self.verify(default_rss_reta != change_rss_reta, "port config rss reta failed") for type in rss_type: self.vm_testpmd.execute_cmd("port config all rss %s" % type) self.vm_testpmd.execute_cmd("start") @@ -646,6 +660,32 @@ class TestKernelpfIavf(TestCase): self.verify_packet_number(out) self.vm_testpmd.execute_cmd("clear port stats all") + def test_vf_rss_hash_key(self): + update_hash_key = '1b9d58a4b961d9cd1c56ad1621c3ad51632c16a5d16c21c3513d132c135d132c13ad1531c23a51d6ac49879c499d798a7d949c8a' + self.vm_testpmd.start_testpmd("all", "--txq=4 --rxq=4") + self.vm_testpmd.execute_cmd("show port 0 rss-hash key") + self.vm_testpmd.execute_cmd("set fwd rxonly") + self.vm_testpmd.execute_cmd("set verbose 1") + self.vm_testpmd.execute_cmd("start") + pkt1_info = self.send_pkt_gethash() + self.vm_testpmd.execute_cmd("port config 0 rss-hash-key ipv4 {}".format(update_hash_key)) + out = self.vm_testpmd.execute_cmd("show port 0 rss-hash key") + self.verify(update_hash_key in out.lower(), "rss hash key update failed") + pkt2_info = self.send_pkt_gethash() + self.verify(pkt1_info[0][0] != pkt2_info[0][0], "hash value should be different") + + def send_pkt_gethash(self, pkt=''): + if pkt == '': + pkt = "sendp([Ether(dst='%s')/IP(src='1.2.3.4')/Raw(load='X'*30)], iface='%s')" % (self.vf_mac, self.tester_intf) + self.tester.scapy_append(pkt) + self.tester.scapy_execute() + out = self.vm_dut.get_session_output() + p = re.compile("RSS hash=(0x\w+) - RSS queue=(0x\w+)") + pkt_info = p.findall(out) + self.verify(pkt_info, "received pkt have no hash") + self.logger.info("hash values:{}".format(pkt_info)) + return pkt_info + def verify_packet_number(self, out): queue0_number = len(re.findall('port 0/queue 0', out)) queue1_number = len(re.findall('port 0/queue 1', out)) From patchwork Tue Sep 7 19:13:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, ZhiminX" X-Patchwork-Id: 98168 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 7233AA0C41; Tue, 7 Sep 2021 12:42:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6DCF841171; Tue, 7 Sep 2021 12:42:08 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id B2E88410EF for ; Tue, 7 Sep 2021 12:42:06 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10099"; a="283873637" X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="283873637" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 03:41:57 -0700 X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="469145932" Received: from unknown (HELO localhost.localdomain) ([10.240.183.103]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 03:41:56 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Date: Wed, 8 Sep 2021 03:13:19 +0800 Message-Id: <20210907191319.15494-5-zhiminx.huang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907191319.15494-1-zhiminx.huang@intel.com> References: <20210907191319.15494-1-zhiminx.huang@intel.com> Subject: [dts] [PATCH V1 4/4] tests/stats_checks:rich test point in case 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 Sender: "dts" add some new test points in test case: add clear stats test. Signed-off-by: Zhimin Huang --- tests/TestSuite_stats_checks.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_stats_checks.py b/tests/TestSuite_stats_checks.py index 5dc21b6..58c5236 100644 --- a/tests/TestSuite_stats_checks.py +++ b/tests/TestSuite_stats_checks.py @@ -208,10 +208,22 @@ class TestStatsChecks(TestCase): self.exec("clear port xstats all") org_xstats = self.get_xstats([rx_port, tx_port]) self.verify_results(org_xstats, rx_port, tx_port, if_zero=True) - self.exec("start") + final_xstats, stats_data = self.sendpkt_get_xstats(rx_port, tx_port, if_vf) + self.verify_results(final_xstats, rx_port, tx_port, stats_data=stats_data) + self.exec("clear port stats all") + clear_stats = self.get_xstats([rx_port, tx_port]) + self.verify_results(clear_stats, rx_port, tx_port, if_zero=True) - self.send_pkt_with_random_ip(tx_port, count=100, if_vf=if_vf) + final_xstats, stats_data = self.sendpkt_get_xstats(rx_port, tx_port, if_vf) + self.verify_results(final_xstats, rx_port, tx_port, stats_data=stats_data) + self.exec("clear port xstats all") + clear_xstats = self.get_xstats([rx_port, tx_port]) + self.verify_results(clear_xstats, rx_port, tx_port, if_zero=True) + self.pmdout.quit() + def sendpkt_get_xstats(self, rx_port, tx_port, if_vf): + self.exec("start") + self.send_pkt_with_random_ip(tx_port, count=100, if_vf=if_vf) self.exec("stop") if rx_port == tx_port: final_xstats = self.get_xstats([rx_port]) @@ -226,8 +238,7 @@ class TestStatsChecks(TestCase): rx_port: rx_stats_info, tx_port: tx_stats_info } - self.verify_results(final_xstats, rx_port, tx_port, stats_data=stats_data) - self.pmdout.quit() + return final_xstats, stats_data def set_up_all(self): """