From patchwork Mon Aug 15 14:00:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 115102 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 79989A00C5; Mon, 15 Aug 2022 08:00:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 608D640143; Mon, 15 Aug 2022 08:00:29 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 6230B400EF for ; Mon, 15 Aug 2022 08:00:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660543227; x=1692079227; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Z/v05Dqli2VS5w+EV1TMDEqf8EoJ3BrpVZ7K7s4Ay4c=; b=kZwzhQsZXIk12nGIdt1yWGVE9ufhS3wTnmot02vlKYAjq3mxWHp54jGE hQnJS/uc741p0mx35b05Hl/GYv8VCFD/EI8IF3psdg4PrPYvalLYR3Z47 2G3HHp+/DVM0pRtI9TW/knO13APCGyYklp1AFweVAksHtxZCngMdL7dOF 9BP10UtcUDPdNi/26c4/+sHM6WXabbM7JU2PJddYCOmXdD55TAUwK8nNm fERoh+GRV8BDh1UFfMqt+a1Hzsr2hHR0WPZgp6L9WhcG8tMWKpI5SqX1t MSOOGAonvkH37x/qHh8B62b5uSZhzV2QKNjKi/dynrAtvE35M5C6Nh+cq g==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="272290072" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="272290072" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:00:26 -0700 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="666551200" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:00:25 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 1/5] test_plans/ice_switch_filter: change log level Date: Mon, 15 Aug 2022 14:00:31 +0000 Message-Id: <20220815140035.1186904-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 the log level is too high, causing redundancy in the log display, so the log level is reduced. Signed-off-by: Jiale Song Acked-by: Peng, Yuan Signed-off-by: Jiale Song --- test_plans/ice_switch_filter_test_plan.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_plans/ice_switch_filter_test_plan.rst b/test_plans/ice_switch_filter_test_plan.rst index 599174ba..ffa8894f 100644 --- a/test_plans/ice_switch_filter_test_plan.rst +++ b/test_plans/ice_switch_filter_test_plan.rst @@ -154,7 +154,7 @@ Prerequisites 6. Launch dpdk with the following arguments in non-pipeline mode:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:00.0 --log-level="ice,8" -- -i --txq=16 --rxq=16 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:00.0 --log-level="ice,7" -- -i --txq=16 --rxq=16 testpmd> port config 0 rss-hash-key ipv4 1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd testpmd> set fwd rxonly testpmd> set verbose 1 @@ -168,7 +168,7 @@ Prerequisites Launch dpdk in pipeline mode with the following testpmd command line:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:00.0,pipeline-mode-support=1 --log-level="ice,8" -- -i --txq=16 --rxq=16 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:00.0,pipeline-mode-support=1 --log-level="ice,7" -- -i --txq=16 --rxq=16 Test case: VXLAN non-pipeline mode ================================== From patchwork Mon Aug 15 14:00:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 115103 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 98ABBA034C; Mon, 15 Aug 2022 08:00:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81D924021D; Mon, 15 Aug 2022 08:00:29 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 11E56400EF for ; Mon, 15 Aug 2022 08:00:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660543228; x=1692079228; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NH7VQlXJBhGsXOLb9UfG57ZEn6alIOioveKDpJzbG4w=; b=a4/OX0liO1MPnOvxHzxHhgfW+0jH57HENaF0mBD73vZKG6tHRc9GxTQ4 RFHHXfS5ER5ZMUJXYPMhl407MZHqk3s5ncRbcEqFrDm09t9M4ChfDSHOb htWJZB2L11uZIhgNwa3rMnmDyG1lCPEtehJGzzgWbDpBjy/mx488m/AIo HqFZY/ZNBZe9n1eWNCUeJsi9IBM+kNH7aeEKPbSiTbGLbUdvR9vumfX3t Ye/iIR7fxzByw0qnO2NEOwdTeANEyXiCwqVO1sbKn+aTTRGVtk9EqfwEy 9j8UUr2FVZ6M4a3TOLJasWG7Q8f8Dcfzn3tOeOmTnKWQqil8MxVuxQv0L w==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="272290079" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="272290079" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:00:27 -0700 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="666551206" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:00:26 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 2/5] tests/ice_switch_filter: optimize the rte_flow test process Date: Mon, 15 Aug 2022 14:00:32 +0000 Message-Id: <20220815140035.1186904-2-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220815140035.1186904-1-songx.jiale@intel.com> References: <20220815140035.1186904-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 1. synchronize test plans, lower log level. 2. optimization scripts, remove the method of reload ice. 3. optimize the rte_flow test process that the action is switch to queue. Signed-off-by: Jiale Song Acked-by: Peng, Yuan Signed-off-by: Jiale Song --- tests/TestSuite_ice_switch_filter.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/TestSuite_ice_switch_filter.py b/tests/TestSuite_ice_switch_filter.py index 76bd630f..f5f8ec1f 100644 --- a/tests/TestSuite_ice_switch_filter.py +++ b/tests/TestSuite_ice_switch_filter.py @@ -4279,16 +4279,14 @@ class ICESwitchFilterTest(TestCase): self.generate_file_with_fdir_rules() self.path = self.dut.apps_name["test-pmd"] - - def reload_ice(self): - self.dut.send_expect("rmmod ice", "# ", 15) - self.dut.send_expect("modprobe ice", "# ", 15) + self.rxq = 16 + self.rxq_param = "--rxq={0} --txq={0}".format(self.rxq) def set_up(self): """ Run before each test case. """ - self.reload_ice() + pass def generate_file_with_fdir_rules(self): """ @@ -4327,9 +4325,8 @@ class ICESwitchFilterTest(TestCase): # Prepare testpmd EAL and parameters all_eal_param = self.dut.create_eal_parameters(cores="1S/4C/1T", ports=[0]) command = ( - self.path + all_eal_param + ' --log-level="ice,8" -- -i --rxq=16 --txq=16 ' + self.path + all_eal_param + ' --log-level="ice,7" -- -i %s' % self.rxq_param ) - # command = "./%s/app/testpmd %s --log-level=\"ice,8\" -- -i %s" % (self.dut.target, all_eal_param, "--rxq=16 --txq=16") return command def create_testpmd_command_pipeline_mode(self): @@ -4341,7 +4338,7 @@ class ICESwitchFilterTest(TestCase): cores="1S/4C/1T", ports=[0], port_options={0: "pipeline-mode-support=1"} ) command = ( - self.path + all_eal_param + ' --log-level="ice,8" -- -i --rxq=16 --txq=16' + self.path + all_eal_param + ' --log-level="ice,7" -- -i %s' % self.rxq_param ) return command @@ -4370,13 +4367,15 @@ class ICESwitchFilterTest(TestCase): """ # Specify the port to use dic["check_func"]["param"]["expect_port"] = port + dic["check_func"]["param"]["rxq"] = self.rxq + self.pmd.wait_link_status_up(port) self.dut.send_expect("start", "testpmd> ", 15) - time.sleep(2) # send packets self.pkt.update_pkt(dic["scapy_str"]) self.pkt.send_pkt(self.tester, tx_port=self.__tx_iface, count=1, timeout=370) - time.sleep(3) - out = self.dut.send_expect("stop", "testpmd> ", 15) + out1 = self.pmd.get_output(timeout=1) + out2 = self.pmd.execute_cmd("stop") + out = out1 + out2 result_flag, log_msg = dic["check_func"]["func"]( out, dic["check_func"]["param"], dic["expect_results"] ) @@ -4701,6 +4700,9 @@ class ICESwitchFilterTest(TestCase): count = 1 for tv in test_vectors: pattern_name = tv["name"] + self.logger.info( + GREEN("{0} case_name:{1} {0}".format("*" * 20, pattern_name)) + ) test_results[pattern_name] = OrderedDict() # get the queues that packets originally came to if count == 1: From patchwork Mon Aug 15 14:00:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 115104 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 A3C9BA00C5; Mon, 15 Aug 2022 08:00:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F67940150; Mon, 15 Aug 2022 08:00:31 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id A44F540697 for ; Mon, 15 Aug 2022 08:00:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660543229; x=1692079229; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nQ4BFeQn5RDG7wP3ZDmRC5ZiXN7L5oQgUObDtGXpRLA=; b=dmBb0XG1VekAVYNykUyk2UCwkDE+XTy1ExZnXu5TlRI52pcM/Lb4S94l k4qAhd9hIVW102KgTbNt4jhbDGE1oYQYkBuRLLhIkQ5nj3SIbK3p58rKo IFO2ktUMXx2syI322t4k5+WCaAV9Ig+XFl2jxO1kCP1w5Jq+/YY4ktFib nDnzz/+L++Ypcig5g8P42tHIHbggKkPKtz9HA6I0uEI8zce6OQiBbM9XO mqnV+4Ty0QDMWeD6byLtH4wK7KMnj4uQXydDKEOTwSaQ0jqO2pAVQai9f Hx3taY427QT7NePzw3c0bxt7+CLuUb3n9yMhVhU5Z0iolbXLd0oOiIhVt g==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="272290084" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="272290084" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:00:28 -0700 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="666551212" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:00:27 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 3/5] test_plans/ice_switch_filter_pppoe: change log level Date: Mon, 15 Aug 2022 14:00:33 +0000 Message-Id: <20220815140035.1186904-3-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220815140035.1186904-1-songx.jiale@intel.com> References: <20220815140035.1186904-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 the log level is too high, causing redundancy in the log display, so the log level is reduced. Signed-off-by: Jiale Song Acked-by: Peng, Yuan Signed-off-by: Jiale Song --- test_plans/ice_switch_filter_pppoe_test_plan.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_plans/ice_switch_filter_pppoe_test_plan.rst b/test_plans/ice_switch_filter_pppoe_test_plan.rst index 8cffb554..e2932f61 100644 --- a/test_plans/ice_switch_filter_pppoe_test_plan.rst +++ b/test_plans/ice_switch_filter_pppoe_test_plan.rst @@ -175,7 +175,7 @@ Prerequisites 6. Launch dpdk with the following arguments in non-pipeline mode:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:00.0 --log-level="ice,8" -- -i --txq=16 --rxq=16 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:00.0 --log-level="ice,7" -- -i --txq=16 --rxq=16 testpmd> port config 0 rss-hash-key ipv4 1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd testpmd> set fwd rxonly testpmd> set verbose 1 @@ -189,7 +189,7 @@ Prerequisites Launch dpdk in pipeline mode with the following testpmd command line:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:00.0,pipeline-mode-support=1 --log-level="ice,8" -- -i --txq=16 --rxq=16 + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:00.0,pipeline-mode-support=1 --log-level="ice,7" -- -i --txq=16 --rxq=16 Test case: Ethertype filter =========================== From patchwork Mon Aug 15 14:00:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 115105 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 CB86AA04FD; Mon, 15 Aug 2022 08:00:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF31141147; Mon, 15 Aug 2022 08:00:31 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 6D5EC400EF for ; Mon, 15 Aug 2022 08:00:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660543230; x=1692079230; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eDJV6ybGyb1r9Tqpb3VZnR6DtWe04TeXJoWTTxTcC8c=; b=FA+vIUs41paiudB5YCxYvdlVNmz6ZvZafc9aGYeIUqeRJp1hCu3C35JO 73Vlq/u7/lPljxg7GvrrXvS3stBHM6a64xgXNJSFV2wSDwUAn4M5DEB2Y 9TG8taWtDNdTok1Sg0oLRHbknEfAOjiVGjje2bmwnZss1hzhiFXKB1FH0 4JK8jSUmbkpdG1K+oMqltIZTFXZtIdou1A+FfDJ/YtLeVdY1c+fFdD7XB KJQ9V644dSm8Q96bOlfzU5AYNF6We93SmagR/H5aSSj57kuBbf8ExTmkE gOELJWPw7YcTk91V/7rjPb1Jw0/aFipr0NPc1jE5TQIYtqk1UXlupfjnf g==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="272290090" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="272290090" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:00:30 -0700 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="666551219" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:00:29 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 4/5] tests/ice_switch_filter_pppoe: optimize the rte_flow test process Date: Mon, 15 Aug 2022 14:00:34 +0000 Message-Id: <20220815140035.1186904-4-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220815140035.1186904-1-songx.jiale@intel.com> References: <20220815140035.1186904-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 1. synchronize test plans, lower log level. 2. optimization scripts, remove the method of reload ice. 3. optimize the rte_flow test process that the action is switch to queue. Signed-off-by: Jiale Song Acked-by: Peng, Yuan Signed-off-by: Jiale Song --- tests/TestSuite_ice_switch_filter_pppoe.py | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/TestSuite_ice_switch_filter_pppoe.py b/tests/TestSuite_ice_switch_filter_pppoe.py index c83195b3..356c79d1 100644 --- a/tests/TestSuite_ice_switch_filter_pppoe.py +++ b/tests/TestSuite_ice_switch_filter_pppoe.py @@ -2870,16 +2870,14 @@ class ICESwitchFilterPPPOETest(TestCase): self.generate_file_with_fdir_rules() self.path = self.dut.apps_name["test-pmd"] + self.rxq = 16 + self.rxq_param = "--rxq={0} --txq={0}".format(self.rxq) def set_up(self): """ Run before each test case. """ - self.reload_ice() - - def reload_ice(self): - self.dut.send_expect("rmmod ice", "# ", 15) - self.dut.send_expect("modprobe ice", "# ", 15) + pass def generate_file_with_fdir_rules(self): """ @@ -2918,9 +2916,8 @@ class ICESwitchFilterPPPOETest(TestCase): # Prepare testpmd EAL and parameters all_eal_param = self.dut.create_eal_parameters(cores="1S/4C/1T", ports=[0]) command = ( - self.path + all_eal_param + ' --log-level="ice,8" -- -i --rxq=16 --txq=16 ' + self.path + all_eal_param + ' --log-level="ice,7" -- -i %s' % self.rxq_param ) - # command = "./%s/app/testpmd %s --log-level=\"ice,8\" -- -i %s" % (self.dut.target, all_eal_param, "--rxq=16 --txq=16") return command def create_testpmd_command_pipeline_mode(self): @@ -2932,7 +2929,7 @@ class ICESwitchFilterPPPOETest(TestCase): cores="1S/4C/1T", ports=[0], port_options={0: "pipeline-mode-support=1"} ) command = ( - self.path + all_eal_param + ' --log-level="ice,8" -- -i --rxq=16 --txq=16' + self.path + all_eal_param + ' --log-level="ice,7" -- -i %s' % self.rxq_param ) return command @@ -2961,13 +2958,15 @@ class ICESwitchFilterPPPOETest(TestCase): """ # Specify the port to use dic["check_func"]["param"]["expect_port"] = port + dic["check_func"]["param"]["rxq"] = self.rxq + self.pmd.wait_link_status_up(port) self.dut.send_expect("start", "testpmd> ", 15) - time.sleep(2) # send packets self.pkt.update_pkt(dic["scapy_str"]) self.pkt.send_pkt(self.tester, tx_port=self.__tx_iface, count=1, timeout=370) - time.sleep(3) - out = self.dut.send_expect("stop", "testpmd> ", 15) + out1 = self.pmd.get_output(timeout=1) + out2 = self.pmd.execute_cmd("stop") + out = out1 + out2 result_flag, log_msg = dic["check_func"]["func"]( out, dic["check_func"]["param"], dic["expect_results"] ) @@ -3292,6 +3291,9 @@ class ICESwitchFilterPPPOETest(TestCase): count = 1 for tv in test_vectors: pattern_name = tv["name"] + self.logger.info( + GREEN("{0} case_name:{1} {0}".format("*" * 20, pattern_name)) + ) test_results[pattern_name] = OrderedDict() # get the queues that packets originally came to if count == 1: From patchwork Mon Aug 15 14:00:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 115106 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 EA713A034C; Mon, 15 Aug 2022 08:00:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E336940691; Mon, 15 Aug 2022 08:00:33 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id AFCD240A79 for ; Mon, 15 Aug 2022 08:00:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660543231; x=1692079231; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=huuRmYWXWc13bXfbrJR+WL+WEncg6oUtmfP9jYrHZwk=; b=CyGfWMbPNlerWGiWgc+MClv2/pRt8LLK5GChEwX3dKJ7lyr6Qbvt5DoP Jua3O8m3SgStioh9obhmFp3gTbbk+R5t9tK6s5LMMZTRVmkw2RiRuPv3N Y7eFZVQP8heR709m7Ub0gX1Lpi+bjfPkbjLdlT39NlQPr0lctZMpBpPAS tegX0DNTcFouYRux6wXXeBSrHDjrvPGbxjoDWGjNf+SmZLlgOLOPaMPag LUZ2fkXvvzJc0bT9eBWb+zagojWNpiYwdjmAt3sIEvXuLbobo64FzxDjH x2hcWofHCfqDDVvPYL9u1/piVLctlRsoYJG1dSzAJaSmGabtWWOXofGcN w==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="272290093" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="272290093" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:00:31 -0700 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="666551224" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:00:30 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 5/5] tests/rte_flow_common: optimize the rte_flow test process Date: Mon, 15 Aug 2022 14:00:35 +0000 Message-Id: <20220815140035.1186904-5-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220815140035.1186904-1-songx.jiale@intel.com> References: <20220815140035.1186904-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 1. add a method to check rss hash. 2. optimize the method of checking queue. Signed-off-by: Jiale Song Tested-by: Weiyuan Li Acked-by: Peng, Yuan Signed-off-by: Jiale Song Acked-by: Lijuan Tu --- tests/rte_flow_common.py | 150 ++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 81 deletions(-) diff --git a/tests/rte_flow_common.py b/tests/rte_flow_common.py index 0ad780d3..87892c13 100644 --- a/tests/rte_flow_common.py +++ b/tests/rte_flow_common.py @@ -123,36 +123,20 @@ def check_output_log_queue_region_mismatched(out, func_param, expect_results): when the action is queue region, check the expect port received the expect number packets, while the corresponding queues not receive any packets. """ - # parse input parameters - expect_port = func_param["expect_port"] - expect_queues = func_param["expect_queues"] + check_param = dict() expect_pkts = expect_results["expect_pkts"] - - log_msg = "" - # check expect_port received expect number packets - pkt_num = get_port_rx_packets_number(out, expect_port) - if pkt_num != expect_pkts: - log_msg = ( - "queue region mismatched: port %d receive %d packets, not receive %d packet" - % (expect_port, pkt_num, expect_pkts) - ) + check_param["port_id"] = ( + func_param["expect_port"] if func_param["expect_port"] else 0 + ) + check_param["queue"] = func_param["expect_queues"] + try: + check_queue(out, expect_pkts, check_param, stats=False) + except Exception as ex: + log_msg = ex return False, log_msg else: - # check expect queues not received packets - packet_sumnum = 0 - for queue_id in expect_queues: - pkt_num = get_queue_rx_packets_number(out, expect_port, queue_id) - packet_sumnum += pkt_num - log_msg = "" - if packet_sumnum == 0: - return True, log_msg - else: - log_msg = ( - "queue region mismatched: expect queues should receive 0 packets, but it received %d packets" - % packet_sumnum - ) - return False, log_msg + return True, log_msg def check_output_log_in_queue_mismatched(out, func_param, expect_results): @@ -161,32 +145,21 @@ def check_output_log_in_queue_mismatched(out, func_param, expect_results): number packets, while the corresponding queue not receive any packets. """ # parse input parameters - expect_port = func_param["expect_port"] - expect_queue = func_param["expect_queues"] + check_param = dict() expect_pkts = expect_results["expect_pkts"] - - log_msg = "" - # check expect_port received expect number packets - pkt_num = get_port_rx_packets_number(out, expect_port) - if pkt_num != expect_pkts: - log_msg = "mismatched: port %d receive %d packets, not receive %d packet" % ( - expect_port, - pkt_num, - expect_pkts, - ) + check_param["port_id"] = ( + func_param["expect_port"] if func_param["expect_port"] else 0 + ) + check_param["queue"] = func_param["expect_queues"] + check_queue(out, expect_pkts, check_param, stats=False) + try: + check_queue(out, expect_pkts, check_param, stats=False) + except Exception as ex: + log_msg = ex return False, log_msg else: - # check expect queue not received packets - pkt_num = get_queue_rx_packets_number(out, expect_port, expect_queue) log_msg = "" - if pkt_num == 0: - return True, log_msg - else: - log_msg = ( - "mismatched: expect queue Port= %d/Queue= %d should receive 0 packets, but it received %d packets" - % (expect_port, expect_queue, pkt_num) - ) - return False, log_msg + return True, log_msg def check_output_log_drop(out, func_param, expect_results): @@ -372,47 +345,61 @@ def verify(passed, description): raise AssertionError(description) -def check_queue(out, check_param, stats=True): +def check_rss(out, pkt_num, check_param, stats=True): + """ + check whether the packet directed by rss or not according to the specified parameters + :param out: information received by testpmd after sending packets and port statistics + :param kwargs: some specified parameters, such as: rxq, stats + :return: queue value list + usage: + check_rss(out, rxq=rxq, stats=stats) + """ + verify(check_param.get("rxq"), "not get rxq") + rxq = check_param.get("rxq") + p = re.compile("RSS\shash=(\w+)\s-\sRSS\squeue=(\w+)") + pkt_info = p.findall(out) + verify(len(pkt_info) == pkt_num, "some packets no hash:{}".format(p.pattern)) + pkt_queue = set([int(i[1], 16) for i in pkt_info]) + if stats: + verify( + all([int(i[0], 16) % rxq == int(i[1], 16) for i in pkt_info]), + "some pkt not directed by rss.", + ) + print((GREEN("pass: all pkts directed by rss"))) + else: + verify( + not any([int(i[0], 16) % rxq == int(i[1], 16) for i in pkt_info]), + "some pkt directed by rss, expect not directed by rss", + ) + print((GREEN("pass: no pkt directed by rss"))) + return pkt_queue + + +def check_queue(out, pkt_num, check_param, stats=True): port_id = check_param["port_id"] if check_param.get("port_id") is not None else 0 queue = check_param["queue"] + queue = queue if isinstance(queue, list) else [queue] p = re.compile(r"port\s+%s/queue(.+?):\s+received\s+(\d+)\s+packets" % port_id) res = p.findall(out) if res: + verify( + len(res) == pkt_num, + "fail: queue num not matched, expect got queue num is %s, got %s" + % (pkt_num, len(res)), + ) pkt_queue = set([int(i[0]) for i in res]) if stats: - if isinstance(queue, int): - verify( - all(q == queue for q in pkt_queue), - "fail: queue id not matched, expect queue %s, got %s" - % (queue, pkt_queue), - ) - print((GREEN("pass: queue id %s matched" % pkt_queue))) - elif isinstance(queue, list): - verify( - all(q in queue for q in pkt_queue), - "fail: queue id not matched, expect queue %s, got %s" - % (queue, pkt_queue), - ) - print((GREEN("pass: queue id %s matched" % pkt_queue))) - else: - raise Exception("wrong queue value, expect int or list") + verify( + all(q in queue for q in pkt_queue), + "fail: queue id not matched, expect queue %s, got %s" + % (queue, pkt_queue), + ) + print((GREEN("pass: queue id %s matched" % pkt_queue))) else: - if isinstance(queue, int): - verify( - not any(q == queue for q in pkt_queue), - "fail: queue id should not matched, expect queue %s, got %s" - % (queue, pkt_queue), - ) - print((GREEN("pass: queue id %s not matched" % pkt_queue))) - elif isinstance(queue, list): - verify( - not any(q in queue for q in pkt_queue), - "fail: each queue in %s should not in queue %s" - % (pkt_queue, queue), - ) + if not any(q in queue for q in pkt_queue): print((GREEN("pass: queue id %s not matched" % pkt_queue))) else: - raise Exception("wrong action value, expect queue_index or queue_group") + check_rss(out, pkt_num, check_param, stats=True) return pkt_queue else: raise Exception("got wrong output, not match pattern %s" % p.pattern) @@ -484,7 +471,7 @@ def check_mark(out, pkt_num, check_param, stats=True): else: verify(not fdir_flag, "output should not include mark id") if queue is not None: - check_queue(out, check_param, stats) + check_queue(out, pkt_num, check_param, stats) if rss_flag: pkt_queue = verify_directed_by_rss(out, rxq, stats=True) else: @@ -1687,7 +1674,8 @@ class FdirProcessing(object): ), ) else: - check_queue(out, check_param, stats=stats) + check_param["rxq"] = self.rxq + check_queue(out, expect_pkt, check_param, stats=stats) def handle_priority_cases(self, vectors): rule = vectors["rule"]