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 A2CDBA0C4B; Mon, 8 Nov 2021 07:01:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A3F040DF7; Mon, 8 Nov 2021 07:01:00 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 4501040040 for ; Mon, 8 Nov 2021 07:00:58 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10161"; a="292998312" X-IronPort-AV: E=Sophos;i="5.87,217,1631602800"; d="scan'208";a="292998312" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2021 22:00:57 -0800 X-IronPort-AV: E=Sophos;i="5.87,217,1631602800"; d="scan'208";a="491088094" Received: from unknown (HELO localhost.localdomain) ([10.240.183.163]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 07 Nov 2021 22:00:56 -0800 From: Yu Jiang To: yuan.peng@intel.com, dts@dpdk.org Cc: Yu Jiang Date: Mon, 8 Nov 2021 14:00:31 +0800 Message-Id: <1636351231-2373-3-git-send-email-yux.jiang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1636351231-2373-1-git-send-email-yux.jiang@intel.com> References: <1636351231-2373-1-git-send-email-yux.jiang@intel.com> Subject: [dts] [PATCH V2 2/2] tests/pmdrss_hash: replace legacy filter with rte_flow 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" According to dpdk commit 81db321da("ethdev: remove legacy HASH filter type support"), remove legacy hash filter, then use rte_flow api to replace. Signed-off-by: Yu Jiang --- conf/test_case_checklist.json | 11 ++++- tests/TestSuite_pmdrss_hash.py | 107 ++++++++++++++++++++--------------------- 2 files changed, 63 insertions(+), 55 deletions(-) diff --git a/conf/test_case_checklist.json b/conf/test_case_checklist.json index d26244e..e0b68fa 100644 --- a/conf/test_case_checklist.json +++ b/conf/test_case_checklist.json @@ -1493,6 +1493,9 @@ "ALL" ], "NIC": [ + "columbiaville_25g", + "columbiaville_100g", + "niantic", "foxville" ], "Target": [ @@ -1521,7 +1524,7 @@ "ALL" ], "NIC": [ - "foxville" + "foxville" ], "Target": [ "ALL" @@ -1550,6 +1553,9 @@ "ALL" ], "NIC": [ + "columbiaville_25g", + "columbiaville_100g", + "niantic", "foxville" ], "Target": [ @@ -1579,6 +1585,9 @@ "ALL" ], "NIC": [ + "columbiaville_25g", + "columbiaville_100g", + "niantic", "foxville" ], "Target": [ diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py index 2ff98cb..b4ee6ef 100644 --- a/tests/TestSuite_pmdrss_hash.py +++ b/tests/TestSuite_pmdrss_hash.py @@ -416,28 +416,12 @@ class TestPmdrssHash(TestCase): Run at the start of each test suite. """ - self.verify(self.nic in ["columbiaville_25g", "columbiaville_100g","fortville_eagle", "fortville_spirit", - "fortville_spirit_single", "fortpark_TLV", "fortpark_BASE-T","fortville_25g", "niantic", "carlsville", "foxville"], - "NIC Unsupported: " + str(self.nic)) global reta_num global iptypes global queue - if self.nic in ["foxville"]: - queue = 4 if self.nic in ["fortville_eagle", "fortville_spirit", "fortville_spirit_single", "fortpark_TLV", "fortpark_BASE-T","fortville_25g", "carlsville"]: reta_num = 512 - elif self.nic in ["niantic", "foxville"]: - reta_num = 128 - iptypes = {'ipv4-other': 'ip', - 'ipv4-frag': 'ip', - 'ipv4-udp': 'udp', - 'ipv4-tcp': 'tcp', - 'ipv6-other': 'ip', - 'ipv6-udp': 'udp', - 'ipv6-tcp': 'tcp', - 'ipv6-frag': 'ip' - } else: self.verify(False, "NIC Unsupported:%s" % str(self.nic)) ports = self.dut.get_ports(self.nic) @@ -456,6 +440,7 @@ class TestPmdrssHash(TestCase): dutPorts = self.dut.get_ports(self.nic) localPort = self.tester.get_local_port(dutPorts[0]) itf = self.tester.get_interface(localPort) + rule_action = 'func toeplitz queues end / end' global reta_num global iptypes @@ -474,8 +459,14 @@ class TestPmdrssHash(TestCase): "set nbcore %d" % (queue + 1), "testpmd> ") self.dut.send_expect("port stop all", "testpmd> ") - self.dut.send_expect( - "set_hash_global_config 0 toeplitz %s enable" % iptype, "testpmd> ") + self.dut.send_expect("flow flush 0", "testpmd> ") + rule_cmd = f'flow create 0 ingress pattern eth / ipv4 / end actions rss types {iptype} end queues end {rule_action}' + if 'sctp' in iptype or 'udp' in iptype or 'tcp' in iptype: + rule_cmd = rule_cmd.replace('/ ipv4 /', f'/ ipv4 / {rsstype} /') + if 'ipv6' in iptype: + rule_cmd = rule_cmd.replace('ipv4', 'ipv6') + outx = self.dut.send_expect(rule_cmd, "testpmd> ") + self.verify("created" in outx, "Create flow failed") self.dut.send_expect("port start all", "testpmd> ") out = self.dut.send_expect( "port config all rss %s" % rsstype, "testpmd> ") @@ -519,7 +510,8 @@ class TestPmdrssHash(TestCase): rule_cmd = rule_cmd.replace('/ ipv4 /', f'/ ipv4 / {rsstype} /') if 'ipv6' in iptype: rule_cmd = rule_cmd.replace('ipv4', 'ipv6') - self.dut.send_expect(rule_cmd, "testpmd> ") + outx = self.dut.send_expect(rule_cmd, "testpmd> ") + self.verify("created" in outx, "Create flow failed") self.dut.send_expect("port start all", "testpmd> ") out = self.dut.send_expect( "port config all rss %s" % rsstype, "testpmd> ") @@ -540,6 +532,7 @@ class TestPmdrssHash(TestCase): dutPorts = self.dut.get_ports(self.nic) localPort = self.tester.get_local_port(dutPorts[0]) itf = self.tester.get_interface(localPort) + rule_action = 'func simple_xor queues end / end' global reta_num global iptypes @@ -560,8 +553,14 @@ class TestPmdrssHash(TestCase): self.dut.send_expect("port stop all", "testpmd> ") # some nic not support change hash algorithm - self.dut.send_expect( - "set_hash_global_config 0 simple_xor %s enable" % iptype, "testpmd> ") + self.dut.send_expect("flow flush 0", "testpmd> ") + rule_cmd = f'flow create 0 ingress pattern eth / ipv4 / end actions rss types {iptype} end queues end {rule_action}' + if 'sctp' in iptype or 'udp' in iptype or 'tcp' in iptype: + rule_cmd = rule_cmd.replace('/ ipv4 /', f'/ ipv4 / {rsstype} /') + if 'ipv6' in iptype: + rule_cmd = rule_cmd.replace('ipv4', 'ipv6') + outx = self.dut.send_expect(rule_cmd, "testpmd> ") + self.verify("created" in outx, "Create flow failed") self.dut.send_expect("port start all", "testpmd> ") out = self.dut.send_expect( "port config all rss %s" % rsstype, "testpmd> ") @@ -575,48 +574,48 @@ class TestPmdrssHash(TestCase): self.dut.send_expect("quit", "# ", 30) - def test_simple_symmetric(self): + def test_simple_symmetric(self): - dutPorts = self.dut.get_ports(self.nic) - localPort = self.tester.get_local_port(dutPorts[0]) - itf = self.tester.get_interface(localPort) - global reta_num - global iptypes - self.dut.kill_all() + dutPorts = self.dut.get_ports(self.nic) + localPort = self.tester.get_local_port(dutPorts[0]) + itf = self.tester.get_interface(localPort) + global reta_num + global iptypes + self.dut.kill_all() - # test with different rss queues - self.dut.send_expect( - "%s %s -- -i --rxq=%d --txq=%d" % - (self.path, self.eal_para, queue, queue), "testpmd> ", 120) - - for iptype, rsstype in list(iptypes.items()): - self.dut.send_expect("set verbose 8", "testpmd> ") - self.dut.send_expect("set fwd rxonly", "testpmd> ") - self.dut.send_expect("set promisc all off", "testpmd> ") + # test with different rss queues self.dut.send_expect( - "set nbcore %d" % (queue + 1), "testpmd> ") + "%s %s -- -i --rxq=%d --txq=%d" % + (self.path, self.eal_para, queue, queue), "testpmd> ", 120) - self.dut.send_expect("port stop all", "testpmd> ") - self.dut.send_expect( - "set_hash_global_config 0 simple_xor %s enable" % iptype, "testpmd> ") - self.dut.send_expect( - "set_sym_hash_ena_per_port 0 enable", "testpmd> ") - self.dut.send_expect("port start all", "testpmd> ") + for iptype, rsstype in list(iptypes.items()): + self.dut.send_expect("set verbose 8", "testpmd> ") + self.dut.send_expect("set fwd rxonly", "testpmd> ") + self.dut.send_expect("set promisc all off", "testpmd> ") + self.dut.send_expect( + "set nbcore %d" % (queue + 1), "testpmd> ") - out = self.dut.send_expect( - "port config all rss %s" % rsstype, "testpmd> ") - self.verify("error" not in out, "Configuration of RSS hash failed: Invalid argument") - # configure the reta with specific mappings. - for i in range(reta_num): - reta_entries.insert(i, random.randint(0, queue - 1)) + self.dut.send_expect("port stop all", "testpmd> ") self.dut.send_expect( - "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ") - self.send_packet_symmetric(itf, iptype) + "set_hash_global_config 0 simple_xor %s enable" % iptype, "testpmd> ") + self.dut.send_expect( + "set_sym_hash_ena_per_port 0 enable", "testpmd> ") + self.dut.send_expect("port start all", "testpmd> ") - self.dut.send_expect("quit", "# ", 30) + out = self.dut.send_expect( + "port config all rss %s" % rsstype, "testpmd> ") + self.verify("error" not in out, "Configuration of RSS hash failed: Invalid argument") + # configure the reta with specific mappings. + for i in range(reta_num): + reta_entries.insert(i, random.randint(0, queue - 1)) + self.dut.send_expect( + "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ") + self.send_packet_symmetric(itf, iptype) + + self.dut.send_expect("quit", "# ", 30) def test_dynamic_rss_bond_config(self): - + # setup testpmd and finish bond config self.verify(self.nic in ["columbiaville_25g", "columbiaville_100g","fortville_eagle", "fortville_spirit", "fortpark_TLV","fortpark_BASE-T", "fortville_25g", "carlsville", "foxville"], -- 2.7.4