From patchwork Thu Feb 4 11:16:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sun, QinX" X-Patchwork-Id: 87711 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 598CAA0A0E; Thu, 4 Feb 2021 03:46:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 347B12404E7; Thu, 4 Feb 2021 03:46:11 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id D22872404E3 for ; Thu, 4 Feb 2021 03:46:09 +0100 (CET) IronPort-SDR: 5Qj4clt3DoYnOJMBlxyyxwr/XK9/motz3RjVsuOtKYb3OKdzFIjxLCxyMhDCnXHt8v1tKUuOBk 9p/wPIbz8QEQ== X-IronPort-AV: E=McAfee;i="6000,8403,9884"; a="265990142" X-IronPort-AV: E=Sophos;i="5.79,399,1602572400"; d="scan'208";a="265990142" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 18:46:07 -0800 IronPort-SDR: Vv4vsQIorquIHNCZyYKk1u+8/K1hmwf+xpl81YoJtp0uFbHfx5M8O4yHvi5GKig6EhvbgBVzRl Csh0IlZf/PjA== X-IronPort-AV: E=Sophos;i="5.79,399,1602572400"; d="scan'208";a="583035880" Received: from unknown (HELO localhost.localdomain) ([10.240.183.105]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 18:46:05 -0800 From: sunqin To: dts@dpdk.org Cc: sunqin Date: Thu, 4 Feb 2021 11:16:34 +0000 Message-Id: <20210204111634.2633-1-qinx.sun@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] tests/iavf_fdir: modify expection of rule check after port stop 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" DPDK change: when port stop,flow rules will be obsolete to prevent memory leak. modify 7 related test cases. cvl_dcf_switch_filter: dcf_stop_start dcf_lifecycle: handle_acl_filter_06 iavf_fdir: stress_vf_port_reset_delete_rule stress_pf_reset_vf_delete_rule stress_pf_reset_vf_add_new_rule stress_vf_port_reset_add_new_rule stress_port_stop_start Signed-off-by: sunqin Tested-by: Sun, QinX Acked-by: Haiyang Zhao --- tests/TestSuite_cvl_dcf_switch_filter.py | 4 +- tests/TestSuite_dcf_lifecycle.py | 5 +- tests/TestSuite_iavf_fdir.py | 71 +++++++++++++----------- 3 files changed, 44 insertions(+), 36 deletions(-) diff --git a/tests/TestSuite_cvl_dcf_switch_filter.py b/tests/TestSuite_cvl_dcf_switch_filter.py index be2e6cd6..1904ef47 100644 --- a/tests/TestSuite_cvl_dcf_switch_filter.py +++ b/tests/TestSuite_cvl_dcf_switch_filter.py @@ -2189,8 +2189,8 @@ class CVLDCFSwitchFilterTest(TestCase): #stop the DCF, then start the DCF self.dut.send_expect("port stop 0", "testpmd> ") self.dut.send_expect("port start 0", "testpmd> ") - self.check_switch_filter_rule_list(0, rule_list) - #send matched packets, port 1 can still receive the packets. + #send matched packets, port 1 can not receive the packets. + matched_dic['expect_results'] = {"expect_pkts":0} self.send_and_check_packets(matched_dic) def test_mac_ipv4_pfcp_node(self): diff --git a/tests/TestSuite_dcf_lifecycle.py b/tests/TestSuite_dcf_lifecycle.py index b5e60183..5ae6372f 100644 --- a/tests/TestSuite_dcf_lifecycle.py +++ b/tests/TestSuite_dcf_lifecycle.py @@ -1437,12 +1437,13 @@ class TestDcfLifeCycle(TestCase): # reset VF0 in testpmd cmds = ['stop', 'port stop 0', 'port reset 0', 'port start 0', 'start'] [self.d_con([cmd, "testpmd> ", 15]) for cmd in cmds] - self.check_rule_list() self.clear_vf_pmd2_port0_stats() self.send_pkt_to_vf1_first(self.dmac) out = self.vf_pmd2_con(['stop', "testpmd> ", 15]) drop_num = re.findall("RX-dropped:\s+(.*?)\s+?", out) - self.verify(int(drop_num[0]) == 1, 'the packet is not dropped by VF1, the rule can not take effect') + rx_num = re.findall("RX-total:\s+(.*?)\s+?", out) + self.verify(int(drop_num[0]) == 0, 'the packet is dropped by VF1, the rule still take effect') + self.verify(int(rx_num[0]) == 1, 'the packet not received by VF1') self.run_test_post() def test_dcf_with_acl_filter_01(self): diff --git a/tests/TestSuite_iavf_fdir.py b/tests/TestSuite_iavf_fdir.py index a14b4da7..25aa662b 100644 --- a/tests/TestSuite_iavf_fdir.py +++ b/tests/TestSuite_iavf_fdir.py @@ -3267,9 +3267,11 @@ class TestIAVFFdir(TestCase): self.dut.send_expect("port stop 0", "testpmd> ") self.dut.send_expect("port start 0", "testpmd> ") self.dut.send_expect("start", "testpmd> ") - self.check_fdir_rule(port_id=0, rule_list=['0']) + #show the rule list, there is no rule listed + self.check_fdir_rule(port_id=0, stats=False) out = self.send_pkts_getouput(pkts=pkt) - rfc.check_iavf_fdir_mark(out, pkt_num=1, check_param={"port_id": 0, "mark_id": 0, "queue": 1}, stats=True) + rfc.verify_iavf_fdir_directed_by_rss(out) + rfc.check_iavf_fdir_mark(out, pkt_num=1, check_param={"port_id": 0, "mark_id": 0, "queue": 1}, stats=False) def test_stress_delete_rules(self): """ @@ -3354,11 +3356,13 @@ class TestIAVFFdir(TestCase): self.dut.send_expect("port reset 0", "testpmd> ") self.dut.send_expect("port start 0", "testpmd> ") self.dut.send_expect("start", "testpmd> ") - # check the rule of port0 is still listed, but doesn't take effect. - self.check_fdir_rule(port_id=0, rule_list=['0']) + # check there is not rule listed on port 0, the rule of port 1 is still be listed. + self.check_fdir_rule(port_id=0, stats=False) self.check_fdir_rule(port_id=1, rule_list=['0']) out0 = self.send_pkts_getouput(pkts=pkts[0]) - rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 0, "passthru": 1}, stats=True) + #check the packet is distributed by RSS + rfc.verify_iavf_fdir_directed_by_rss(out0) + rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 0, "passthru": 1}, stats=False) out1 = self.send_pkts_getouput(pkts=pkts[1]) rfc.check_iavf_fdir_mark(out1, pkt_num=1, check_param={"port_id": 1, "mark_id": 0, "queue": 1}, stats=True) # create the rule again @@ -3393,22 +3397,22 @@ class TestIAVFFdir(TestCase): rfc.check_iavf_fdir_mark(out1, pkt_num=1, check_param={"port_id": 1, "mark_id": 0, "queue": 6}, stats=True) # reset vf self.dut.send_expect("stop", "testpmd> ") - self.dut.send_expect("port stop 0", "testpmd> ") - self.dut.send_expect("port reset 0", "testpmd> ") - self.dut.send_expect("port start 0", "testpmd> ") + self.dut.send_expect("port stop 1", "testpmd> ") + self.dut.send_expect("port reset 1", "testpmd> ") + self.dut.send_expect("port start 1", "testpmd> ") self.dut.send_expect("start", "testpmd> ") - # check the rule of port0 is still listed, but doesn't take effect. + # check the rule of port0 is still listed, check there is not rule listed on port 1. self.check_fdir_rule(port_id=0, rule_list=['0']) - self.check_fdir_rule(port_id=1, rule_list=['0']) + self.check_fdir_rule(port_id=1, stats=False) out0 = self.send_pkts_getouput(pkts=pkts[0]) - rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 0, "passthru": 1}, stats=True) + rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 0, "mark_id": 0, "queue": 6}, stats=True) out1 = self.send_pkts_getouput(pkts=pkts[1]) - rfc.check_iavf_fdir_mark(out1, pkt_num=1, check_param={"port_id": 1, "mark_id": 0, "queue": 6}, stats=True) + #check the packet is distributed by RSS + rfc.verify_iavf_fdir_directed_by_rss(out1) + rfc.check_iavf_fdir_mark(out1, pkt_num=1, check_param={"port_id": 1, "mark_id": 0, "queue": 6}, stats=False) # delete the rules - self.dut.send_expect("flow destroy 0 rule 0", "Invalid flow destroy") - self.destroy_fdir_rule(rule_id='0', port_id=1) - out0 = self.send_pkts_getouput(pkts=pkts[0]) - rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 0, "mark_id": 0, "queue": 6}, stats=False) + self.destroy_fdir_rule(rule_id='0', port_id=0) + rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 0, "mark_id": 0, "queue": 6}, stats=True) out1 = self.send_pkts_getouput(pkts=pkts[1]) rfc.check_iavf_fdir_mark(out1, pkt_num=1, check_param={"port_id": 1, "mark_id": 0, "queue": 6}, stats=False) # relaunch testpmd, and create the rules, check matched packets. @@ -3450,6 +3454,8 @@ class TestIAVFFdir(TestCase): self.dut.send_expect("port reset 0", "testpmd> ") self.dut.send_expect("port start 0", "testpmd> ") self.dut.send_expect("start", "testpmd> ") + #check there is not rule listed on vf0 + self.check_fdir_rule(0,stats=False) out0 = self.send_pkts_getouput(pkts=pkts[2]) rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 0, "passthru": 1}, stats=True) out1 = self.send_pkts_getouput(pkts=pkts[1]) @@ -3491,36 +3497,37 @@ class TestIAVFFdir(TestCase): out1 = self.send_pkts_getouput(pkts=pkts[1]) rfc.check_iavf_fdir_mark(out1, pkt_num=1, check_param={"port_id": 1, "mark_id": 0, "queue": 6}, stats=True) - self.session_secondary.send_expect("ip link set %s vf 0 mac 00:11:22:33:44:56" % self.pf0_intf, "# ") + self.session_secondary.send_expect("ip link set %s vf 1 mac 00:11:22:33:44:56" % self.pf0_intf, "# ") out = self.dut.session.get_session_before(timeout=2) - self.verify("Port 0: reset event" in out, "failed to reset vf0") + self.verify("Port 1: reset event" in out, "failed to reset vf1") self.dut.send_expect("stop", "testpmd> ") - self.dut.send_expect("port stop 0", "testpmd> ") - self.dut.send_expect("port reset 0", "testpmd> ") - self.dut.send_expect("port start 0", "testpmd> ") + self.dut.send_expect("port stop 1", "testpmd> ") + self.dut.send_expect("port reset 1", "testpmd> ") + self.dut.send_expect("port start 1", "testpmd> ") self.dut.send_expect("start", "testpmd> ") + #check there is not rule listed on vf1 + self.check_fdir_rule(1,stats=False) out0 = self.send_pkts_getouput(pkts=pkts[2]) - rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 0, "passthru": 1}, stats=True) - out1 = self.send_pkts_getouput(pkts=pkts[1]) - rfc.check_iavf_fdir_mark(out1, pkt_num=1, check_param={"port_id": 1, "mark_id": 0, "queue": 6}, stats=True) - # delete the rules - self.dut.send_expect("flow destroy 0 rule 0", "Invalid flow destroy") - self.destroy_fdir_rule(rule_id='0', port_id=1) - out0 = self.send_pkts_getouput(pkts=pkts[2]) + rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 1, "passthru": 1}, stats=True) + out1 = self.send_pkts_getouput(pkts=pkts[0]) + rfc.check_iavf_fdir_mark(out1, pkt_num=1, check_param={"port_id": 0, "mark_id": 0, "queue": 6}, stats=True) + #delete the rules + self.dut.send_expect("flow destroy 0 rule 0", "Flow rule #0 destroyed") + out0 = self.send_pkts_getouput(pkts=pkts[0]) rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 0, "mark_id": 0, "queue": 6}, stats=False) - out1 = self.send_pkts_getouput(pkts=pkts[1]) + out1 = self.send_pkts_getouput(pkts=pkts[2]) rfc.check_iavf_fdir_mark(out1, pkt_num=1, check_param={"port_id": 1, "mark_id": 0, "queue": 6}, stats=False) # relaunch testpmd, and create the rules, check matched packets. self.dut.send_expect("quit", "# ") self.launch_testpmd() self.create_fdir_rule(rules, check_stats=True) - out0 = self.send_pkts_getouput(pkts=pkts[2]) + out0 = self.send_pkts_getouput(pkts=pkts[0]) rfc.check_iavf_fdir_mark(out0, pkt_num=1, check_param={"port_id": 0, "mark_id": 0, "queue": 6}, stats=True) - out1 = self.send_pkts_getouput(pkts=pkts[1]) + out1 = self.send_pkts_getouput(pkts=pkts[2]) rfc.check_iavf_fdir_mark(out1, pkt_num=1, check_param={"port_id": 1, "mark_id": 0, "queue": 6}, stats=True) self.dut.send_expect("quit", "# ") - self.session_secondary.send_expect("ip link set %s vf 0 mac 00:11:22:33:44:55" % self.pf0_intf, "# ") + self.session_secondary.send_expect("ip link set %s vf 1 mac 00:11:22:33:44:66" % self.pf0_intf, "# ") self.dut.close_session(self.session_secondary) def checksum_enablehw(self, port, hw):