From patchwork Mon Aug 1 08:48:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 114484 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 3EE29A00C3; Mon, 1 Aug 2022 11:29:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 366F942C7F; Mon, 1 Aug 2022 11:29:41 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 8A23E4067B for ; Mon, 1 Aug 2022 11:29:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659346179; x=1690882179; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bo7K//GBEA6h1/htzOnYTdiNl6FvWWg4NvpsV5Jfw4c=; b=CSuKBP1ykUNTXFx4SoS/7dNvnJwZSTLNFI1VweACoBJKdSLjIrR1FJeQ GbrTD0zjAiqrfns2nEkn+MOKW30N90mX5ckioT5p+bKS115pCzPhvoT3b l1JYvC6Fsxyh9X555ac9Eu92ezYe4yxQ151ouD/zIyF/7mNo3fMNKUqk2 QkJKHV1GXDwwfRAeHDuKwL+tDE1abHFy9+oDrZTK11Yz/ohGU7iYpd7RJ F1mcdRSEp24Os5pZX3CJFq5EybLxyljQhkaRcFrlnF5gpEhNqLjyACmYy +ffPOsS6YVLWgIAnOTWM0S6qlUbzB9HY3qSsYdMzthEMyOMaHRWI1QFAz A==; X-IronPort-AV: E=McAfee;i="6400,9594,10425"; a="289116466" X-IronPort-AV: E=Sophos;i="5.93,206,1654585200"; d="scan'208";a="289116466" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2022 02:29:39 -0700 X-IronPort-AV: E=Sophos;i="5.93,206,1654585200"; d="scan'208";a="661074129" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2022 02:29:37 -0700 From: Lingli Chen To: dts@dpdk.org Cc: yuan.peng@intel.com, Lingli Chen Subject: [dts][PATCH V1 2/2] tests/generic_flow_api: add case fdir_wrong_parameters sync with testplan Date: Mon, 1 Aug 2022 04:48:31 -0400 Message-Id: <20220801084831.9233-2-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220801084831.9233-1-linglix.chen@intel.com> References: <20220801084831.9233-1-linglix.chen@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 add i40e case fdir_wrong_parameters sync with testplan, test_fdir_for_flexbytes: remove Exceeds maximum payload limit rules test to case fdir_wrong_parameters Signed-off-by: Lingli Chen --- tests/TestSuite_generic_flow_api.py | 89 ++++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 9 deletions(-) diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py index 73689a0e..817712a0 100644 --- a/tests/TestSuite_generic_flow_api.py +++ b/tests/TestSuite_generic_flow_api.py @@ -3438,6 +3438,86 @@ class TestGeneric_flow_api(TestCase): rule_num = extrapkt_rulenum["rulenum"] self.verify_rulenum(rule_num + 1) + support_nic = [ + "I40E_10G-SFP_XL710", + "I40E_25G-25G_SFP28", + "I40E_40G-QSFP_A", + "I40E_10G-10G_BASE_T_BC", + "I40E_40G-QSFP_B", + "I40E_10G-SFP_X722", + "I40E_10G-10G_BASE_T_X722", + ] + + @check_supported_nic(support_nic) + def test_fdir_wrong_parameters(self): + """ + Test case: IntelĀ® Ethernet 700 Series fdir wrong parameters + """ + + self.pmdout.start_testpmd( + "%s" % self.pf_cores, + "--disable-rss --rxq=%d --txq=%d --pkt-filter-mode=perfect" + % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "-a %s --socket-mem 1024,1024 --file-prefix=pf " % self.pf_pci, + ) + self.dut.send_expect("set fwd rxonly", "testpmd> ", 120) + self.dut.send_expect("set verbose 1", "testpmd> ", 120) + self.dut.send_expect("start", "testpmd> ", 120) + time.sleep(2) + + # creat the flow rules + # l2-payload exceeds the max length of raw match is 16bytes + self.dut.send_expect( + "flow validate 0 ingress pattern eth type is 0x0807 / raw relative is 1 pattern is abcdefghijklmnopq / end actions queue index 1 / end", + "error", + ) + self.dut.send_expect( + "flow create 0 ingress pattern eth type is 0x0807 / raw relative is 1 pattern is abcdefghijklmnopq / end actions queue index 1 / end", + "Exceeds maximal payload limit", + ) + # can't set mac_addr when setting fdir filter + self.dut.send_expect( + "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 4095 / ipv6 src is 2001::3 dst is 2001::4 tc is 6 hop is 60 / tcp src is 32 dst is 33 / end actions queue index 3 / end", + "error", + ) + + # can't change the configuration of the same packet type + self.dut.send_expect( + "flow create 0 ingress pattern eth / vlan tci is 3 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 4 / sctp src is 44 dst is 45 tag is 1 / end actions passthru / flag / end", + "created", + ) + self.dut.send_expect( + "flow create 0 ingress pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 4 / sctp src is 34 dst is 35 tag is 1 / end actions passthru / flag / end", + "error", + ) + + # invalid queue ID + self.dut.send_expect( + "flow create 0 ingress pattern eth / ipv6 src is 2001::3 dst is 2001::4 tc is 6 hop is 60 / tcp src is 32 dst is 33 / end actions queue index 16 / end", + "error", + ) + self.dut.send_expect("quit", "# ") + time.sleep(2) + + self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], 1, self.kdriver) + self.vf_port = self.dut.ports_info[self.dut_ports[0]]["vfs_port"][0] + self.vf_port.bind_driver(driver="vfio-pci") + self.vf_port_pci = self.dut.ports_info[self.dut_ports[0]]["sriov_vfs_pci"][0] + # start testpmd on vf0 + self.pmdout.start_testpmd( + "default", + "--rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect", + eal_param="-a %s --socket-mem 1024,1024 --file-prefix=vf" + % self.vf_port_pci, + ) + self.dut.send_expect("start", "testpmd>") + time.sleep(2) + # create a rule on vf that has invalid queue ID + self.dut.send_expect( + "flow create 0 ingress transfer pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 proto is 3 / vf id is 0 / end actions queue index 4 / end", + "error", + ) + def test_fdir_for_flexbytes(self): """ The filter structure is different between igb, ixgbe and i40e @@ -3485,15 +3565,6 @@ class TestGeneric_flow_api(TestCase): time.sleep(2) # creat the flow rules - # l2-payload exceeds the max length of raw match is 16bytes - self.dut.send_expect( - "flow validate 0 ingress pattern eth type is 0x0807 / raw relative is 1 pattern is abcdefghijklmnopq / end actions queue index 1 / end", - "error", - ) - self.dut.send_expect( - "flow create 0 ingress pattern eth type is 0x0807 / raw relative is 1 pattern is abcdefghijklmnopq / end actions queue index 1 / end", - "Exceeds maximal payload limit", - ) # l2-payload equal the max length of raw match is 16bytes self.dut.send_expect( "flow validate 0 ingress pattern eth type is 0x0807 / raw relative is 1 pattern is abcdefghijklmnop / end actions queue index 1 / end",