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 A71B842995; Thu, 20 Apr 2023 11:14:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78E2A42B71; Thu, 20 Apr 2023 11:14:47 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 3652940687 for ; Thu, 20 Apr 2023 11:14:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681982085; x=1713518085; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=tvZBmsl3Q/U+7uHO1iks+VV4rUb6UF2xwp97xEmMhtM=; b=INwQegPqhhVDGCPwjoA6VB51fEZmF9LJwmgoT4Y6oMs5+UvqF97xnZ4w DPelaPAfQ48nbj7LldD2Gt7DDrs4RhQe8AVBJVthbww38lqOEZ96wRgWk PEYd8kl7FJU+nhDVmFJBpyjfC/3hSBNefvv15/lxheeEVrXwsGxJvO+el aOaXsOQAa4kKIK+NxKh47gi/bdciFXtzrE4Q9A5eSqP6pX5+lDRF8z1JC KAO1lbVFBSYThIUFIp7nHgVy+cGiov6BOuvRd4x5cdMCaq2XA/akD6a47 J3WrRGSG4SZ/mkz6R6+2KFdB+RMNecNL9mVv8ocb9f5GJ7GfykLpw/Wls g==; X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="373576345" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="373576345" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 02:14:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="1021522928" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="1021522928" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 02:14:41 -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 ixgbe new cases Date: Thu, 20 Apr 2023 04:03:49 -0400 Message-Id: <20230420080349.12703-2-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230420080349.12703-1-linglix.chen@intel.com> References: <20230420080349.12703-1-linglix.chen@intel.com> 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 ixgbe fdir for ipv6/ipv4 mask test cases Signed-off-by: Lingli Chen --- tests/TestSuite_generic_flow_api.py | 126 ++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py index 9fadff63..b0d0eb44 100644 --- a/tests/TestSuite_generic_flow_api.py +++ b/tests/TestSuite_generic_flow_api.py @@ -5899,6 +5899,132 @@ class TestGeneric_flow_api(TestCase): else: self.verify(False, "%s not support this test" % self.nic) + def launch_testpmd(self): + """ + launch testpmd for IXGBE fdir mask test + """ + self.pmdout.start_testpmd( + "all", + "--rxq=%d --txq=%d --nb-cores=%d --disable-rss" + % (MAX_QUEUE + 1, MAX_QUEUE + 1, MAX_QUEUE + 1), + ) + self.dut.send_expect("set fwd rxonly", "testpmd> ") + self.dut.send_expect("set verbose 1", "testpmd> ") + self.dut.send_expect("start", "testpmd> ") + self.pmdout.wait_link_status_up("all") + + @check_supported_nic("IXGBE_10G-82599_SFP") + def test_fdir_for_ipv6_dst_mask(self): + """ + only supported by ixgbe + """ + self.launch_testpmd() + + self.dut.send_expect( + "flow create 0 ingress pattern fuzzy thresh spec 1 thresh mask 1 / ipv6 dst spec 2001::64 dst mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff / end actions queue index 2 / end", + "created", + ) + # send the packets and verify the results + self.sendpkt( + pktstr="""Ether(dst="00:11:22:33:44:55")/IPv6(src="2001::3", dst="2001::64")/Raw('x' * 20)""" + ) + + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="2", verify_mac="00:11:22:33:44:55" + ) + + self.sendpkt( + pktstr="""Ether(dst="00:11:22:33:44:55")/IPv6(src="2001::3", dst="2001::63")/Raw('x' * 20)""" + ) + + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="0", verify_mac="00:11:22:33:44:55" + ) + + @check_supported_nic("IXGBE_10G-82599_SFP") + def test_fdir_for_ipv6_src_mask(self): + """ + only supported by ixgbe + """ + self.launch_testpmd() + + self.dut.send_expect( + "flow create 0 ingress pattern fuzzy thresh spec 1 thresh mask 1 / ipv6 src spec 2001::63 src mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff / end actions queue index 1 / end", + "created", + ) + # send the packets and verify the results + self.sendpkt( + pktstr="""Ether(dst="00:11:22:33:44:55")/IPv6(src="2001::63", dst="2001::64")/Raw('x' * 20)""" + ) + + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="1", verify_mac="00:11:22:33:44:55" + ) + + self.sendpkt( + pktstr="""Ether(dst="00:11:22:33:44:55")/IPv6(src="2001::3", dst="2001::64")/Raw('x' * 20)""" + ) + + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="0", verify_mac="00:11:22:33:44:55" + ) + + @check_supported_nic("IXGBE_10G-82599_SFP") + def test_fdir_for_ipv4_dst_mask(self): + """ + only supported by ixgbe + """ + self.launch_testpmd() + + self.dut.send_expect( + "flow create 0 ingress pattern fuzzy thresh spec 1 thresh mask 1 / eth / ipv4 dst spec 100.0.0.5 dst mask 255.255.255.255 / end actions queue index 3 / end", + "created", + ) + # send the packets and verify the results + self.sendpkt( + pktstr="""Ether(dst="00:11:22:33:44:55")/IP(dst="100.0.0.5", src="192.168.0.1")/Raw('x' * 20)""" + ) + + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="3", verify_mac="00:11:22:33:44:55" + ) + + self.sendpkt( + pktstr="""Ether(dst="00:11:22:33:44:55")/IP(dst="100.0.0.6", src="192.168.0.1")/Raw('x' * 20)""" + ) + + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="0", verify_mac="00:11:22:33:44:55" + ) + + @check_supported_nic("IXGBE_10G-82599_SFP") + def test_fdir_for_ipv4_src_mask(self): + """ + only supported by ixgbe + """ + self.launch_testpmd() + + self.dut.send_expect( + "flow create 0 ingress pattern fuzzy thresh spec 1 thresh mask 1 / eth / ipv4 src spec 100.0.0.5 src mask 255.255.255.255 / end actions queue index 3 / end", + "created", + ) + # send the packets and verify the results + self.sendpkt( + pktstr="""Ether(dst="00:11:22:33:44:55")/IP(src="100.0.0.5", dst="192.168.0.1")/Raw('x' * 20)""" + ) + + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="3", verify_mac="00:11:22:33:44:55" + ) + + self.sendpkt( + pktstr="""Ether(dst="00:11:22:33:44:55")/IP(src="100.0.0.6", dst="192.168.0.1")/Raw('x' * 20)""" + ) + + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="0", verify_mac="00:11:22:33:44:55" + ) + def tear_down(self): """ Run after each test case. -- 2.17.1