From patchwork Mon Sep 5 18:51:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 115888 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 B04AEA0553; Mon, 5 Sep 2022 12:51:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA31540695; Mon, 5 Sep 2022 12:51:27 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 08006400D6 for ; Mon, 5 Sep 2022 12:51:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662375086; x=1693911086; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=EZj9GjrHFuNu8L4uVze9+QrOJ3JIjrAb4GMdZlrkeWg=; b=YV9p8G+OCEq3g4AXn/elLNUvO/SIcEtrKETizWYHI2hgd1jmrmzUyTHC u22sW7VIR1YEshjBhzZ/ugcLtiQ68kx3wnMVTQJgLVA1f6kB43w+JF8Bu 2xAJtUzf8OYuNdxO8GSRxBrKu4/99f8xhedPkbBoopHoh3Yg0qMHMoEWY fI7bYztNgYxjLT9iKCLRNPau7YNLHJsm0/gFZ0t6BthHSBlARbEU4PZj5 BUqclaHiuW8WX0ArhNj2rn4sbPUx3KHED4qQ2pDMO7Uzbi5goYWnopZQA JKbhtXL1zAYINnjzmIXdKYCGjUBwzBecgMsPQ/F0/yc03f/n8SFceWdo1 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10460"; a="293947091" X-IronPort-AV: E=Sophos;i="5.93,291,1654585200"; d="scan'208";a="293947091" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 03:51:24 -0700 X-IronPort-AV: E=Sophos;i="5.93,291,1654585200"; d="scan'208";a="609643468" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 03:51:21 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: add 2 case Date: Mon, 5 Sep 2022 18:51:08 +0000 Message-Id: <20220905185109.3717549-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 add case to test the rule of l2 mask and l3 mask. Signed-off-by: Jiale Song Acked-by: Peng, Yuan Signed-off-by: Jiale Song Acked-by: Lijuan Tu --- test_plans/ice_switch_filter_test_plan.rst | 189 +++++++++++++++++++++ 1 file changed, 189 insertions(+) diff --git a/test_plans/ice_switch_filter_test_plan.rst b/test_plans/ice_switch_filter_test_plan.rst index 6ea6843c..c85e7fc9 100644 --- a/test_plans/ice_switch_filter_test_plan.rst +++ b/test_plans/ice_switch_filter_test_plan.rst @@ -5632,3 +5632,192 @@ subcase 3: pipeline mode 7. create rule, check the rule can not be created:: testpmd> flow create 0 priority 1 ingress pattern any / end actions queue index 4 / end + +Test case: L3 mask +======================= + +subcase 1: ipv4 dst + mask + queue action +----------------------------------------- + +1. validate a rule:: + + testpmd> flow validate 0 ingress pattern eth / ipv4 dst spec 224.0.0.0 dst mask 240.0.0.0 / end actions queue index 12 / end + + get the message:: + + Flow rule validated + + check the flow list:: + + testpmd> flow list 0 + + check the rule not exists in the list. + +2. create a rule:: + + testpmd> flow create 0 ingress pattern eth / ipv4 dst spec 224.0.0.0 dst mask 240.0.0.0 / end actions queue index 12 / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp(Ether()/IP(src="192.168.0.1", dst="239.255.255.255")/UDP()/Raw("x"*80), iface="enp27s0f0", count=1), + + check all the packets received by queue 12. + send mismatched packets:: + + sendp(Ether()/IP(src="192.168.0.1", dst="223.0.0.0")/TCP()/Raw("x"*80), iface="enp27s0f0", count=1) + sendp(Ether()/IP(src="192.168.0.1", dst="240.0.0.0")/UDP()/Raw("x"*80), iface="enp27s0f0", count=1) + sendp(Ether()/IP(src="192.168.0.1", dst="128.0.0.0")/Raw("x"*80)], iface="enp27s0f0", count=1) + + check all the packets can't received by queue 12. + +4. verify rules can be destroyed:: + + testpmd> flow destroy 0 rule 0 + testpmd> flow list 0 + + check the rule not exists in the list. + send matched packets, check all the packets can't received by queue 12. + +subcase 2: ipv6 src + mask + drop action +---------------------------------------- + +1. validate a rule:: + + testpmd> flow validate 0 ingress pattern eth / ipv6 src spec CDCD:910A:2222:5498:8475:1111:3900:2023 src mask ffff:ffff:ffff:ffff:0:0:0:0 / end actions drop / end + + get the message:: + + Flow rule validated + + check the flow list:: + + testpmd> flow list 0 + + check the rule not exists in the list. + +2. create a rule:: + + testpmd> flow create 0 ingress pattern eth / ipv6 src spec CDCD:910A:2222:5498:8475:1111:3900:2023 src mask ffff:ffff:ffff:ffff:0:0:0:0 / end actions drop / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp(Ether(dst="00:00:5e:00:00:01")/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDCD:910A:2222:5498:ffff:ffff:ffff:ffff")/TCP()/("X"*480), iface="enp27s0f0", count=1), + + check all the packets are dropped. + send mismatched packets:: + + sendp(Ether(dst="00:00:5e:00:00:01")/IPv6(src="CDCD:910A:2222:ffff:8475:1111:3900:2023")/("X"*480), iface="enp27s0f0", count=1) + sendp(Ether(dst="00:00:5e:00:00:01")/IPv6(src="CFCD:910A:ffff:5498:8475:1111:3900:2023")/UDP()/("X"*480), iface="enp27s0f0", count=1) + sendp(Ether(dst="00:00:5e:00:00:01")/IPv6(src="CDCD:ffff:2222:5498:8475:1111:3900:1515")/TCP()/("X"*480), iface="enp27s0f0", count=1) + sendp(Ether(dst="00:00:5e:00:00:01")/IPv6(src="ffff:910A:2222:5498:8475:1111:3900:1515")/TCP()/("X"*480), iface="enp27s0f0", count=1) + + check all the packets are not dropped. + +4. verify rules can be destroyed:: + + testpmd> flow destroy 0 rule 0 + testpmd> flow list 0 + + check the rule not exists in the list. + send matched packets, check all the packets are not dropped. + +Test case: L2 mask +======================= + +subcase 1: mac dst + mask + queue action +---------------------------------------- + +1. validate a rule:: + + testpmd> flow validate 0 ingress pattern eth dst spec 00:00:5e:00:00:00 dst mask ff:ff:ff:80:00:00 / end actions queue index 12 / end + + get the message:: + + Flow rule validated + + check the flow list:: + + testpmd> flow list 0 + + check the rule not exists in the list. + +2. create a rule:: + + testpmd> flow create 0 ingress pattern eth dst spec 00:00:5e:00:00:00 dst mask ff:ff:ff:80:00:00 / end actions queue index 12 / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp(Ether(src="00:00:5e:00:00:01", dst="00:00:5e:7f:ff:ff")/IP()/UDP()/Raw("x"*80)), iface="enp27s0f0", count=1) + + check all the packets received by queue 12. + send mismatched packets:: + + sendp(Ether(dst="00:00:5e:80:00:00")/Raw("x"*80), iface="enp27s0f0", count=1) + sendp(Ether(dst="00:00:ff:00:00:00")/IP()/Raw("x"*80), iface="enp27s0f0", count=1) + sendp(Ether(dst="00:ff:5e:00:00:00")/IP()/TCP()/Raw("x"*80), iface="enp27s0f0", count=1) + sendp(Ether(dst="ff:00:5e:00:00:00")/IP()/UDP()/Raw("x"*80), iface="enp27s0f0", count=1) + + check all the packets can't receive by queue 12. + +4. verify rules can be destroyed:: + + testpmd> flow destroy 0 rule 0 + testpmd> flow list 0 + + check the rule not exists in the list. + send matched packets, check all the packets can't receive by queue 12. + +subcase 2: mac src + mask + drop action +--------------------------------------- + +1. validate a rule:: + + testpmd> flow validate 0 ingress pattern eth src spec 00:00:5e:00:00:00 src mask ff:ff:ff:80:00:00 / end actions drop / end + + get the message:: + + Flow rule validated + + check the flow list:: + + testpmd> flow list 0 + + check the rule not exists in the list. + +2. create a rule:: + + testpmd> flow create 0 ingress pattern eth src spec 00:00:5e:00:00:00 src mask ff:ff:ff:80:00:00 / end actions drop / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp(Ether(dst="00:00:5e:00:00:01", src="00:00:5e:7f:ff:ff")/IP()/UDP()/Raw("x"*80), iface="enp27s0f0", count=1) + + check all the packets are dropped. + send mismatched packets:: + + sendp(Ether(src="00:00:5e:80:00:00")/Raw("x"*80), iface="enp27s0f0", count=1) + sendp(Ether(src="00:00:ff:00:00:00")/IP()/Raw("x"*80), iface="enp27s0f0", count=1) + sendp(Ether(src="00:ff:5e:00:00:00")/IP()/TCP()/Raw("x"*80), iface="enp27s0f0", count=1) + sendp(Ether(src="ff:00:5e:00:00:00")/IP()/UDP()/Raw("x"*80), iface="enp27s0f0", count=1) + + check all the packets are not dropped. + +4. verify rules can be destroyed:: + + testpmd> flow destroy 0 rule 0 + testpmd> flow list 0 + + check the rule not exists in the list. + send matched packets, check all the packets are not dropped. \ No newline at end of file