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 D2ED5A00BE; Thu, 10 Feb 2022 18:26:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2E7940140; Thu, 10 Feb 2022 18:26:44 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id B880540041 for ; Thu, 10 Feb 2022 18:26:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644514002; x=1676050002; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=U/gYc9FB4cFELB+MTbAU3uCANOS55a8MJ5lzSyCchHg=; b=lpv/j6rzS0/YLaEMcIXHbzFqsbeCy8g/PjkZDL7wTQ7YTptAzmH85f3b LZpIUSBQlGyonaB3YqDmrPTE6CRS8ryzL9bp/cHpwJmpgZbsjz3stJUva k/BUBYziS87IRnaPdxx3DXF5DwnaV0T35Ieo6fkfTpIuKQgY5isGzGpER gnZtxSjc2W60a12lJLzYyxlN6jyuItkW2qomzEeg8jeEjaaf1ZcahXTGo vqQZIYAKhvZcten3Els3x9hO2bKcKcFpt02FaDe6YakCz4F0AW2bOECaD Z4FE45eZLwKIzjtZTo0WXJK9+uewxlb7mvqepwhI9bah1h0dtSg/AgrwA A==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="274097160" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="274097160" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 09:26:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="482833021" Received: from dpdk-yaqi.sh.intel.com ([10.67.119.205]) by orsmga003.jf.intel.com with ESMTP; 10 Feb 2022 09:26:39 -0800 From: Yaqi Tang To: dts@dpdk.org Cc: Yaqi Tang Subject: [dts][PATCH V3] tests/cvl_switch_filter: add test cases for cvl qinq switch filter support l4 Date: Fri, 11 Feb 2022 01:24:51 +0000 Message-Id: <20220211012451.739750-1-yaqi.tang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 CVL support l4 for QinQ switch filter in PF driver, and port can support as eth / vlan / vlan / IP / tcp|udp. Signed-off-by: Yaqi Tang Tested-by: Yaqi Tang < yaqi.tang@intel.com> --- tests/TestSuite_cvl_switch_filter.py | 393 +++++++++++++++++++++++++++ 1 file changed, 393 insertions(+) diff --git a/tests/TestSuite_cvl_switch_filter.py b/tests/TestSuite_cvl_switch_filter.py index 69a83c47..74e64201 100755 --- a/tests/TestSuite_cvl_switch_filter.py +++ b/tests/TestSuite_cvl_switch_filter.py @@ -45,6 +45,380 @@ from framework.pmd_output import PmdOutput from framework.test_case import TestCase, skip_unsupported_pkg from framework.utils import BLUE, GREEN, RED +#l4 qinq switch filter +#qinq non-pipeline mode +mac_qinq_ipv4_non_pipeline_mode_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP(src="192.168.1.1", dst="192.168.1.2")/("X"*80)'], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:66",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP(src="192.168.1.1", dst="192.168.1.2")/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP(src="192.168.1.1", dst="192.168.1.2")/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x2,type=0x0800)/IP(src="192.168.1.1", dst="192.168.1.2")/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP(src="192.168.1.3", dst="192.168.1.2")/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP(src="192.168.1.1", dst="192.168.1.4")/("X"*80)' + ] +} + +tv_mac_qinq_ipv4_queue_index = { + "name": "tv_mac_qinq_ipv4_queue_index", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions queue index 2 / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv4_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_in_queue, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv4_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_in_queue_mismatched, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":5}} +} + +tv_mac_qinq_ipv4_rss_queues = { + "name": "tv_mac_qinq_ipv4_rss_queues", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions rss queues 2 3 end / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv4_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_queue_region, + "param":{"expect_port":0, "expect_queues":[2, 3]}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv4_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_queue_region_mismatched, + "param":{"expect_port":0, "expect_queues":[2, 3]}}, + "expect_results":{"expect_pkts":5}} +} + +tv_mac_qinq_ipv4_drop = { + "name": "tv_mac_qinq_ipv4_drop", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions drop / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv4_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_drop, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv4_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_drop_mismatched, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":5}} +} + +tvs_mac_qinq_ipv4 = [tv_mac_qinq_ipv4_queue_index, tv_mac_qinq_ipv4_rss_queues, tv_mac_qinq_ipv4_drop] + +mac_qinq_ipv6_non_pipeline_mode_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/("X"*80)'], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:66",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x2,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2023")/("X"*80)' + ] +} + +tv_mac_qinq_ipv6_queue_index = { + "name": "tv_mac_qinq_ipv6_queue_index", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 / end actions queue index 2 / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv6_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_in_queue, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv6_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_in_queue_mismatched, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":4}} +} + +tv_mac_qinq_ipv6_rss_queues = { + "name": "tv_mac_qinq_ipv6_rss_queues", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 / end actions rss queues 2 3 end / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv6_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_queue_region, + "param":{"expect_port":0, "expect_queues":[2, 3]}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv6_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_queue_region_mismatched, + "param":{"expect_port":0, "expect_queues":[2, 3]}}, + "expect_results":{"expect_pkts":4}} +} + +tv_mac_qinq_ipv6_drop = { + "name": "tv_mac_qinq_ipv6_drop", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 / end actions drop / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv6_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_drop, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv6_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_drop_mismatched, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":4}} +} + +tvs_mac_qinq_ipv6 = [tv_mac_qinq_ipv6_queue_index, tv_mac_qinq_ipv6_rss_queues, tv_mac_qinq_ipv6_drop] + +mac_qinq_ipv4_udp_non_pipeline_mode_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP()/UDP(sport=50,dport=23)/("X"*80)'], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:66",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP()/UDP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP()/UDP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x2,type=0x0800)/IP()/UDP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP()/UDP(sport=51,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP()/UDP(sport=50,dport=22)/("X"*80)' + ] +} + +tv_mac_qinq_ipv4_udp_queue_index = { + "name": "tv_mac_qinq_ipv4_udp_queue_index", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv4 / udp src is 50 dst is 23 / end actions queue index 2 / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv4_udp_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_in_queue, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv4_udp_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_in_queue_mismatched, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":5}} +} + +tv_mac_qinq_ipv4_udp_rss_queues = { + "name": "tv_mac_qinq_ipv4_udp_rss_queues", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv4 / udp src is 50 dst is 23 / end actions rss queues 2 3 end / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv4_udp_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_queue_region, + "param":{"expect_port":0, "expect_queues":[2, 3]}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv4_udp_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_queue_region_mismatched, + "param":{"expect_port":0, "expect_queues":[2, 3]}}, + "expect_results":{"expect_pkts":5}} +} + +tv_mac_qinq_ipv4_udp_drop = { + "name": "tv_mac_qinq_ipv4_udp_drop", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv4 / udp src is 50 dst is 23 / end actions drop / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv4_udp_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_drop, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv4_udp_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_drop_mismatched, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":5}} +} + +tvs_mac_qinq_ipv4_udp = [tv_mac_qinq_ipv4_udp_queue_index, tv_mac_qinq_ipv4_udp_rss_queues, tv_mac_qinq_ipv4_udp_drop] + +mac_qinq_ipv4_tcp_non_pipeline_mode_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP()/TCP(sport=50,dport=23)/("X"*80)'], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:66",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP()/TCP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP()/TCP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x2,type=0x0800)/IP()/TCP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP()/TCP(sport=51,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x0800)/IP()/TCP(sport=50,dport=22)/("X"*80)' + ] +} + +tv_mac_qinq_ipv4_tcp_queue_index = { + "name": "tv_mac_qinq_ipv4_tcp_queue_index", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv4 / tcp src is 50 dst is 23 / end actions queue index 2 / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv4_tcp_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_in_queue, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv4_tcp_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_in_queue_mismatched, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":5}} +} + +tv_mac_qinq_ipv4_tcp_rss_queues = { + "name": "tv_mac_qinq_ipv4_tcp_rss_queues", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv4 / tcp src is 50 dst is 23 / end actions rss queues 2 3 end / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv4_tcp_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_queue_region, + "param":{"expect_port":0, "expect_queues":[2, 3]}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv4_tcp_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_queue_region_mismatched, + "param":{"expect_port":0, "expect_queues":[2, 3]}}, + "expect_results":{"expect_pkts":5}} +} + +tv_mac_qinq_ipv4_tcp_drop = { + "name": "tv_mac_qinq_ipv4_tcp_drop", + "rte_flow_pattern": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv4 / tcp src is 50 dst is 23 / end actions drop / end", + "configuration":{ + "is_non_pipeline":True, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv4_tcp_non_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_drop, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv4_tcp_non_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_drop_mismatched, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":5}} +} + +tvs_mac_qinq_ipv4_tcp = [tv_mac_qinq_ipv4_tcp_queue_index, tv_mac_qinq_ipv4_tcp_rss_queues, tv_mac_qinq_ipv4_tcp_drop] + +#qinq pipeline mode +mac_qinq_ipv6_udp_pipeline_mode_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/UDP(sport=50,dport=23)/("X"*80)'], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:66",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/UDP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/UDP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x2,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/UDP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2023")/UDP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/UDP(sport=50,dport=22)/("X"*80)' + ] +} + +tv_mac_qinq_ipv6_udp_queue_index = { + "name": "tv_mac_qinq_ipv6_udp_queue_index", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 / udp src is 50 dst is 23 / end actions queue index 2 / end", + "configuration":{ + "is_non_pipeline":False, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv6_udp_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_in_queue, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv6_udp_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_in_queue_mismatched, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":5}} +} + +tv_mac_qinq_ipv6_udp_rss_queues = { + "name": "tv_mac_qinq_ipv6_udp_rss_queues", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 / udp src is 50 dst is 23 / end actions rss queues 4 5 end / end", + "configuration":{ + "is_non_pipeline":False, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv6_udp_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_queue_region, + "param":{"expect_port":0, "expect_queues":[4, 5]}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv6_udp_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_queue_region_mismatched, + "param":{"expect_port":0, "expect_queues":[4, 5]}}, + "expect_results":{"expect_pkts":5}} +} + +tv_mac_qinq_ipv6_udp_drop = { + "name": "tv_mac_qinq_ipv6_udp_drop", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 / udp src is 50 dst is 23 / end actions drop / end", + "configuration":{ + "is_non_pipeline":False, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv6_udp_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_drop, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv6_udp_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_drop_mismatched, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":5}} +} + +tvs_mac_qinq_ipv6_udp = [tv_mac_qinq_ipv6_udp_queue_index, tv_mac_qinq_ipv6_udp_rss_queues, tv_mac_qinq_ipv6_udp_drop] + +mac_qinq_ipv6_tcp_pipeline_mode_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/TCP(sport=50,dport=23)/("X"*80)'], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:66",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/TCP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/TCP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x2,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/TCP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2023")/TCP(sport=50,dport=23)/("X"*80)', + 'Ether(dst="00:11:22:33:44:55",type=0x8100)/Dot1Q(vlan=2,type=0x8100)/Dot1Q(vlan=0x1,type=0x86DD)/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:2020")/TCP(sport=50,dport=22)/("X"*80)' + ] +} + +tv_mac_qinq_ipv6_tcp_queue_index = { + "name": "tv_mac_qinq_ipv6_tcp_queue_index", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 / tcp src is 50 dst is 23 / end actions queue index 2 / end", + "configuration":{ + "is_non_pipeline":False, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv6_tcp_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_in_queue, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv6_tcp_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_in_queue_mismatched, + "param":{"expect_port":0, "expect_queues":2}}, + "expect_results":{"expect_pkts":5}} +} + +tv_mac_qinq_ipv6_tcp_rss_queues = { + "name": "tv_mac_qinq_ipv6_tcp_rss_queues", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 / tcp src is 50 dst is 23 / end actions rss queues 4 5 end / end", + "configuration":{ + "is_non_pipeline":False, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv6_tcp_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_queue_region, + "param":{"expect_port":0, "expect_queues":[4, 5]}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv6_tcp_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_queue_region_mismatched, + "param":{"expect_port":0, "expect_queues":[4, 5]}}, + "expect_results":{"expect_pkts":5}} +} + +tv_mac_qinq_ipv6_tcp_drop = { + "name": "tv_mac_qinq_ipv6_tcp_drop", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 2 / vlan tci is 1 / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 / tcp src is 50 dst is 23 / end actions drop / end", + "configuration":{ + "is_non_pipeline":False, + "is_need_rss_rule":False}, + "matched":{"scapy_str":mac_qinq_ipv6_tcp_pipeline_mode_scapy_str["matched"], + "check_func":{"func":rfc.check_output_log_drop, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":mac_qinq_ipv6_tcp_pipeline_mode_scapy_str["mismatched"], + "check_func":{"func":rfc.check_output_log_drop_mismatched, + "param":{"expect_port":0, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":5}} +} + +tvs_mac_qinq_ipv6_tcp = [tv_mac_qinq_ipv6_tcp_queue_index, tv_mac_qinq_ipv6_tcp_rss_queues, tv_mac_qinq_ipv6_tcp_drop] + #l4 mask #ipv4/ipv6 + udp/tcp pipeline mode mac_ipv4_udp_l4_mask_scapy_str = { @@ -3355,6 +3729,25 @@ class CVLSwitchFilterTest(TestCase): overall_result = self.save_results(pattern_name, "matched packets after destroying", result_flag, log_msg, overall_result) self.display_results() self.verify(overall_result == True, "Some subcase failed.") + + #l4 qinq switch filter + def test_mac_qinq_ipv4_non_pipeline_mode(self): + self._rte_flow_validate_pattern(tvs_mac_qinq_ipv4) + + def test_mac_qinq_ipv6_non_pipeline_mode(self): + self._rte_flow_validate_pattern(tvs_mac_qinq_ipv6) + + def test_mac_qinq_ipv4_udp_non_pipeline_mode(self): + self._rte_flow_validate_pattern(tvs_mac_qinq_ipv4_udp) + + def test_mac_qinq_ipv4_tcp_non_pipeline_mode(self): + self._rte_flow_validate_pattern(tvs_mac_qinq_ipv4_tcp) + + def test_mac_qinq_ipv6_udp_pipeline_mode(self): + self._rte_flow_validate_pattern(tvs_mac_qinq_ipv6_udp) + + def test_mac_qinq_ipv6_tcp_pipeline_mode(self): + self._rte_flow_validate_pattern(tvs_mac_qinq_ipv6_tcp) #l4 mask def test_mac_non_tunnle_l4_mask_pipeline_mode(self): -- 2.25.1