From patchwork Tue Apr 13 03:32:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang An X-Patchwork-Id: 91162 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 8D3FEA0562; Tue, 13 Apr 2021 05:23:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 888201609F8; Tue, 13 Apr 2021 05:23:58 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 3DD111609EB for ; Tue, 13 Apr 2021 05:23:57 +0200 (CEST) IronPort-SDR: O8g+0TmlrUTVSBAg3NbVAfnocCP/vJr9pbN0lWgee22/heMZqYkaWerrOL2VeIAE/GFvsVR+jA 9PcfEfpRWgDA== X-IronPort-AV: E=McAfee;i="6200,9189,9952"; a="181848423" X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="181848423" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2021 20:23:56 -0700 IronPort-SDR: vfaj7tuMa+oYMVrgjejT4FgB44rFclaRJ+skdQzRKY2mqH40/OYGKikW5iYVD5LvTTiUSg6MEK P8vyhp/hB3jw== X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="424071239" Received: from unknown (HELO dpdk-zhaohy-t.sh.intel.com) ([10.240.183.68]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2021 20:23:54 -0700 From: Xiang An To: dts@dpdk.org Cc: yuan.peng@intel.com, Xiang An Date: Tue, 13 Apr 2021 11:32:51 +0800 Message-Id: <1618284772-90722-2-git-send-email-xiangx.an@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1618284772-90722-1-git-send-email-xiangx.an@intel.com> References: <1618284772-90722-1-git-send-email-xiangx.an@intel.com> Subject: [dts] [PATCH V3 1/2] tests/cvl_advanced_rss_gtpogre: add case parse_pfcp_over_gre_packet 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" Signed-off-by: Xiang An --- tests/TestSuite_cvl_advanced_rss_gtpogre.py | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/tests/TestSuite_cvl_advanced_rss_gtpogre.py b/tests/TestSuite_cvl_advanced_rss_gtpogre.py index 4a889ea..d202509 100755 --- a/tests/TestSuite_cvl_advanced_rss_gtpogre.py +++ b/tests/TestSuite_cvl_advanced_rss_gtpogre.py @@ -3503,7 +3503,59 @@ class TestCVLAdvancedRSSGTPoGRE(TestCase): self.switch_testpmd(enable_rss=True) self.rssprocess.handle_rss_distribute_cases(cases_info=inner_l4_protocal_hash) + def change_dpdk_code(self): + """ + change dpdk's code to show the PFCP ptype + """ + file_location = "drivers/net/ice/ice_rxtx.c" + match1 = "rte_le_to_cpu_16(rxdp\[j\].wb.ptype_flex_flags0)\];" + match2 = "ice_set_rx_function(struct rte_eth_dev \*dev)" + insert1 = "printf(\"ptype: %3d\\\\n\", ICE_RX_FLEX_DESC_PTYPE_M & rte_le_to_cpu_16(rxdp\[j\].wb.ptype_flex_flags0));" + insert2 = "#endif" + insert3 = "#if 0" + + self.dut.send_expect("rm -rf drivers/net/ice/ice_rxtx.c_bak", "# ") + self.dut.send_expect("cp -rf drivers/net/ice/ice_rxtx.c drivers/net/ice/ice_rxtx.c_bak", "# ") + self.dut.send_expect("sed -i '/%s/a\%s' %s"%(match1,insert1,file_location), "# ") + self.dut.send_expect("sed -i '/%s/{n;n;n;n;n;s|$|\\n%s|}' %s" % (match2, insert2, file_location), "# ") + self.dut.send_expect("sed -i '/%s/{n;n;n;n;n;n;s|$|\\n%s|}' %s" % (match2, insert3, file_location), "# ") + + def recovery_dpdk_code(self): + """ + Recovery dpdk's code after the case finished + """ + self.dut.send_expect("rm -rf drivers/net/ice/ice_rxtx.c", "# ") + self.dut.send_expect("cp -rf drivers/net/ice/ice_rxtx.c_bak drivers/net/ice/ice_rxtx.c", "# ") + + def test_parse_pfcp_over_gre_packet(self): + self.pmd_output.quit() + self.change_dpdk_code() + self.dut.build_install_dpdk(self.dut.target) + + pkt1 = 'Ether(dst="00:11:22:33:44:55")/IP(proto=0x2F)/GRE(proto=0x0800)/IP()/UDP(sport=22, dport=8805)/PFCP(S=0)' + pkt2 = 'Ether(dst="00:11:22:33:44:55")/IP(proto=0x2F)/GRE(proto=0x0800)/IP()/UDP(sport=22, dport=8805)/PFCP(S=1, seid=123)' + pkt3 = 'Ether(dst="00:11:22:33:44:55")/IPv6(nh=0x2F)/GRE(proto=0x86dd)/IPv6()/UDP(sport=22, dport=8805)/PFCP(S=0)' + pkt4 = 'Ether(dst="00:11:22:33:44:55")/IPv6(nh=0x2F)/GRE(proto=0x86dd)/IPv6()/UDP(sport=22, dport=8805)/PFCP(S=1, seid=256)' + pkts = [pkt1, pkt2, pkt3, pkt4] + p = Packet() + for i in pkts: + p.append_pkt(i) + self.switch_testpmd(enable_rss=True) + p.send_pkt(self.tester, tx_port=self.tester_iface0) + out = self.pmd_output.get_output(timeout=1) + + self.verify('ptype: 351' in out,'some subcase failed') + self.verify('ptype: 352' in out,'some subcase failed') + self.verify('ptype: 353' in out,'some subcase failed') + self.verify('ptype: 354' in out,'some subcase failed') + def tear_down(self): + #Judge the currently running case + if self.running_case == "test_parse_pfcp_over_gre_packet" : + self.pmd_output.quit() + self.recovery_dpdk_code() + self.dut.build_install_dpdk(self.dut.target) + self.switch_testpmd(enable_rss=False) # destroy all flow rule on port 0 self.dut.send_command("flow flush 0", timeout=1) self.dut.send_command("clear port stats all", timeout=1)