From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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)) -- 2.17.1