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 8626842A35; Mon, 1 May 2023 21:07:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7FE8C42C4D; Mon, 1 May 2023 21:07:42 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 1A0EA4021E for ; Mon, 1 May 2023 21:07: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=1682968060; x=1714504060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NVjJQ/ZhxI4SOj5Pic8aTdTwS0XNF+FA0uE7pmRX/lY=; b=bvWR/Efk3Ry83gyl3nx5Hy04FwgkrBZQLg008Pf/RxNGcwuo9W2UazSs B2sz2viJvO6OPe8grN5k0fSNKksX87yL6ifN0Ag0m1pFqXGqw+0puQMHJ lQ3ZyJ0bunoU19bgZntXrby60EvhuCXPecm9K+BTpvwmiY+sVxTEy77tT lRT4b5KzJpc9qZItBIYevATrUxJ394Vh98Qxm+arNbuzlchyJqwtw6geE i3cFvnFHBOqx9cvNnikCKHWDoLAVi0SaPKnt8CLJjH5aN1nP6OFYGhaEq 7PKlu1iyGzRGpi2Dq3KwxeQ6ezhjzonw/nqy1UWWSdxcZ9n8AZJKbkQib Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10697"; a="347026204" X-IronPort-AV: E=Sophos;i="5.99,242,1677571200"; d="scan'208";a="347026204" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 May 2023 12:07:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10697"; a="728641144" X-IronPort-AV: E=Sophos;i="5.99,242,1677571200"; d="scan'208";a="728641144" Received: from ena4.iind.intel.com (HELO localhost.localdomain) ([10.190.200.224]) by orsmga001.jf.intel.com with ESMTP; 01 May 2023 12:07:37 -0700 From: Yogesh Jangra To: dts@dpdk.org Cc: kamalakannan.r@intel.com, harshad.suresh.narayane@intel.com Subject: [PATCH 2/4] dep/pipeline: added dependency for dpdk 23.03 release testcases Date: Mon, 1 May 2023 18:58:40 -0400 Message-Id: <20230501225842.1163820-3-yogesh.jangra@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230501225842.1163820-1-yogesh.jangra@intel.com> References: <20230501225842.1163820-1-yogesh.jangra@intel.com> 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 Added dependencies for the dpdk 23.03 release features viz, ipsec, large operand support, toeplitz hash, header validate and action selector features. Signed-off-by: Yogesh Jangra Signed-off-by: Harshad Narayane Signed-off-by: Kamalakannan R --- dep/pipeline/dma_001/dma_001.spec | 2 +- dep/pipeline/dma_002/dma_002.spec | 4 +- dep/pipeline/dma_003/dma_003.spec | 6 +- dep/pipeline/dma_004/dma_004.spec | 8 +- dep/pipeline/dma_005/dma_005.spec | 10 +- dep/pipeline/dma_006/dma_006.spec | 12 +- dep/pipeline/dma_007/dma_007.spec | 14 +- dep/pipeline/dma_008/dma_008.spec | 16 +-- dep/pipeline/ipsec_001/cmd_files/cmd_1.txt | 2 + dep/pipeline/ipsec_001/cmd_files/ipsec_sa.txt | 2 + dep/pipeline/ipsec_001/ethdev.io | 17 +++ dep/pipeline/ipsec_001/ipsec_001.cli | 25 ++++ dep/pipeline/ipsec_001/ipsec_001.spec | 110 ++++++++++++++ dep/pipeline/ipsec_001/pcap_files/in_1.txt | 11 ++ dep/pipeline/ipsec_001/pcap_files/out_1.txt | 6 + dep/pipeline/ipsec_001/pcap_files/out_2.txt | 11 ++ dep/pipeline/ipsec_001/readme.txt | 20 +++ dep/pipeline/ipsec_002/cmd_files/cmd_1.txt | 2 + dep/pipeline/ipsec_002/cmd_files/ipsec_sa.txt | 2 + dep/pipeline/ipsec_002/ethdev.io | 17 +++ dep/pipeline/ipsec_002/ipsec_002.cli | 25 ++++ dep/pipeline/ipsec_002/ipsec_002.spec | 110 ++++++++++++++ dep/pipeline/ipsec_002/pcap_files/in_1.txt | 12 ++ dep/pipeline/ipsec_002/pcap_files/out_1.txt | 6 + dep/pipeline/ipsec_002/pcap_files/out_2.txt | 12 ++ dep/pipeline/ipsec_002/readme.txt | 20 +++ dep/pipeline/ipsec_003/cmd_files/cmd_1.txt | 2 + dep/pipeline/ipsec_003/cmd_files/ipsec_sa.txt | 2 + dep/pipeline/ipsec_003/ethdev.io | 17 +++ dep/pipeline/ipsec_003/ipsec_003.cli | 31 ++++ dep/pipeline/ipsec_003/ipsec_003.spec | 110 ++++++++++++++ dep/pipeline/ipsec_003/pcap_files/in_1.txt | 11 ++ dep/pipeline/ipsec_003/pcap_files/out_1.txt | 11 ++ dep/pipeline/ipsec_003/pcap_files/out_2.txt | 6 + dep/pipeline/ipsec_003/readme.txt | 20 +++ dep/pipeline/ipsec_004/cmd_files/cmd_1.txt | 2 + dep/pipeline/ipsec_004/cmd_files/ipsec_sa.txt | 2 + dep/pipeline/ipsec_004/ethdev.io | 17 +++ dep/pipeline/ipsec_004/ipsec_004.cli | 31 ++++ dep/pipeline/ipsec_004/ipsec_004.spec | 110 ++++++++++++++ dep/pipeline/ipsec_004/pcap_files/in_1.txt | 12 ++ dep/pipeline/ipsec_004/pcap_files/out_1.txt | 12 ++ dep/pipeline/ipsec_004/pcap_files/out_2.txt | 6 + dep/pipeline/ipsec_004/readme.txt | 20 +++ dep/pipeline/mov_009/ethdev.io | 27 ++++ dep/pipeline/mov_009/mov_009.cli | 19 +++ dep/pipeline/mov_009/mov_009.spec | 41 ++++++ dep/pipeline/mov_009/pcap_files/in_1.txt | 12 ++ dep/pipeline/mov_009/pcap_files/out_1.txt | 12 ++ dep/pipeline/mov_009/readme.md | 18 +++ dep/pipeline/mov_010/cmd_files/cmd_1.txt | 4 + dep/pipeline/mov_010/ethdev.io | 27 ++++ dep/pipeline/mov_010/mov_010.cli | 19 +++ dep/pipeline/mov_010/mov_010.spec | 100 +++++++++++++ dep/pipeline/mov_010/pcap_files/in_1.txt | 35 +++++ dep/pipeline/mov_010/pcap_files/out_1.txt | 35 +++++ dep/pipeline/mov_010/readme.md | 27 ++++ dep/pipeline/mov_011/cmd_files/cmd_1.txt | 4 + dep/pipeline/mov_011/ethdev.io | 27 ++++ dep/pipeline/mov_011/mov_011.cli | 19 +++ dep/pipeline/mov_011/mov_011.spec | 101 +++++++++++++ dep/pipeline/mov_011/pcap_files/in_1.txt | 35 +++++ dep/pipeline/mov_011/pcap_files/out_1.txt | 35 +++++ dep/pipeline/mov_011/readme.md | 27 ++++ dep/pipeline/mov_012/cmd_files/cmd_1.txt | 2 + dep/pipeline/mov_012/ethdev.io | 27 ++++ dep/pipeline/mov_012/mov_012.cli | 19 +++ dep/pipeline/mov_012/mov_012.spec | 82 +++++++++++ dep/pipeline/mov_012/pcap_files/in_1.txt | 21 +++ dep/pipeline/mov_012/pcap_files/out_1.txt | 21 +++ dep/pipeline/mov_012/readme.md | 24 ++++ dep/pipeline/rss_001/ethdev.io | 27 ++++ dep/pipeline/rss_001/pcap_files/in_1.txt | 13 ++ dep/pipeline/rss_001/pcap_files/out_1.txt | 13 ++ dep/pipeline/rss_001/readme.md | 21 +++ dep/pipeline/rss_001/rss_001.cli | 20 +++ dep/pipeline/rss_001/rss_001.spec | 60 ++++++++ dep/pipeline/rss_002/ethdev.io | 27 ++++ dep/pipeline/rss_002/pcap_files/in_1.txt | 13 ++ dep/pipeline/rss_002/pcap_files/out_1.txt | 13 ++ dep/pipeline/rss_002/readme.md | 21 +++ dep/pipeline/rss_002/rss_002.cli | 20 +++ dep/pipeline/rss_002/rss_002.spec | 80 +++++++++++ dep/pipeline/rss_003/cmd_files/cmd.txt | 1 + dep/pipeline/rss_003/ethdev.io | 27 ++++ dep/pipeline/rss_003/pcap_files/in_1.txt | 19 +++ dep/pipeline/rss_003/pcap_files/out_1.txt | 13 ++ dep/pipeline/rss_003/readme.md | 21 +++ dep/pipeline/rss_003/rss_003.cli | 23 +++ dep/pipeline/rss_003/rss_003.spec | 85 +++++++++++ dep/pipeline/selector_002/selector_002.spec | 2 +- dep/pipeline/selector_003/cmd_files/cmd_1.txt | 4 + dep/pipeline/selector_003/cmd_files/cmd_2.txt | 11 ++ dep/pipeline/selector_003/cmd_files/cmd_3.txt | 4 + dep/pipeline/selector_003/ethdev.io | 27 ++++ dep/pipeline/selector_003/pcap_files/in_1.txt | 27 ++++ .../selector_003/pcap_files/out_1.txt | 12 ++ .../selector_003/pcap_files/out_2.txt | 12 ++ .../selector_003/pcap_files/out_3.txt | 12 ++ .../selector_003/pcap_files/out_4.txt | 12 ++ dep/pipeline/selector_003/readme.md | 13 ++ dep/pipeline/selector_003/selector_003.cli | 29 ++++ dep/pipeline/selector_003/selector_003.spec | 136 ++++++++++++++++++ dep/pipeline/table_002/table_002.spec | 5 +- dep/pipeline/table_003/table_003.spec | 8 +- dep/pipeline/table_004/table_004.spec | 2 +- dep/pipeline/vxlan_001/vxlan_001.spec | 4 +- 107 files changed, 2515 insertions(+), 46 deletions(-) create mode 100644 dep/pipeline/ipsec_001/cmd_files/cmd_1.txt create mode 100644 dep/pipeline/ipsec_001/cmd_files/ipsec_sa.txt create mode 100644 dep/pipeline/ipsec_001/ethdev.io create mode 100644 dep/pipeline/ipsec_001/ipsec_001.cli create mode 100644 dep/pipeline/ipsec_001/ipsec_001.spec create mode 100644 dep/pipeline/ipsec_001/pcap_files/in_1.txt create mode 100644 dep/pipeline/ipsec_001/pcap_files/out_1.txt create mode 100644 dep/pipeline/ipsec_001/pcap_files/out_2.txt create mode 100644 dep/pipeline/ipsec_001/readme.txt create mode 100644 dep/pipeline/ipsec_002/cmd_files/cmd_1.txt create mode 100644 dep/pipeline/ipsec_002/cmd_files/ipsec_sa.txt create mode 100644 dep/pipeline/ipsec_002/ethdev.io create mode 100644 dep/pipeline/ipsec_002/ipsec_002.cli create mode 100644 dep/pipeline/ipsec_002/ipsec_002.spec create mode 100644 dep/pipeline/ipsec_002/pcap_files/in_1.txt create mode 100644 dep/pipeline/ipsec_002/pcap_files/out_1.txt create mode 100644 dep/pipeline/ipsec_002/pcap_files/out_2.txt create mode 100644 dep/pipeline/ipsec_002/readme.txt create mode 100644 dep/pipeline/ipsec_003/cmd_files/cmd_1.txt create mode 100644 dep/pipeline/ipsec_003/cmd_files/ipsec_sa.txt create mode 100644 dep/pipeline/ipsec_003/ethdev.io create mode 100644 dep/pipeline/ipsec_003/ipsec_003.cli create mode 100644 dep/pipeline/ipsec_003/ipsec_003.spec create mode 100644 dep/pipeline/ipsec_003/pcap_files/in_1.txt create mode 100644 dep/pipeline/ipsec_003/pcap_files/out_1.txt create mode 100644 dep/pipeline/ipsec_003/pcap_files/out_2.txt create mode 100644 dep/pipeline/ipsec_003/readme.txt create mode 100644 dep/pipeline/ipsec_004/cmd_files/cmd_1.txt create mode 100644 dep/pipeline/ipsec_004/cmd_files/ipsec_sa.txt create mode 100644 dep/pipeline/ipsec_004/ethdev.io create mode 100644 dep/pipeline/ipsec_004/ipsec_004.cli create mode 100644 dep/pipeline/ipsec_004/ipsec_004.spec create mode 100644 dep/pipeline/ipsec_004/pcap_files/in_1.txt create mode 100644 dep/pipeline/ipsec_004/pcap_files/out_1.txt create mode 100644 dep/pipeline/ipsec_004/pcap_files/out_2.txt create mode 100644 dep/pipeline/ipsec_004/readme.txt create mode 100644 dep/pipeline/mov_009/ethdev.io create mode 100755 dep/pipeline/mov_009/mov_009.cli create mode 100755 dep/pipeline/mov_009/mov_009.spec create mode 100644 dep/pipeline/mov_009/pcap_files/in_1.txt create mode 100644 dep/pipeline/mov_009/pcap_files/out_1.txt create mode 100644 dep/pipeline/mov_009/readme.md create mode 100644 dep/pipeline/mov_010/cmd_files/cmd_1.txt create mode 100644 dep/pipeline/mov_010/ethdev.io create mode 100755 dep/pipeline/mov_010/mov_010.cli create mode 100755 dep/pipeline/mov_010/mov_010.spec create mode 100644 dep/pipeline/mov_010/pcap_files/in_1.txt create mode 100644 dep/pipeline/mov_010/pcap_files/out_1.txt create mode 100644 dep/pipeline/mov_010/readme.md create mode 100644 dep/pipeline/mov_011/cmd_files/cmd_1.txt create mode 100644 dep/pipeline/mov_011/ethdev.io create mode 100755 dep/pipeline/mov_011/mov_011.cli create mode 100755 dep/pipeline/mov_011/mov_011.spec create mode 100644 dep/pipeline/mov_011/pcap_files/in_1.txt create mode 100644 dep/pipeline/mov_011/pcap_files/out_1.txt create mode 100644 dep/pipeline/mov_011/readme.md create mode 100644 dep/pipeline/mov_012/cmd_files/cmd_1.txt create mode 100644 dep/pipeline/mov_012/ethdev.io create mode 100755 dep/pipeline/mov_012/mov_012.cli create mode 100755 dep/pipeline/mov_012/mov_012.spec create mode 100644 dep/pipeline/mov_012/pcap_files/in_1.txt create mode 100644 dep/pipeline/mov_012/pcap_files/out_1.txt create mode 100644 dep/pipeline/mov_012/readme.md create mode 100644 dep/pipeline/rss_001/ethdev.io create mode 100644 dep/pipeline/rss_001/pcap_files/in_1.txt create mode 100644 dep/pipeline/rss_001/pcap_files/out_1.txt create mode 100644 dep/pipeline/rss_001/readme.md create mode 100644 dep/pipeline/rss_001/rss_001.cli create mode 100644 dep/pipeline/rss_001/rss_001.spec create mode 100644 dep/pipeline/rss_002/ethdev.io create mode 100644 dep/pipeline/rss_002/pcap_files/in_1.txt create mode 100644 dep/pipeline/rss_002/pcap_files/out_1.txt create mode 100644 dep/pipeline/rss_002/readme.md create mode 100644 dep/pipeline/rss_002/rss_002.cli create mode 100644 dep/pipeline/rss_002/rss_002.spec create mode 100644 dep/pipeline/rss_003/cmd_files/cmd.txt create mode 100644 dep/pipeline/rss_003/ethdev.io create mode 100644 dep/pipeline/rss_003/pcap_files/in_1.txt create mode 100644 dep/pipeline/rss_003/pcap_files/out_1.txt create mode 100644 dep/pipeline/rss_003/readme.md create mode 100644 dep/pipeline/rss_003/rss_003.cli create mode 100644 dep/pipeline/rss_003/rss_003.spec create mode 100644 dep/pipeline/selector_003/cmd_files/cmd_1.txt create mode 100644 dep/pipeline/selector_003/cmd_files/cmd_2.txt create mode 100644 dep/pipeline/selector_003/cmd_files/cmd_3.txt create mode 100644 dep/pipeline/selector_003/ethdev.io create mode 100644 dep/pipeline/selector_003/pcap_files/in_1.txt create mode 100644 dep/pipeline/selector_003/pcap_files/out_1.txt create mode 100644 dep/pipeline/selector_003/pcap_files/out_2.txt create mode 100644 dep/pipeline/selector_003/pcap_files/out_3.txt create mode 100644 dep/pipeline/selector_003/pcap_files/out_4.txt create mode 100644 dep/pipeline/selector_003/readme.md create mode 100644 dep/pipeline/selector_003/selector_003.cli create mode 100644 dep/pipeline/selector_003/selector_003.spec diff --git a/dep/pipeline/dma_001/dma_001.spec b/dep/pipeline/dma_001/dma_001.spec index aa8d9dce..7688ebc8 100755 --- a/dep/pipeline/dma_001/dma_001.spec +++ b/dep/pipeline/dma_001/dma_001.spec @@ -31,10 +31,10 @@ struct dma_001_args_t { } action dma_001_action args instanceof dma_001_args_t { + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr mov h.ethernet.ethertype t.ethernet_ethertype - validate h.ethernet return } diff --git a/dep/pipeline/dma_002/dma_002.spec b/dep/pipeline/dma_002/dma_002.spec index 4e6bf4a5..3961d193 100644 --- a/dep/pipeline/dma_002/dma_002.spec +++ b/dep/pipeline/dma_002/dma_002.spec @@ -55,11 +55,12 @@ struct dma_002_args_t { } action dma_002_action args instanceof dma_002_args_t { + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr mov h.ethernet.ethertype t.ethernet_ethertype - validate h.ethernet + validate h.ipv4 mov h.ipv4.ver_ihl t.ipv4_ver_ihl mov h.ipv4.diffserv t.ipv4_diffserv mov h.ipv4.total_len t.ipv4_total_len @@ -70,7 +71,6 @@ action dma_002_action args instanceof dma_002_args_t { mov h.ipv4.hdr_checksum t.ipv4_hdr_checksum mov h.ipv4.src_addr t.ipv4_src_addr mov h.ipv4.dst_addr t.ipv4_dst_addr - validate h.ipv4 return } diff --git a/dep/pipeline/dma_003/dma_003.spec b/dep/pipeline/dma_003/dma_003.spec index 453c42ba..f77e07f9 100644 --- a/dep/pipeline/dma_003/dma_003.spec +++ b/dep/pipeline/dma_003/dma_003.spec @@ -75,11 +75,12 @@ struct dma_003_args_t { } action dma_003_action args instanceof dma_003_args_t { + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr mov h.ethernet.ethertype t.ethernet_ethertype - validate h.ethernet + validate h.ipv4 mov h.ipv4.ver_ihl t.ipv4_ver_ihl mov h.ipv4.diffserv t.ipv4_diffserv mov h.ipv4.total_len t.ipv4_total_len @@ -90,8 +91,8 @@ action dma_003_action args instanceof dma_003_args_t { mov h.ipv4.hdr_checksum t.ipv4_hdr_checksum mov h.ipv4.src_addr t.ipv4_src_addr mov h.ipv4.dst_addr t.ipv4_dst_addr - validate h.ipv4 + validate h.tcp mov h.tcp.src_port t.tcp_src_port mov h.tcp.dst_port t.tcp_dst_port mov h.tcp.seq_num t.tcp_seq_num @@ -100,7 +101,6 @@ action dma_003_action args instanceof dma_003_args_t { mov h.tcp.window_size t.tcp_window_size mov h.tcp.checksum t.tcp_checksum mov h.tcp.urg_ptr t.tcp_urg_ptr - validate h.tcp return } diff --git a/dep/pipeline/dma_004/dma_004.spec b/dep/pipeline/dma_004/dma_004.spec index 3ced6839..ebd1b752 100644 --- a/dep/pipeline/dma_004/dma_004.spec +++ b/dep/pipeline/dma_004/dma_004.spec @@ -83,15 +83,16 @@ struct dma_004_args_t { } action dma_004_action args instanceof dma_004_args_t { + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr - validate h.ethernet + validate h.vlan mov h.vlan.tpid t.vlan_tpid mov h.vlan.pcp_dei_vid t.vlan_pcp_dei_vid mov h.vlan.ethertype t.vlan_ethertype - validate h.vlan + validate h.ipv4 mov h.ipv4.ver_ihl t.ipv4_ver_ihl mov h.ipv4.diffserv t.ipv4_diffserv mov h.ipv4.total_len t.ipv4_total_len @@ -102,8 +103,8 @@ action dma_004_action args instanceof dma_004_args_t { mov h.ipv4.hdr_checksum t.ipv4_hdr_checksum mov h.ipv4.src_addr t.ipv4_src_addr mov h.ipv4.dst_addr t.ipv4_dst_addr - validate h.ipv4 + validate h.tcp mov h.tcp.src_port t.tcp_src_port mov h.tcp.dst_port t.tcp_dst_port mov h.tcp.seq_num t.tcp_seq_num @@ -112,7 +113,6 @@ action dma_004_action args instanceof dma_004_args_t { mov h.tcp.window_size t.tcp_window_size mov h.tcp.checksum t.tcp_checksum mov h.tcp.urg_ptr t.tcp_urg_ptr - validate h.tcp return } diff --git a/dep/pipeline/dma_005/dma_005.spec b/dep/pipeline/dma_005/dma_005.spec index 034d901a..2ef8374a 100644 --- a/dep/pipeline/dma_005/dma_005.spec +++ b/dep/pipeline/dma_005/dma_005.spec @@ -87,20 +87,21 @@ struct dma_005_args_t { } action dma_005_action args instanceof dma_005_args_t { + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr - validate h.ethernet + validate h.vlan_1 mov h.vlan_1.tpid t.vlan_1_tpid mov h.vlan_1.pcp_dei_vid t.vlan_1_pcp_dei_vid mov h.vlan_1.ethertype t.vlan_1_ethertype - validate h.vlan_1 + validate h.vlan_2 mov h.vlan_2.tpid t.vlan_2_tpid mov h.vlan_2.pcp_dei_vid t.vlan_2_pcp_dei_vid mov h.vlan_2.ethertype t.vlan_2_ethertype - validate h.vlan_2 + validate h.ipv4 mov h.ipv4.ver_ihl t.ipv4_ver_ihl mov h.ipv4.diffserv t.ipv4_diffserv mov h.ipv4.total_len t.ipv4_total_len @@ -111,8 +112,8 @@ action dma_005_action args instanceof dma_005_args_t { mov h.ipv4.hdr_checksum t.ipv4_hdr_checksum mov h.ipv4.src_addr t.ipv4_src_addr mov h.ipv4.dst_addr t.ipv4_dst_addr - validate h.ipv4 + validate h.tcp mov h.tcp.src_port t.tcp_src_port mov h.tcp.dst_port t.tcp_dst_port mov h.tcp.seq_num t.tcp_seq_num @@ -121,7 +122,6 @@ action dma_005_action args instanceof dma_005_args_t { mov h.tcp.window_size t.tcp_window_size mov h.tcp.checksum t.tcp_checksum mov h.tcp.urg_ptr t.tcp_urg_ptr - validate h.tcp return } diff --git a/dep/pipeline/dma_006/dma_006.spec b/dep/pipeline/dma_006/dma_006.spec index 6a344cfa..6593db25 100644 --- a/dep/pipeline/dma_006/dma_006.spec +++ b/dep/pipeline/dma_006/dma_006.spec @@ -94,11 +94,12 @@ struct dma_006_args_t { } action dma_006_action args instanceof dma_006_args_t { + validate h.outer_ethernet mov h.outer_ethernet.dst_addr t.out_ethernet_dst_addr mov h.outer_ethernet.src_addr t.out_ethernet_src_addr mov h.outer_ethernet.ethertype t.out_ethernet_ethertype - validate h.outer_ethernet + validate h.outer_ipv4 mov h.outer_ipv4.ver_ihl t.out_ipv4_ver_ihl mov h.outer_ipv4.diffserv t.out_ipv4_diffserv mov h.outer_ipv4.total_len t.out_ipv4_total_len @@ -109,25 +110,25 @@ action dma_006_action args instanceof dma_006_args_t { mov h.outer_ipv4.hdr_checksum t.out_ipv4_hdr_checksum mov h.outer_ipv4.src_addr t.out_ipv4_src_addr mov h.outer_ipv4.dst_addr t.out_ipv4_dst_addr - validate h.outer_ipv4 + validate h.outer_udp mov h.outer_udp.src_port t.out_udp_src_port mov h.outer_udp.dst_port t.out_udp_dst_port mov h.outer_udp.length t.out_udp_length mov h.outer_udp.checksum t.out_udp_checksum - validate h.outer_udp + validate h.outer_vxlan mov h.outer_vxlan.flags t.out_vxlan_flags mov h.outer_vxlan.reserved t.out_vxlan_reserved mov h.outer_vxlan.vni t.out_vxlan_vni mov h.outer_vxlan.reserved2 t.out_vxlan_reserved2 - validate h.outer_vxlan + validate h.ethernet mov h.ethernet.dst_addr t.in_ethernet_dst_addr mov h.ethernet.src_addr t.in_ethernet_src_addr mov h.ethernet.ethertype t.in_ethernet_ethertype - validate h.ethernet + validate h.ipv4 mov h.ipv4.ver_ihl t.in_ipv4_ver_ihl mov h.ipv4.diffserv t.in_ipv4_diffserv mov h.ipv4.total_len t.in_ipv4_total_len @@ -138,7 +139,6 @@ action dma_006_action args instanceof dma_006_args_t { mov h.ipv4.hdr_checksum t.in_ipv4_hdr_checksum mov h.ipv4.src_addr t.in_ipv4_src_addr mov h.ipv4.dst_addr t.in_ipv4_dst_addr - validate h.ipv4 return } diff --git a/dep/pipeline/dma_007/dma_007.spec b/dep/pipeline/dma_007/dma_007.spec index 55875b63..0248ca5d 100644 --- a/dep/pipeline/dma_007/dma_007.spec +++ b/dep/pipeline/dma_007/dma_007.spec @@ -114,11 +114,12 @@ struct dma_007_args_t { } action dma_007_action args instanceof dma_007_args_t { + validate h.outer_ethernet mov h.outer_ethernet.dst_addr t.out_ethernet_dst_addr mov h.outer_ethernet.src_addr t.out_ethernet_src_addr mov h.outer_ethernet.ethertype t.out_ethernet_ethertype - validate h.outer_ethernet + validate h.outer_ipv4 mov h.outer_ipv4.ver_ihl t.out_ipv4_ver_ihl mov h.outer_ipv4.diffserv t.out_ipv4_diffserv mov h.outer_ipv4.total_len t.out_ipv4_total_len @@ -129,25 +130,25 @@ action dma_007_action args instanceof dma_007_args_t { mov h.outer_ipv4.hdr_checksum t.out_ipv4_hdr_checksum mov h.outer_ipv4.src_addr t.out_ipv4_src_addr mov h.outer_ipv4.dst_addr t.out_ipv4_dst_addr - validate h.outer_ipv4 + validate h.outer_udp mov h.outer_udp.src_port t.out_udp_src_port mov h.outer_udp.dst_port t.out_udp_dst_port mov h.outer_udp.length t.out_udp_length mov h.outer_udp.checksum t.out_udp_checksum - validate h.outer_udp + validate h.outer_vxlan mov h.outer_vxlan.flags t.out_vxlan_flags mov h.outer_vxlan.reserved t.out_vxlan_reserved mov h.outer_vxlan.vni t.out_vxlan_vni mov h.outer_vxlan.reserved2 t.out_vxlan_reserved2 - validate h.outer_vxlan + validate h.ethernet mov h.ethernet.dst_addr t.in_ethernet_dst_addr mov h.ethernet.src_addr t.in_ethernet_src_addr mov h.ethernet.ethertype t.in_ethernet_ethertype - validate h.ethernet + validate h.ipv4 mov h.ipv4.ver_ihl t.in_ipv4_ver_ihl mov h.ipv4.diffserv t.in_ipv4_diffserv mov h.ipv4.total_len t.in_ipv4_total_len @@ -158,8 +159,8 @@ action dma_007_action args instanceof dma_007_args_t { mov h.ipv4.hdr_checksum t.in_ipv4_hdr_checksum mov h.ipv4.src_addr t.in_ipv4_src_addr mov h.ipv4.dst_addr t.in_ipv4_dst_addr - validate h.ipv4 + validate h.tcp mov h.tcp.src_port t.tcp_src_port mov h.tcp.dst_port t.tcp_dst_port mov h.tcp.seq_num t.tcp_seq_num @@ -168,7 +169,6 @@ action dma_007_action args instanceof dma_007_args_t { mov h.tcp.window_size t.tcp_window_size mov h.tcp.checksum t.tcp_checksum mov h.tcp.urg_ptr t.tcp_urg_ptr - validate h.tcp return } diff --git a/dep/pipeline/dma_008/dma_008.spec b/dep/pipeline/dma_008/dma_008.spec index d05f3009..cf8046c7 100644 --- a/dep/pipeline/dma_008/dma_008.spec +++ b/dep/pipeline/dma_008/dma_008.spec @@ -128,11 +128,12 @@ struct dma_008_args_t { } action dma_008_action args instanceof dma_008_args_t { + validate h.outer_ethernet mov h.outer_ethernet.dst_addr t.out_ethernet_dst_addr mov h.outer_ethernet.src_addr t.out_ethernet_src_addr mov h.outer_ethernet.ethertype t.out_ethernet_ethertype - validate h.outer_ethernet + validate h.outer_ipv4 mov h.outer_ipv4.ver_ihl t.out_ipv4_ver_ihl mov h.outer_ipv4.diffserv t.out_ipv4_diffserv mov h.outer_ipv4.total_len t.out_ipv4_total_len @@ -143,29 +144,29 @@ action dma_008_action args instanceof dma_008_args_t { mov h.outer_ipv4.hdr_checksum t.out_ipv4_hdr_checksum mov h.outer_ipv4.src_addr t.out_ipv4_src_addr mov h.outer_ipv4.dst_addr t.out_ipv4_dst_addr - validate h.outer_ipv4 + validate h.outer_udp mov h.outer_udp.src_port t.out_udp_src_port mov h.outer_udp.dst_port t.out_udp_dst_port mov h.outer_udp.length t.out_udp_length mov h.outer_udp.checksum t.out_udp_checksum - validate h.outer_udp + validate h.outer_vxlan mov h.outer_vxlan.flags t.out_vxlan_flags mov h.outer_vxlan.reserved t.out_vxlan_reserved mov h.outer_vxlan.vni t.out_vxlan_vni mov h.outer_vxlan.reserved2 t.out_vxlan_reserved2 - validate h.outer_vxlan + validate h.ethernet mov h.ethernet.dst_addr t.in_ethernet_dst_addr mov h.ethernet.src_addr t.in_ethernet_src_addr - validate h.ethernet + validate h.vlan mov h.vlan.tpid t.vlan_tpid mov h.vlan.pcp_dei_vid t.vlan_pcp_dei_vid mov h.vlan.ethertype t.vlan_ethertype - validate h.vlan + validate h.ipv4 mov h.ipv4.ver_ihl t.in_ipv4_ver_ihl mov h.ipv4.diffserv t.in_ipv4_diffserv mov h.ipv4.total_len t.in_ipv4_total_len @@ -176,8 +177,8 @@ action dma_008_action args instanceof dma_008_args_t { mov h.ipv4.hdr_checksum t.in_ipv4_hdr_checksum mov h.ipv4.src_addr t.in_ipv4_src_addr mov h.ipv4.dst_addr t.in_ipv4_dst_addr - validate h.ipv4 + validate h.tcp mov h.tcp.src_port t.tcp_src_port mov h.tcp.dst_port t.tcp_dst_port mov h.tcp.seq_num t.tcp_seq_num @@ -186,7 +187,6 @@ action dma_008_action args instanceof dma_008_args_t { mov h.tcp.window_size t.tcp_window_size mov h.tcp.checksum t.tcp_checksum mov h.tcp.urg_ptr t.tcp_urg_ptr - validate h.tcp return } diff --git a/dep/pipeline/ipsec_001/cmd_files/cmd_1.txt b/dep/pipeline/ipsec_001/cmd_files/cmd_1.txt new file mode 100644 index 00000000..31b2be0c --- /dev/null +++ b/dep/pipeline/ipsec_001/cmd_files/cmd_1.txt @@ -0,0 +1,2 @@ +match 0x64000001 0x64000001 0x11 action encrypt sa_id 0 +match 0x0a0a0a01 0x0a0a0a01 0x32 action encrypt sa_id 1 diff --git a/dep/pipeline/ipsec_001/cmd_files/ipsec_sa.txt b/dep/pipeline/ipsec_001/cmd_files/ipsec_sa.txt new file mode 100644 index 00000000..9890fde4 --- /dev/null +++ b/dep/pipeline/ipsec_001/cmd_files/ipsec_sa.txt @@ -0,0 +1,2 @@ +encrypt aead aes-gcm-128 key 0x000102030405060708090a0b0c0d0e0f10111213 esp spi 100 tunnel ipv4 srcaddr 0x0a0a0a01 dstaddr 0x0a0a0a01 +decrypt aead aes-gcm-128 key 0x000102030405060708090a0b0c0d0e0f10111213 esp spi 100 tunnel ipv4 srcaddr 0xa0a0a0a01 dstaddr 0x0a0a0a01 diff --git a/dep/pipeline/ipsec_001/ethdev.io b/dep/pipeline/ipsec_001/ethdev.io new file mode 100644 index 00000000..e22217cc --- /dev/null +++ b/dep/pipeline/ipsec_001/ethdev.io @@ -0,0 +1,17 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ring RING1 bsz 1 + +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ring RING0 bsz 1 diff --git a/dep/pipeline/ipsec_001/ipsec_001.cli b/dep/pipeline/ipsec_001/ipsec_001.cli new file mode 100644 index 00000000..14680f09 --- /dev/null +++ b/dep/pipeline/ipsec_001/ipsec_001.cli @@ -0,0 +1,25 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/ipsec_001/ipsec_001.spec /tmp/pipeline/ipsec_001/ipsec_001.c +pipeline libbuild /tmp/pipeline/ipsec_001/ipsec_001.c /tmp/pipeline/ipsec_001/ipsec_001.so +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + +; Crypto device creation +cryptodev crypto_aesni_mb0 queues 1 qsize 128 +ring RING0 size 1024 numa 0 +ring RING1 size 1024 numa 0 + +; Pipeline build using shared object file +pipeline PIPELINE0 build lib /tmp/pipeline/ipsec_001/ipsec_001.so io /tmp/pipeline/ipsec_001/ethdev.io numa 0 + +; IPSEC block creation +ipsec IPSEC0 create in RING0 out RING1 cryptodev crypto_aesni_mb0 cryptoq 0 bsz 1 1 1 1 samax 512 numa 0 + +pipeline PIPELINE0 enable thread 1 +block type ipsec instance IPSEC0 enable thread 1 diff --git a/dep/pipeline/ipsec_001/ipsec_001.spec b/dep/pipeline/ipsec_001/ipsec_001.spec new file mode 100644 index 00000000..5c649480 --- /dev/null +++ b/dep/pipeline/ipsec_001/ipsec_001.spec @@ -0,0 +1,110 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2020 Intel Corporation + +; +// +// Headers +// +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<8> ver_ihl + bit<8> diffserv + bit<16> total_len + bit<16> identification + bit<16> flags_offset + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +struct ipsec_internal_h { + bit<32> sa_id +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h +header ipsec_internal instanceof ipsec_internal_h + +// +// Meta-data +// +struct metadata_t { + bit<32> port_in + bit<32> port_out +} + +metadata instanceof metadata_t + +// +// Actions +// +struct encrypt_args_t { + bit<32> sa_id +} + +action encrypt args instanceof encrypt_args_t { + //Set the IPsec internal header. + validate h.ipsec_internal + mov h.ipsec_internal.sa_id t.sa_id + mov m.port_out 1 + invalidate h.ethernet + return +} + +action drop args none { + drop +} + +// +// Tables. +// +table policy_table { + key { + h.ipv4.src_addr exact + h.ipv4.dst_addr exact + h.ipv4.protocol exact + } + + actions { + encrypt + drop + } + + default_action drop args none + size 65536 +} + +// +// Pipeline. +// +apply { + rx m.port_in + jmpeq FROM_IPSEC m.port_in 1 + extract h.ethernet + extract h.ipv4 + table policy_table + jmp SEND_PACKET + +FROM_IPSEC : extract h.ipv4 + jmpneq SEND_IPSEC_TO_NET h.ipv4.protocol 0x32 + table policy_table + jmp SEND_PACKET + +SEND_IPSEC_TO_NET : validate h.ethernet + mov h.ethernet.dst_addr 0x000102030405 + mov h.ethernet.src_addr 0x000a0b0c0d0e + mov h.ethernet.ethertype 0x0800 + mov m.port_out 0 + +SEND_PACKET : emit h.ipsec_internal + emit h.ethernet + emit h.ipv4 + tx m.port_out +} diff --git a/dep/pipeline/ipsec_001/pcap_files/in_1.txt b/dep/pipeline/ipsec_001/pcap_files/in_1.txt new file mode 100644 index 00000000..c671cd9c --- /dev/null +++ b/dep/pipeline/ipsec_001/pcap_files/in_1.txt @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 52 54 00 12 44 57 52 54 00 12 44 56 08 00 45 00 +000010 00 22 00 01 00 00 40 11 b2 c6 64 00 00 01 64 00 +000020 00 01 00 64 00 c8 00 0e 2d 99 58 58 58 58 58 58 \ No newline at end of file diff --git a/dep/pipeline/ipsec_001/pcap_files/out_1.txt b/dep/pipeline/ipsec_001/pcap_files/out_1.txt new file mode 100644 index 00000000..af0fc303 --- /dev/null +++ b/dep/pipeline/ipsec_001/pcap_files/out_1.txt @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx diff --git a/dep/pipeline/ipsec_001/pcap_files/out_2.txt b/dep/pipeline/ipsec_001/pcap_files/out_2.txt new file mode 100644 index 00000000..3f3fe6e8 --- /dev/null +++ b/dep/pipeline/ipsec_001/pcap_files/out_2.txt @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 00 01 02 03 04 05 00 0a 0b 0c 0d 0e 08 00 45 00 +000010 00 22 00 01 00 00 40 11 b2 c6 64 00 00 01 64 00 +000020 00 01 00 64 00 c8 00 0e 2d 99 58 58 58 58 58 58 diff --git a/dep/pipeline/ipsec_001/readme.txt b/dep/pipeline/ipsec_001/readme.txt new file mode 100644 index 00000000..8e2001fc --- /dev/null +++ b/dep/pipeline/ipsec_001/readme.txt @@ -0,0 +1,20 @@ +Test Case: test_ipsec_001 +----------------------------- + +Scenario being tested: + IPSEC SA rule addition for the tunnel mode. + +Description: + IPSEC block will be created in application, without any table + rules and SA rules. The first packet sent, should not match + any rule and should be dropped. + The testcase then configure table rules as well as add SA rules + using CLI commands. The same packet is sent, it should match the + table rule, do encryption of the packet with the configured SA + rules, do decryption of the encrypted packet based on the SA + rule. The application will modify MAC addresses and sent out + the modified packet on the same port. + +Verification: + The packet verification for the testcase should happen + according to the description. diff --git a/dep/pipeline/ipsec_002/cmd_files/cmd_1.txt b/dep/pipeline/ipsec_002/cmd_files/cmd_1.txt new file mode 100644 index 00000000..71a1472a --- /dev/null +++ b/dep/pipeline/ipsec_002/cmd_files/cmd_1.txt @@ -0,0 +1,2 @@ +match 0x64000001 0x64000001 0x6 action encrypt sa_id 0 +match 0x64000001 0x64000001 0x32 action encrypt sa_id 1 diff --git a/dep/pipeline/ipsec_002/cmd_files/ipsec_sa.txt b/dep/pipeline/ipsec_002/cmd_files/ipsec_sa.txt new file mode 100644 index 00000000..14e4411c --- /dev/null +++ b/dep/pipeline/ipsec_002/cmd_files/ipsec_sa.txt @@ -0,0 +1,2 @@ +encrypt cipher aes-cbc-128 key 0x000102030405060708090a0b0c0d0e0f auth null esp spi 100 transport +decrypt cipher aes-cbc-128 key 0x000102030405060708090a0b0c0d0e0f auth null esp spi 100 transport diff --git a/dep/pipeline/ipsec_002/ethdev.io b/dep/pipeline/ipsec_002/ethdev.io new file mode 100644 index 00000000..e22217cc --- /dev/null +++ b/dep/pipeline/ipsec_002/ethdev.io @@ -0,0 +1,17 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ring RING1 bsz 1 + +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ring RING0 bsz 1 diff --git a/dep/pipeline/ipsec_002/ipsec_002.cli b/dep/pipeline/ipsec_002/ipsec_002.cli new file mode 100644 index 00000000..056e3fd0 --- /dev/null +++ b/dep/pipeline/ipsec_002/ipsec_002.cli @@ -0,0 +1,25 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/ipsec_002/ipsec_002.spec /tmp/pipeline/ipsec_002/ipsec_002.c +pipeline libbuild /tmp/pipeline/ipsec_002/ipsec_002.c /tmp/pipeline/ipsec_002/ipsec_002.so +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + +; Crypto device creation +cryptodev crypto_aesni_mb0 queues 1 qsize 128 +ring RING0 size 1024 numa 0 +ring RING1 size 1024 numa 0 + +; Pipeline build using shared object file +pipeline PIPELINE0 build lib /tmp/pipeline/ipsec_002/ipsec_002.so io /tmp/pipeline/ipsec_002/ethdev.io numa 0 + +; IPSEC block creation +ipsec IPSEC0 create in RING0 out RING1 cryptodev crypto_aesni_mb0 cryptoq 0 bsz 1 1 1 1 samax 512 numa 0 + +pipeline PIPELINE0 enable thread 1 +block type ipsec instance IPSEC0 enable thread 1 diff --git a/dep/pipeline/ipsec_002/ipsec_002.spec b/dep/pipeline/ipsec_002/ipsec_002.spec new file mode 100644 index 00000000..5c649480 --- /dev/null +++ b/dep/pipeline/ipsec_002/ipsec_002.spec @@ -0,0 +1,110 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2020 Intel Corporation + +; +// +// Headers +// +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<8> ver_ihl + bit<8> diffserv + bit<16> total_len + bit<16> identification + bit<16> flags_offset + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +struct ipsec_internal_h { + bit<32> sa_id +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h +header ipsec_internal instanceof ipsec_internal_h + +// +// Meta-data +// +struct metadata_t { + bit<32> port_in + bit<32> port_out +} + +metadata instanceof metadata_t + +// +// Actions +// +struct encrypt_args_t { + bit<32> sa_id +} + +action encrypt args instanceof encrypt_args_t { + //Set the IPsec internal header. + validate h.ipsec_internal + mov h.ipsec_internal.sa_id t.sa_id + mov m.port_out 1 + invalidate h.ethernet + return +} + +action drop args none { + drop +} + +// +// Tables. +// +table policy_table { + key { + h.ipv4.src_addr exact + h.ipv4.dst_addr exact + h.ipv4.protocol exact + } + + actions { + encrypt + drop + } + + default_action drop args none + size 65536 +} + +// +// Pipeline. +// +apply { + rx m.port_in + jmpeq FROM_IPSEC m.port_in 1 + extract h.ethernet + extract h.ipv4 + table policy_table + jmp SEND_PACKET + +FROM_IPSEC : extract h.ipv4 + jmpneq SEND_IPSEC_TO_NET h.ipv4.protocol 0x32 + table policy_table + jmp SEND_PACKET + +SEND_IPSEC_TO_NET : validate h.ethernet + mov h.ethernet.dst_addr 0x000102030405 + mov h.ethernet.src_addr 0x000a0b0c0d0e + mov h.ethernet.ethertype 0x0800 + mov m.port_out 0 + +SEND_PACKET : emit h.ipsec_internal + emit h.ethernet + emit h.ipv4 + tx m.port_out +} diff --git a/dep/pipeline/ipsec_002/pcap_files/in_1.txt b/dep/pipeline/ipsec_002/pcap_files/in_1.txt new file mode 100644 index 00000000..d6ca8116 --- /dev/null +++ b/dep/pipeline/ipsec_002/pcap_files/in_1.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 52 54 00 12 44 57 52 54 00 12 44 56 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 b2 c5 64 00 00 01 64 00 +000020 00 01 00 64 00 c8 00 00 00 0f 00 00 00 0a 50 02 +000030 20 00 bd 8a 00 00 58 58 58 58 58 58 diff --git a/dep/pipeline/ipsec_002/pcap_files/out_1.txt b/dep/pipeline/ipsec_002/pcap_files/out_1.txt new file mode 100644 index 00000000..af0fc303 --- /dev/null +++ b/dep/pipeline/ipsec_002/pcap_files/out_1.txt @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx diff --git a/dep/pipeline/ipsec_002/pcap_files/out_2.txt b/dep/pipeline/ipsec_002/pcap_files/out_2.txt new file mode 100644 index 00000000..0c495a74 --- /dev/null +++ b/dep/pipeline/ipsec_002/pcap_files/out_2.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 00 01 02 03 04 05 00 0a 0b 0c 0d 0e 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 b2 c5 64 00 00 01 64 00 +000020 00 01 00 64 00 c8 00 00 00 0f 00 00 00 0a 50 02 +000030 20 00 bd 8a 00 00 58 58 58 58 58 58 diff --git a/dep/pipeline/ipsec_002/readme.txt b/dep/pipeline/ipsec_002/readme.txt new file mode 100644 index 00000000..3be6ecda --- /dev/null +++ b/dep/pipeline/ipsec_002/readme.txt @@ -0,0 +1,20 @@ +Test Case: test_ipsec_002 +----------------------------- + +Scenario being tested: + IPSEC SA rule addition for the transport mode. + +Description: + IPSEC block will be created in application, without any table + rules and SA rules. The first packet sent, should not match + any rule and should be dropped. + The testcase then configure table rules as well as add SA rules + using CLI commands. The same packet is sent, it should match the + table rule, do encryption of the packet with the configured SA + rules, do decryption of the encrypted packet based on the SA + rule. The application will modify MAC addresses and sent out + the modified packet on the same port. + +Verification: + The packet verification for the testcase should happen + according to the description. diff --git a/dep/pipeline/ipsec_003/cmd_files/cmd_1.txt b/dep/pipeline/ipsec_003/cmd_files/cmd_1.txt new file mode 100644 index 00000000..935fc91b --- /dev/null +++ b/dep/pipeline/ipsec_003/cmd_files/cmd_1.txt @@ -0,0 +1,2 @@ +match 0x64000001 0x64000001 0x11 action encrypt sa_id 0 +match 0x0a0a0a01 0x0a0a0a01 0x32 action encrypt sa_id 1 \ No newline at end of file diff --git a/dep/pipeline/ipsec_003/cmd_files/ipsec_sa.txt b/dep/pipeline/ipsec_003/cmd_files/ipsec_sa.txt new file mode 100644 index 00000000..d46345ff --- /dev/null +++ b/dep/pipeline/ipsec_003/cmd_files/ipsec_sa.txt @@ -0,0 +1,2 @@ +encrypt cipher null auth sha1-hmac key 0x000102030405060708090a0b0c0d0e0f10111213 esp spi 100 tunnel ipv4 srcaddr 0x0a0a0a01 dstaddr 0x0a0a0a01 +decrypt cipher null auth sha1-hmac key 0x000102030405060708090a0b0c0d0e0f10111213 esp spi 100 tunnel ipv4 srcaddr 0x0a0a0a01 dstaddr 0x0a0a0a01 \ No newline at end of file diff --git a/dep/pipeline/ipsec_003/ethdev.io b/dep/pipeline/ipsec_003/ethdev.io new file mode 100644 index 00000000..e22217cc --- /dev/null +++ b/dep/pipeline/ipsec_003/ethdev.io @@ -0,0 +1,17 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ring RING1 bsz 1 + +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ring RING0 bsz 1 diff --git a/dep/pipeline/ipsec_003/ipsec_003.cli b/dep/pipeline/ipsec_003/ipsec_003.cli new file mode 100644 index 00000000..3351dbc3 --- /dev/null +++ b/dep/pipeline/ipsec_003/ipsec_003.cli @@ -0,0 +1,31 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/ipsec_003/ipsec_003.spec /tmp/pipeline/ipsec_003/ipsec_003.c +pipeline libbuild /tmp/pipeline/ipsec_003/ipsec_003.c /tmp/pipeline/ipsec_003/ipsec_003.so +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + +; Crypto device creation +cryptodev crypto_aesni_mb0 queues 1 qsize 128 +ring RING0 size 1024 numa 0 +ring RING1 size 1024 numa 0 + +; Pipeline build using shared object file +pipeline PIPELINE0 build lib /tmp/pipeline/ipsec_003/ipsec_003.so io /tmp/pipeline/ipsec_003/ethdev.io numa 0 + +; IPSEC block creation +ipsec IPSEC0 create in RING0 out RING1 cryptodev crypto_aesni_mb0 cryptoq 0 bsz 1 1 1 1 samax 512 numa 0 + +; IPSEC sa rule addition +ipsec IPSEC0 sa add /tmp/pipeline/ipsec_003/cmd_files/ipsec_sa.txt + +pipeline PIPELINE0 table policy_table add /tmp/pipeline/ipsec_003/cmd_files/cmd_1.txt +pipeline PIPELINE0 commit + +pipeline PIPELINE0 enable thread 1 +block type ipsec instance IPSEC0 enable thread 1 diff --git a/dep/pipeline/ipsec_003/ipsec_003.spec b/dep/pipeline/ipsec_003/ipsec_003.spec new file mode 100644 index 00000000..5c649480 --- /dev/null +++ b/dep/pipeline/ipsec_003/ipsec_003.spec @@ -0,0 +1,110 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2020 Intel Corporation + +; +// +// Headers +// +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<8> ver_ihl + bit<8> diffserv + bit<16> total_len + bit<16> identification + bit<16> flags_offset + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +struct ipsec_internal_h { + bit<32> sa_id +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h +header ipsec_internal instanceof ipsec_internal_h + +// +// Meta-data +// +struct metadata_t { + bit<32> port_in + bit<32> port_out +} + +metadata instanceof metadata_t + +// +// Actions +// +struct encrypt_args_t { + bit<32> sa_id +} + +action encrypt args instanceof encrypt_args_t { + //Set the IPsec internal header. + validate h.ipsec_internal + mov h.ipsec_internal.sa_id t.sa_id + mov m.port_out 1 + invalidate h.ethernet + return +} + +action drop args none { + drop +} + +// +// Tables. +// +table policy_table { + key { + h.ipv4.src_addr exact + h.ipv4.dst_addr exact + h.ipv4.protocol exact + } + + actions { + encrypt + drop + } + + default_action drop args none + size 65536 +} + +// +// Pipeline. +// +apply { + rx m.port_in + jmpeq FROM_IPSEC m.port_in 1 + extract h.ethernet + extract h.ipv4 + table policy_table + jmp SEND_PACKET + +FROM_IPSEC : extract h.ipv4 + jmpneq SEND_IPSEC_TO_NET h.ipv4.protocol 0x32 + table policy_table + jmp SEND_PACKET + +SEND_IPSEC_TO_NET : validate h.ethernet + mov h.ethernet.dst_addr 0x000102030405 + mov h.ethernet.src_addr 0x000a0b0c0d0e + mov h.ethernet.ethertype 0x0800 + mov m.port_out 0 + +SEND_PACKET : emit h.ipsec_internal + emit h.ethernet + emit h.ipv4 + tx m.port_out +} diff --git a/dep/pipeline/ipsec_003/pcap_files/in_1.txt b/dep/pipeline/ipsec_003/pcap_files/in_1.txt new file mode 100644 index 00000000..3bfc4948 --- /dev/null +++ b/dep/pipeline/ipsec_003/pcap_files/in_1.txt @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 52 54 00 12 44 57 52 54 00 12 44 56 08 00 45 00 +000010 00 22 00 01 00 00 40 11 b2 c6 64 00 00 01 64 00 +000020 00 01 00 64 00 c8 00 0e 2d 99 58 58 58 58 58 58 diff --git a/dep/pipeline/ipsec_003/pcap_files/out_1.txt b/dep/pipeline/ipsec_003/pcap_files/out_1.txt new file mode 100644 index 00000000..3f3fe6e8 --- /dev/null +++ b/dep/pipeline/ipsec_003/pcap_files/out_1.txt @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 00 01 02 03 04 05 00 0a 0b 0c 0d 0e 08 00 45 00 +000010 00 22 00 01 00 00 40 11 b2 c6 64 00 00 01 64 00 +000020 00 01 00 64 00 c8 00 0e 2d 99 58 58 58 58 58 58 diff --git a/dep/pipeline/ipsec_003/pcap_files/out_2.txt b/dep/pipeline/ipsec_003/pcap_files/out_2.txt new file mode 100644 index 00000000..af0fc303 --- /dev/null +++ b/dep/pipeline/ipsec_003/pcap_files/out_2.txt @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx diff --git a/dep/pipeline/ipsec_003/readme.txt b/dep/pipeline/ipsec_003/readme.txt new file mode 100644 index 00000000..188104c8 --- /dev/null +++ b/dep/pipeline/ipsec_003/readme.txt @@ -0,0 +1,20 @@ +Test Case: test_ipsec_003 +----------------------------- + +Scenario being tested: + IPSEC SA rule deletion for the tunnel mode. + +Description: + IPSEC block will be created in application, with matching table + rules and SA rules. The first packet sent, should match the + specified table rule, do encryption of the packet with the + configured SA rule, do decryption of the encrypted packet based + on the SA rule. The application will modify MAC addresses and + sent out the modified packet on the same port. + The testcase then delete the table rules as well as SA rules + using CLI commands. The same packet is sent, it should not match + any rule and should be dropped. + +Verification: + The packet verification for the testcase should happen + according to the description. diff --git a/dep/pipeline/ipsec_004/cmd_files/cmd_1.txt b/dep/pipeline/ipsec_004/cmd_files/cmd_1.txt new file mode 100644 index 00000000..99a33031 --- /dev/null +++ b/dep/pipeline/ipsec_004/cmd_files/cmd_1.txt @@ -0,0 +1,2 @@ +match 0x64000001 0x64000001 0x6 action encrypt sa_id 0 +match 0x64000001 0x64000001 0x32 action encrypt sa_id 1 \ No newline at end of file diff --git a/dep/pipeline/ipsec_004/cmd_files/ipsec_sa.txt b/dep/pipeline/ipsec_004/cmd_files/ipsec_sa.txt new file mode 100644 index 00000000..cd524304 --- /dev/null +++ b/dep/pipeline/ipsec_004/cmd_files/ipsec_sa.txt @@ -0,0 +1,2 @@ +encrypt cipher aes-cbc-128 key 0x000102030405060708090a0b0c0d0e0f auth sha1-hmac key 0x000102030405060708090a0b0c0d0e0f10111213 esp spi 100 transport +decrypt cipher aes-cbc-128 key 0x000102030405060708090a0b0c0d0e0f auth sha1-hmac key 0x000102030405060708090a0b0c0d0e0f10111213 esp spi 100 transport \ No newline at end of file diff --git a/dep/pipeline/ipsec_004/ethdev.io b/dep/pipeline/ipsec_004/ethdev.io new file mode 100644 index 00000000..e22217cc --- /dev/null +++ b/dep/pipeline/ipsec_004/ethdev.io @@ -0,0 +1,17 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ring RING1 bsz 1 + +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ring RING0 bsz 1 diff --git a/dep/pipeline/ipsec_004/ipsec_004.cli b/dep/pipeline/ipsec_004/ipsec_004.cli new file mode 100644 index 00000000..e4fb3b74 --- /dev/null +++ b/dep/pipeline/ipsec_004/ipsec_004.cli @@ -0,0 +1,31 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/ipsec_004/ipsec_004.spec /tmp/pipeline/ipsec_004/ipsec_004.c +pipeline libbuild /tmp/pipeline/ipsec_004/ipsec_004.c /tmp/pipeline/ipsec_004/ipsec_004.so +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + +; Crypto device creation +cryptodev crypto_aesni_mb0 queues 1 qsize 128 +ring RING0 size 1024 numa 0 +ring RING1 size 1024 numa 0 + +; Pipeline build using shared object file +pipeline PIPELINE0 build lib /tmp/pipeline/ipsec_004/ipsec_004.so io /tmp/pipeline/ipsec_004/ethdev.io numa 0 + +; IPSEC block creation +ipsec IPSEC0 create in RING0 out RING1 cryptodev crypto_aesni_mb0 cryptoq 0 bsz 1 1 1 1 samax 512 numa 0 + +; IPSEC sa rule addition +ipsec IPSEC0 sa add /tmp/pipeline/ipsec_004/cmd_files/ipsec_sa.txt + +pipeline PIPELINE0 table policy_table add /tmp/pipeline/ipsec_004/cmd_files/cmd_1.txt +pipeline PIPELINE0 commit + +pipeline PIPELINE0 enable thread 1 +block type ipsec instance IPSEC0 enable thread 1 diff --git a/dep/pipeline/ipsec_004/ipsec_004.spec b/dep/pipeline/ipsec_004/ipsec_004.spec new file mode 100644 index 00000000..5c649480 --- /dev/null +++ b/dep/pipeline/ipsec_004/ipsec_004.spec @@ -0,0 +1,110 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2020 Intel Corporation + +; +// +// Headers +// +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<8> ver_ihl + bit<8> diffserv + bit<16> total_len + bit<16> identification + bit<16> flags_offset + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +struct ipsec_internal_h { + bit<32> sa_id +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h +header ipsec_internal instanceof ipsec_internal_h + +// +// Meta-data +// +struct metadata_t { + bit<32> port_in + bit<32> port_out +} + +metadata instanceof metadata_t + +// +// Actions +// +struct encrypt_args_t { + bit<32> sa_id +} + +action encrypt args instanceof encrypt_args_t { + //Set the IPsec internal header. + validate h.ipsec_internal + mov h.ipsec_internal.sa_id t.sa_id + mov m.port_out 1 + invalidate h.ethernet + return +} + +action drop args none { + drop +} + +// +// Tables. +// +table policy_table { + key { + h.ipv4.src_addr exact + h.ipv4.dst_addr exact + h.ipv4.protocol exact + } + + actions { + encrypt + drop + } + + default_action drop args none + size 65536 +} + +// +// Pipeline. +// +apply { + rx m.port_in + jmpeq FROM_IPSEC m.port_in 1 + extract h.ethernet + extract h.ipv4 + table policy_table + jmp SEND_PACKET + +FROM_IPSEC : extract h.ipv4 + jmpneq SEND_IPSEC_TO_NET h.ipv4.protocol 0x32 + table policy_table + jmp SEND_PACKET + +SEND_IPSEC_TO_NET : validate h.ethernet + mov h.ethernet.dst_addr 0x000102030405 + mov h.ethernet.src_addr 0x000a0b0c0d0e + mov h.ethernet.ethertype 0x0800 + mov m.port_out 0 + +SEND_PACKET : emit h.ipsec_internal + emit h.ethernet + emit h.ipv4 + tx m.port_out +} diff --git a/dep/pipeline/ipsec_004/pcap_files/in_1.txt b/dep/pipeline/ipsec_004/pcap_files/in_1.txt new file mode 100644 index 00000000..d6ca8116 --- /dev/null +++ b/dep/pipeline/ipsec_004/pcap_files/in_1.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 52 54 00 12 44 57 52 54 00 12 44 56 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 b2 c5 64 00 00 01 64 00 +000020 00 01 00 64 00 c8 00 00 00 0f 00 00 00 0a 50 02 +000030 20 00 bd 8a 00 00 58 58 58 58 58 58 diff --git a/dep/pipeline/ipsec_004/pcap_files/out_1.txt b/dep/pipeline/ipsec_004/pcap_files/out_1.txt new file mode 100644 index 00000000..0c495a74 --- /dev/null +++ b/dep/pipeline/ipsec_004/pcap_files/out_1.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 00 01 02 03 04 05 00 0a 0b 0c 0d 0e 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 b2 c5 64 00 00 01 64 00 +000020 00 01 00 64 00 c8 00 00 00 0f 00 00 00 0a 50 02 +000030 20 00 bd 8a 00 00 58 58 58 58 58 58 diff --git a/dep/pipeline/ipsec_004/pcap_files/out_2.txt b/dep/pipeline/ipsec_004/pcap_files/out_2.txt new file mode 100644 index 00000000..af0fc303 --- /dev/null +++ b/dep/pipeline/ipsec_004/pcap_files/out_2.txt @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx diff --git a/dep/pipeline/ipsec_004/readme.txt b/dep/pipeline/ipsec_004/readme.txt new file mode 100644 index 00000000..dd4a5275 --- /dev/null +++ b/dep/pipeline/ipsec_004/readme.txt @@ -0,0 +1,20 @@ +Test Case: test_ipsec_004 +----------------------------- + +Scenario being tested: + IPSEC SA rule deletion for the transport mode. + +Description: + IPSEC block will be created in application, with matching table + rules and SA rules. The first packet sent, should match the + specified table rule, do encryption of the packet with the + configured SA rule, do decryption of the encrypted packet based + on the SA rule. The application will modify MAC addresses and + sent out the modified packet on the same port. + The testcase then delete the table rules as well as SA rules + using CLI commands. The same packet is sent, it should not match + any rule and should be dropped. + +Verification: + The packet verification for the testcase should happen + according to the description. diff --git a/dep/pipeline/mov_009/ethdev.io b/dep/pipeline/mov_009/ethdev.io new file mode 100644 index 00000000..4e31f499 --- /dev/null +++ b/dep/pipeline/mov_009/ethdev.io @@ -0,0 +1,27 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline packet mirroring. +; +mirroring slots 4 sessions 64 + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ethdev 0000:00:05.0 rxq 0 bsz 1 +port in 2 ethdev 0000:00:06.0 rxq 0 bsz 1 +port in 3 ethdev 0000:00:07.0 rxq 0 bsz 1 + +; +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ethdev 0000:00:05.0 txq 0 bsz 1 +port out 2 ethdev 0000:00:06.0 txq 0 bsz 1 +port out 3 ethdev 0000:00:07.0 txq 0 bsz 1 diff --git a/dep/pipeline/mov_009/mov_009.cli b/dep/pipeline/mov_009/mov_009.cli new file mode 100755 index 00000000..b9e43e2b --- /dev/null +++ b/dep/pipeline/mov_009/mov_009.cli @@ -0,0 +1,19 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/mov_009/mov_009.spec /tmp/pipeline/mov_009/mov_009.c +pipeline libbuild /tmp/pipeline/mov_009/mov_009.c /tmp/pipeline/mov_009/mov_009.so + +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:05.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:06.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:07.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + +pipeline PIPELINE0 build lib /tmp/pipeline/mov_009/mov_009.so io /tmp/pipeline/mov_009/ethdev.io numa 0 + +pipeline PIPELINE0 enable thread 1 diff --git a/dep/pipeline/mov_009/mov_009.spec b/dep/pipeline/mov_009/mov_009.spec new file mode 100755 index 00000000..aa00ac9f --- /dev/null +++ b/dep/pipeline/mov_009/mov_009.spec @@ -0,0 +1,41 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2023 Intel Corporation + +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv6_h { + bit<32> ver_tc_label + bit<16> payload_length + bit<8> next_header + bit<8> hop_limit + bit<128> src_addr + bit<128> dst_addr +} + +header ethernet instanceof ethernet_h +header ipv6 instanceof ipv6_h + +struct metadata_t { + bit<32> port + bit<128> swap_addr + bit<128> temp_128 +} + +metadata instanceof metadata_t + +apply { + rx m.port + extract h.ethernet + extract h.ipv6 + mov m.swap_addr h.ipv6.src_addr + mov m.temp_128 m.swap_addr + mov h.ipv6.src_addr h.ipv6.dst_addr + mov h.ipv6.dst_addr m.temp_128 + emit h.ethernet + emit h.ipv6 + tx m.port +} \ No newline at end of file diff --git a/dep/pipeline/mov_009/pcap_files/in_1.txt b/dep/pipeline/mov_009/pcap_files/in_1.txt new file mode 100644 index 00000000..a55515d1 --- /dev/null +++ b/dep/pipeline/mov_009/pcap_files/in_1.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc de 00 00 00 00 00 00 00 00 86 dd 60 00 +000010 00 00 00 08 11 40 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 +000020 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 +000030 da db dc dd de df 00 64 12 b5 00 08 ef b8 \ No newline at end of file diff --git a/dep/pipeline/mov_009/pcap_files/out_1.txt b/dep/pipeline/mov_009/pcap_files/out_1.txt new file mode 100644 index 00000000..e3d88dbf --- /dev/null +++ b/dep/pipeline/mov_009/pcap_files/out_1.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc de 00 00 00 00 00 00 00 00 86 dd 60 00 +000010 00 00 00 08 11 40 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 +000020 da db dc dd de df c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 +000030 ca cb cc cd ce cf 00 64 12 b5 00 08 ef b8 \ No newline at end of file diff --git a/dep/pipeline/mov_009/readme.md b/dep/pipeline/mov_009/readme.md new file mode 100644 index 00000000..9f2a08ec --- /dev/null +++ b/dep/pipeline/mov_009/readme.md @@ -0,0 +1,18 @@ +Test Case: test_mov_009 +----------------------- + + Instructions being tested: + mov (h/m).field (h/m).field + + Scenario being tested: + mov dst src + dst : 128 bit header or metadata + src : 128 bit header or metadata + + Description: + The testcase swaps the ipv6 source address with ipv6 + destination address. + + Verification: + The packet verification for the testcase should happen + according to the description. \ No newline at end of file diff --git a/dep/pipeline/mov_010/cmd_files/cmd_1.txt b/dep/pipeline/mov_010/cmd_files/cmd_1.txt new file mode 100644 index 00000000..c9051beb --- /dev/null +++ b/dep/pipeline/mov_010/cmd_files/cmd_1.txt @@ -0,0 +1,4 @@ +match 0x64000001 action mov_010_action_01 +match 0x64000002 action mov_010_action_02 +match 0x64000003 action mov_010_action_03 +match 0x64000004 action mov_010_action_04 \ No newline at end of file diff --git a/dep/pipeline/mov_010/ethdev.io b/dep/pipeline/mov_010/ethdev.io new file mode 100644 index 00000000..4e31f499 --- /dev/null +++ b/dep/pipeline/mov_010/ethdev.io @@ -0,0 +1,27 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline packet mirroring. +; +mirroring slots 4 sessions 64 + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ethdev 0000:00:05.0 rxq 0 bsz 1 +port in 2 ethdev 0000:00:06.0 rxq 0 bsz 1 +port in 3 ethdev 0000:00:07.0 rxq 0 bsz 1 + +; +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ethdev 0000:00:05.0 txq 0 bsz 1 +port out 2 ethdev 0000:00:06.0 txq 0 bsz 1 +port out 3 ethdev 0000:00:07.0 txq 0 bsz 1 diff --git a/dep/pipeline/mov_010/mov_010.cli b/dep/pipeline/mov_010/mov_010.cli new file mode 100755 index 00000000..57bec6d4 --- /dev/null +++ b/dep/pipeline/mov_010/mov_010.cli @@ -0,0 +1,19 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/mov_010/mov_010.spec /tmp/pipeline/mov_010/mov_010.c +pipeline libbuild /tmp/pipeline/mov_010/mov_010.c /tmp/pipeline/mov_010/mov_010.so + +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:05.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:06.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:07.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + +pipeline PIPELINE0 build lib /tmp/pipeline/mov_010/mov_010.so io /tmp/pipeline/mov_010/ethdev.io numa 0 + +pipeline PIPELINE0 enable thread 1 diff --git a/dep/pipeline/mov_010/mov_010.spec b/dep/pipeline/mov_010/mov_010.spec new file mode 100755 index 00000000..0f336afd --- /dev/null +++ b/dep/pipeline/mov_010/mov_010.spec @@ -0,0 +1,100 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2023 Intel Corporation + +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<64> ver_ihl_diffserv_len_id_flags + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +struct ipv6_h { + bit<32> ver_tc_label + bit<16> payload_length + bit<8> next_header + bit<8> hop_limit + bit<128> src_addr + bit<128> dst_addr +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h +header ipv6 instanceof ipv6_h + +struct metadata_t { + bit<32> port + bit<128> swap_addr + bit<128> temp_128 + bit<128> temp_128_64 + bit<128> temp_128_8 +} + +metadata instanceof metadata_t + +action mov_010_action_01 args none { + mov h.ipv6.dst_addr h.ipv4.src_addr + mov h.ipv6.src_addr h.ipv6.payload_length + return +} + +action mov_010_action_02 args none { + mov h.ipv6.src_addr h.ethernet.src_addr + return +} + +action mov_010_action_03 args none { + mov h.ipv6.src_addr h.ipv4.ver_ihl_diffserv_len_id_flags + mov h.ipv6.dst_addr h.ipv4.ttl + return +} + +action mov_010_action_04 args none { + mov m.temp_128_64 h.ipv4.ver_ihl_diffserv_len_id_flags + mov m.temp_128_8 h.ipv4.ttl + mov h.ipv6.src_addr m.temp_128_64 + mov h.ipv6.dst_addr m.temp_128_8 + return +} + +action drop args none { + drop + return +} + +table table_001 { + + key { + h.ipv4.src_addr exact + } + + actions { + mov_010_action_01 + mov_010_action_02 + mov_010_action_03 + mov_010_action_04 + drop + } + + default_action drop args none const + size 1048576 +} + +apply { + rx m.port + extract h.ethernet + extract h.ipv4 + extract h.ipv6 + table table_001 + emit h.ethernet + emit h.ipv4 + emit h.ipv6 + tx m.port +} diff --git a/dep/pipeline/mov_010/pcap_files/in_1.txt b/dep/pipeline/mov_010/pcap_files/in_1.txt new file mode 100644 index 00000000..5e0fc3a3 --- /dev/null +++ b/dep/pipeline/mov_010/pcap_files/in_1.txt @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7f 64 00 00 01 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 1 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7e 64 00 00 02 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 2 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7d 64 00 00 03 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 3 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7c 64 00 00 04 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 diff --git a/dep/pipeline/mov_010/pcap_files/out_1.txt b/dep/pipeline/mov_010/pcap_files/out_1.txt new file mode 100644 index 00000000..1adb0e16 --- /dev/null +++ b/dep/pipeline/mov_010/pcap_files/out_1.txt @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7f 64 00 00 01 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 00 00 00 00 00 00 +000030 00 00 00 00 00 00 00 00 00 0e 00 00 00 00 00 00 +000040 00 00 00 00 00 00 64 00 00 01 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 1 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7e 64 00 00 02 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 00 00 00 00 00 00 +000030 00 00 00 00 52 54 00 12 34 56 d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 2 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7d 64 00 00 03 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 00 00 00 00 00 00 +000030 00 00 45 00 00 4a 00 01 00 00 00 00 00 00 00 00 +000040 00 00 00 00 00 00 00 00 00 40 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 3 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7c 64 00 00 04 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 00 00 00 00 00 00 +000030 00 00 45 00 00 4a 00 01 00 00 00 00 00 00 00 00 +000040 00 00 00 00 00 00 00 00 00 40 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 \ No newline at end of file diff --git a/dep/pipeline/mov_010/readme.md b/dep/pipeline/mov_010/readme.md new file mode 100644 index 00000000..659df428 --- /dev/null +++ b/dep/pipeline/mov_010/readme.md @@ -0,0 +1,27 @@ +Test Case: test_mov_010 +----------------------- + + Instructions being tested: + mov (h/m).field h.field + + Scenario being tested: + mov dst src + dst : 128 bit header or metadata + src : <= 64 bit header field (64, 48, 32, 16, 8) + + Description: + The testcase moves ipv4 source address to the ipv6 + destination address and ipv6 payload length to the ipv6 + source address for a matched address. + For second matched criteria, the testcase will move the + ethernet source address to the ipv6 source address. + For the third matched criteria, the testcase will move the + 64-bit ipv4 header data to ipv6 source address and ipv4 ttl + to the ipv6 destination address. + For the fourth matched criteria, the testcase will move the + 64-bit ipv4 header data to ipv6 source address and ipv4 ttl + to the ipv6 destination address. + + Verification: + The packet verification for the testcase should happen + according to the description. \ No newline at end of file diff --git a/dep/pipeline/mov_011/cmd_files/cmd_1.txt b/dep/pipeline/mov_011/cmd_files/cmd_1.txt new file mode 100644 index 00000000..c0eab634 --- /dev/null +++ b/dep/pipeline/mov_011/cmd_files/cmd_1.txt @@ -0,0 +1,4 @@ +match 0x64000001 action mov_011_action_01 +match 0x64000002 action mov_011_action_02 +match 0x64000003 action mov_011_action_03 +match 0x64000004 action mov_011_action_04 \ No newline at end of file diff --git a/dep/pipeline/mov_011/ethdev.io b/dep/pipeline/mov_011/ethdev.io new file mode 100644 index 00000000..4e31f499 --- /dev/null +++ b/dep/pipeline/mov_011/ethdev.io @@ -0,0 +1,27 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline packet mirroring. +; +mirroring slots 4 sessions 64 + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ethdev 0000:00:05.0 rxq 0 bsz 1 +port in 2 ethdev 0000:00:06.0 rxq 0 bsz 1 +port in 3 ethdev 0000:00:07.0 rxq 0 bsz 1 + +; +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ethdev 0000:00:05.0 txq 0 bsz 1 +port out 2 ethdev 0000:00:06.0 txq 0 bsz 1 +port out 3 ethdev 0000:00:07.0 txq 0 bsz 1 diff --git a/dep/pipeline/mov_011/mov_011.cli b/dep/pipeline/mov_011/mov_011.cli new file mode 100755 index 00000000..7d9b7d5e --- /dev/null +++ b/dep/pipeline/mov_011/mov_011.cli @@ -0,0 +1,19 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/mov_011/mov_011.spec /tmp/pipeline/mov_011/mov_011.c +pipeline libbuild /tmp/pipeline/mov_011/mov_011.c /tmp/pipeline/mov_011/mov_011.so + +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:05.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:06.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:07.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + +pipeline PIPELINE0 build lib /tmp/pipeline/mov_011/mov_011.so io /tmp/pipeline/mov_011/ethdev.io numa 0 + +pipeline PIPELINE0 enable thread 1 diff --git a/dep/pipeline/mov_011/mov_011.spec b/dep/pipeline/mov_011/mov_011.spec new file mode 100755 index 00000000..ad08d10d --- /dev/null +++ b/dep/pipeline/mov_011/mov_011.spec @@ -0,0 +1,101 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2023 Intel Corporation + +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<64> ver_ihl_diffserv_len_id_flags + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +struct ipv6_h { + bit<32> ver_tc_label + bit<16> payload_length + bit<8> next_header + bit<8> hop_limit + bit<128> src_addr + bit<128> dst_addr +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h +header ipv6 instanceof ipv6_h + +struct metadata_t { + bit<32> port + bit<128> swap_addr + bit<128> temp_128 + bit<128> temp_128_64 + bit<128> temp_128_8 +} + +metadata instanceof metadata_t + +action mov_011_action_01 args none { + mov h.ipv4.src_addr h.ipv6.dst_addr + mov h.ipv6.payload_length h.ipv6.src_addr + return +} + +action mov_011_action_02 args none { + mov m.temp_128 h.ipv6.src_addr + mov h.ethernet.src_addr m.temp_128 + return +} + +action mov_011_action_03 args none { + mov h.ipv4.ver_ihl_diffserv_len_id_flags h.ipv6.src_addr + mov h.ipv4.ttl h.ipv6.dst_addr + return +} + +action mov_011_action_04 args none { + mov m.temp_128_64 h.ipv6.src_addr + mov m.temp_128_8 h.ipv6.dst_addr + mov h.ipv4.ver_ihl_diffserv_len_id_flags m.temp_128_64 + mov h.ipv4.ttl m.temp_128_8 + return +} + +action drop args none { + drop + return +} + +table table_001 { + + key { + h.ipv4.src_addr exact + } + + actions { + mov_011_action_01 + mov_011_action_02 + mov_011_action_03 + mov_011_action_04 + drop + } + + default_action drop args none const + size 1048576 +} + +apply { + rx m.port + extract h.ethernet + extract h.ipv4 + extract h.ipv6 + table table_001 + emit h.ethernet + emit h.ipv4 + emit h.ipv6 + tx m.port +} diff --git a/dep/pipeline/mov_011/pcap_files/in_1.txt b/dep/pipeline/mov_011/pcap_files/in_1.txt new file mode 100644 index 00000000..5e0fc3a3 --- /dev/null +++ b/dep/pipeline/mov_011/pcap_files/in_1.txt @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7f 64 00 00 01 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 1 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7e 64 00 00 02 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 2 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7d 64 00 00 03 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 3 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7c 64 00 00 04 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 diff --git a/dep/pipeline/mov_011/pcap_files/out_1.txt b/dep/pipeline/mov_011/pcap_files/out_1.txt new file mode 100644 index 00000000..7e08df01 --- /dev/null +++ b/dep/pipeline/mov_011/pcap_files/out_1.txt @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7f dc dd de df 64 00 +000020 00 0a 60 00 00 00 ce cf 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 1 +000000 aa bb cc de 00 00 ca cb cc cd ce cf 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7e 64 00 00 02 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 2 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 c8 c9 +000010 ca cb cc cd ce cf df 29 b2 7d 64 00 00 03 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 3 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 c8 c9 +000010 ca cb cc cd ce cf df 29 b2 7c 64 00 00 04 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 diff --git a/dep/pipeline/mov_011/readme.md b/dep/pipeline/mov_011/readme.md new file mode 100644 index 00000000..c12f4231 --- /dev/null +++ b/dep/pipeline/mov_011/readme.md @@ -0,0 +1,27 @@ +Test Case: test_mov_011 +----------------------- + + Instructions being tested: + mov h.field (h/m).field + + Scenario being tested: + mov dst src + dst : <= 64 bit header field (64, 48, 32, 16, 8) + src : 128 bit header or metadata + + Description: + The testcase moves ipv6 destination address to the ipv4 + source address and ipv6 source address to the ipv6 payload + length for a matched address. + For second matched criteria, the testcase will move + the ipv6 source address to the ethernet source address. + For third matched criteria, the testcase will move + ipv6 source address to 64-bit value ipv4 header field and + move ipv6 destination address to ipv4 ttl. + For fourth matched criteria, the testcase will move + ipv6 source address to 64-bit value ipv4 header field and + move ipv6 destination address to ipv4 ttl. + + Verification: + The packet verification for the testcase should happen + according to the description. \ No newline at end of file diff --git a/dep/pipeline/mov_012/cmd_files/cmd_1.txt b/dep/pipeline/mov_012/cmd_files/cmd_1.txt new file mode 100644 index 00000000..c68fa1a1 --- /dev/null +++ b/dep/pipeline/mov_012/cmd_files/cmd_1.txt @@ -0,0 +1,2 @@ +match 0x64000001 action mov_012_action_01 +match 0x64000002 action mov_012_action_02 \ No newline at end of file diff --git a/dep/pipeline/mov_012/ethdev.io b/dep/pipeline/mov_012/ethdev.io new file mode 100644 index 00000000..4e31f499 --- /dev/null +++ b/dep/pipeline/mov_012/ethdev.io @@ -0,0 +1,27 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline packet mirroring. +; +mirroring slots 4 sessions 64 + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ethdev 0000:00:05.0 rxq 0 bsz 1 +port in 2 ethdev 0000:00:06.0 rxq 0 bsz 1 +port in 3 ethdev 0000:00:07.0 rxq 0 bsz 1 + +; +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ethdev 0000:00:05.0 txq 0 bsz 1 +port out 2 ethdev 0000:00:06.0 txq 0 bsz 1 +port out 3 ethdev 0000:00:07.0 txq 0 bsz 1 diff --git a/dep/pipeline/mov_012/mov_012.cli b/dep/pipeline/mov_012/mov_012.cli new file mode 100755 index 00000000..5b701dbe --- /dev/null +++ b/dep/pipeline/mov_012/mov_012.cli @@ -0,0 +1,19 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/mov_012/mov_012.spec /tmp/pipeline/mov_012/mov_012.c +pipeline libbuild /tmp/pipeline/mov_012/mov_012.c /tmp/pipeline/mov_012/mov_012.so + +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:05.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:06.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:07.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + +pipeline PIPELINE0 build lib /tmp/pipeline/mov_012/mov_012.so io /tmp/pipeline/mov_012/ethdev.io numa 0 + +pipeline PIPELINE0 enable thread 1 diff --git a/dep/pipeline/mov_012/mov_012.spec b/dep/pipeline/mov_012/mov_012.spec new file mode 100755 index 00000000..be04877b --- /dev/null +++ b/dep/pipeline/mov_012/mov_012.spec @@ -0,0 +1,82 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2023 Intel Corporation + +struct ethernet_h { + bit<96> dst_src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<16> ver_ihl_diffserv + bit<48> total_len_identification_flags + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +struct ipv6_h { + bit<32> ver_tc_label + bit<16> payload_length + bit<8> next_header + bit<8> hop_limit + bit<128> src_addr + bit<128> dst_addr +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h +header ipv6 instanceof ipv6_h + +struct metadata_t { + bit<32> port + bit<128> temp_128 +} + +metadata instanceof metadata_t + +action mov_012_action_01 args none { + mov h.ipv4.src_addr h.ipv6.dst_addr + mov h.ipv4.total_len_identification_flags h.ipv6.src_addr + return +} + +action mov_012_action_02 args none { + mov m.temp_128 h.ipv6.src_addr + mov h.ethernet.dst_src_addr m.temp_128 + return +} + +action drop args none { + drop + return +} + +table table_001 { + + key { + h.ipv4.src_addr exact + } + + actions { + mov_012_action_01 + mov_012_action_02 + drop + } + + default_action drop args none const + size 1048576 +} + +apply { + rx m.port + extract h.ethernet + extract h.ipv4 + extract h.ipv6 + table table_001 + emit h.ethernet + emit h.ipv4 + emit h.ipv6 + tx m.port +} \ No newline at end of file diff --git a/dep/pipeline/mov_012/pcap_files/in_1.txt b/dep/pipeline/mov_012/pcap_files/in_1.txt new file mode 100644 index 00000000..beea54f0 --- /dev/null +++ b/dep/pipeline/mov_012/pcap_files/in_1.txt @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7f 64 00 00 01 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 1 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7e 64 00 00 02 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 diff --git a/dep/pipeline/mov_012/pcap_files/out_1.txt b/dep/pipeline/mov_012/pcap_files/out_1.txt new file mode 100644 index 00000000..41217f9d --- /dev/null +++ b/dep/pipeline/mov_012/pcap_files/out_1.txt @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc de 00 00 52 54 00 12 34 56 08 00 45 00 +000010 ca cb cc cd ce cf 40 29 b2 7f dc dd de df 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 +# Packet 1 +000000 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf 08 00 45 00 +000010 00 4a 00 01 00 00 40 29 b2 7e 64 00 00 02 64 00 +000020 00 0a 60 00 00 00 00 0e 11 40 c0 c1 c2 c3 c4 c5 +000030 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 +000040 d6 d7 d8 d9 da db dc dd de df 00 64 00 c8 00 0e +000050 f8 90 58 58 58 58 58 58 diff --git a/dep/pipeline/mov_012/readme.md b/dep/pipeline/mov_012/readme.md new file mode 100644 index 00000000..9fc85458 --- /dev/null +++ b/dep/pipeline/mov_012/readme.md @@ -0,0 +1,24 @@ +Test Case: test_mov_012 +----------------------- + + Instructions being tested: + mov (h/m).field (h/m).field + + Scenario being tested: + Mov instruction with custom width destination as well as + custom width source operands. + mov dst src + dst : 32, 48, 96 bit header field + src : 128 bit header or metadata + + Description: + The testcase moves ipv6 destination address to the ipv4 + source address and ipv6 source address to the ipv4 total + length for a matched address. + For different matched criteria, the testcase will move + the ipv6 source address to the ethernet destination + source address. + + Verification: + The packet verification for the testcase should happen + according to the description. \ No newline at end of file diff --git a/dep/pipeline/rss_001/ethdev.io b/dep/pipeline/rss_001/ethdev.io new file mode 100644 index 00000000..4e31f499 --- /dev/null +++ b/dep/pipeline/rss_001/ethdev.io @@ -0,0 +1,27 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline packet mirroring. +; +mirroring slots 4 sessions 64 + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ethdev 0000:00:05.0 rxq 0 bsz 1 +port in 2 ethdev 0000:00:06.0 rxq 0 bsz 1 +port in 3 ethdev 0000:00:07.0 rxq 0 bsz 1 + +; +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ethdev 0000:00:05.0 txq 0 bsz 1 +port out 2 ethdev 0000:00:06.0 txq 0 bsz 1 +port out 3 ethdev 0000:00:07.0 txq 0 bsz 1 diff --git a/dep/pipeline/rss_001/pcap_files/in_1.txt b/dep/pipeline/rss_001/pcap_files/in_1.txt new file mode 100644 index 00000000..af983df2 --- /dev/null +++ b/dep/pipeline/rss_001/pcap_files/in_1.txt @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 52 54 00 12 44 57 a4 bf 01 70 70 b0 08 00 45 00 +000010 00 34 00 01 00 00 40 11 78 b0 00 00 01 01 01 00 +000020 00 08 00 64 00 c8 00 20 d8 55 58 58 58 58 58 58 +000030 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 +000040 58 58 \ No newline at end of file diff --git a/dep/pipeline/rss_001/pcap_files/out_1.txt b/dep/pipeline/rss_001/pcap_files/out_1.txt new file mode 100644 index 00000000..6b4ef62d --- /dev/null +++ b/dep/pipeline/rss_001/pcap_files/out_1.txt @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 52 54 00 12 44 57 a4 bf 01 70 70 b0 08 00 45 00 +000010 00 34 00 01 00 00 40 11 78 b0 00 00 01 01 01 00 +000020 00 08 00 64 00 c8 00 20 d8 55 58 58 58 58 58 58 +000030 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 +000040 58 58 diff --git a/dep/pipeline/rss_001/readme.md b/dep/pipeline/rss_001/readme.md new file mode 100644 index 00000000..63722078 --- /dev/null +++ b/dep/pipeline/rss_001/readme.md @@ -0,0 +1,21 @@ + +Test Case: test_rss_001 +----------------------- + + Instruction being tested: + rss rss_obect_name m.field h.field h.field + + Scenario being tested: + To verify Receive Side Scaling (RSS) hash algorithm support + over an n-tuple set of fields read from the packet headers + by using the "rss" instruction. + + Description: + Initially, the application is run without providing any RSS + key. Through, control plane, RSS key is provided and test + case expect the packet out on Port 0. The RSS key is changed + from control plane and for the similar packet we expect the + packet out on Port 1, as RSS computed hash changes. + + Verification: + Packet verification should happen according to the description. diff --git a/dep/pipeline/rss_001/rss_001.cli b/dep/pipeline/rss_001/rss_001.cli new file mode 100644 index 00000000..f83eeb40 --- /dev/null +++ b/dep/pipeline/rss_001/rss_001.cli @@ -0,0 +1,20 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/rss_001/rss_001.spec /tmp/pipeline/rss_001/rss_001.c +pipeline libbuild /tmp/pipeline/rss_001/rss_001.c /tmp/pipeline/rss_001/rss_001.so + +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:05.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:06.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:07.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + + +pipeline PIPELINE0 build lib /tmp/pipeline/rss_001/rss_001.so io /tmp/pipeline/rss_001/ethdev.io numa 0 + +pipeline PIPELINE0 enable thread 1 diff --git a/dep/pipeline/rss_001/rss_001.spec b/dep/pipeline/rss_001/rss_001.spec new file mode 100644 index 00000000..c9801ee9 --- /dev/null +++ b/dep/pipeline/rss_001/rss_001.spec @@ -0,0 +1,60 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2023 Intel Corporation + +// +// Headers +// +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<8> ver_ihl + bit<8> diffserv + bit<16> total_len + bit<16> identification + bit<16> flags_offset + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h + +// +// Meta-data. +// +struct metadata_t { + bit<32> port + bit<32> hash +} + +metadata instanceof metadata_t + +// +// RSS. +// +rss rss0 + +// +// Pipeline. +// +apply { + rx m.port + extract h.ethernet + extract h.ipv4 + + // Using header fields for RSS hash calculation + rss rss0 m.hash h.ipv4.src_addr h.ipv4.dst_addr + + and m.hash 3 + mov m.port m.hash + emit h.ethernet + emit h.ipv4 + tx m.port +} diff --git a/dep/pipeline/rss_002/ethdev.io b/dep/pipeline/rss_002/ethdev.io new file mode 100644 index 00000000..4e31f499 --- /dev/null +++ b/dep/pipeline/rss_002/ethdev.io @@ -0,0 +1,27 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline packet mirroring. +; +mirroring slots 4 sessions 64 + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ethdev 0000:00:05.0 rxq 0 bsz 1 +port in 2 ethdev 0000:00:06.0 rxq 0 bsz 1 +port in 3 ethdev 0000:00:07.0 rxq 0 bsz 1 + +; +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ethdev 0000:00:05.0 txq 0 bsz 1 +port out 2 ethdev 0000:00:06.0 txq 0 bsz 1 +port out 3 ethdev 0000:00:07.0 txq 0 bsz 1 diff --git a/dep/pipeline/rss_002/pcap_files/in_1.txt b/dep/pipeline/rss_002/pcap_files/in_1.txt new file mode 100644 index 00000000..af983df2 --- /dev/null +++ b/dep/pipeline/rss_002/pcap_files/in_1.txt @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 52 54 00 12 44 57 a4 bf 01 70 70 b0 08 00 45 00 +000010 00 34 00 01 00 00 40 11 78 b0 00 00 01 01 01 00 +000020 00 08 00 64 00 c8 00 20 d8 55 58 58 58 58 58 58 +000030 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 +000040 58 58 \ No newline at end of file diff --git a/dep/pipeline/rss_002/pcap_files/out_1.txt b/dep/pipeline/rss_002/pcap_files/out_1.txt new file mode 100644 index 00000000..6b4ef62d --- /dev/null +++ b/dep/pipeline/rss_002/pcap_files/out_1.txt @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 52 54 00 12 44 57 a4 bf 01 70 70 b0 08 00 45 00 +000010 00 34 00 01 00 00 40 11 78 b0 00 00 01 01 01 00 +000020 00 08 00 64 00 c8 00 20 d8 55 58 58 58 58 58 58 +000030 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 +000040 58 58 diff --git a/dep/pipeline/rss_002/readme.md b/dep/pipeline/rss_002/readme.md new file mode 100644 index 00000000..6193a4bb --- /dev/null +++ b/dep/pipeline/rss_002/readme.md @@ -0,0 +1,21 @@ + +Test Case: test_rss_002 +----------------------- + + Instruction being tested: + rss rss_obect_name m.field m.field m.field + + Scenario being tested: + To verify Receive Side Scaling (RSS) hash algorithm support + over an n-tuple set of fields read from the packet metadata + by using the "rss" instruction. + + Description: + Initially, the application is run without providing any RSS + key. Through, control plane, RSS key is provided and test + case expect the packet out on Port 0. The RSS key is changed + from control plane and for the similar packet we expect the + packet out on Port 2, as RSS computed hash changes. + + Verification: + Packet verification should happen according to the description. diff --git a/dep/pipeline/rss_002/rss_002.cli b/dep/pipeline/rss_002/rss_002.cli new file mode 100644 index 00000000..5b7136ef --- /dev/null +++ b/dep/pipeline/rss_002/rss_002.cli @@ -0,0 +1,20 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/rss_002/rss_002.spec /tmp/pipeline/rss_002/rss_002.c +pipeline libbuild /tmp/pipeline/rss_002/rss_002.c /tmp/pipeline/rss_002/rss_002.so + +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:05.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:06.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:07.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + + +pipeline PIPELINE0 build lib /tmp/pipeline/rss_002/rss_002.so io /tmp/pipeline/rss_002/ethdev.io numa 0 + +pipeline PIPELINE0 enable thread 1 diff --git a/dep/pipeline/rss_002/rss_002.spec b/dep/pipeline/rss_002/rss_002.spec new file mode 100644 index 00000000..4fd0ee89 --- /dev/null +++ b/dep/pipeline/rss_002/rss_002.spec @@ -0,0 +1,80 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2023 Intel Corporation + +// +// Headers +// +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<8> ver_ihl + bit<8> diffserv + bit<16> total_len + bit<16> identification + bit<16> flags_offset + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +struct udp_h { + bit<16> src_port + bit<16> dst_port + bit<16> length + bit<16> checksum +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h +header udp instanceof udp_h + +// +// Meta-data. +// +struct metadata_t { + bit<32> port + bit<32> hash + bit<8> ipv4_protocol + bit<32> ipv4_src_addr + bit<32> ipv4_dst_addr + bit<16> udp_src_port + bit<16> udp_dst_port +} + +metadata instanceof metadata_t + +// +// RSS. +// +rss rss0 + +// +// Pipeline. +// +apply { + rx m.port + extract h.ethernet + extract h.ipv4 + + // Collect packet fields for RSS hash compute + mov m.ipv4_protocol h.ipv4.protocol + mov m.ipv4_src_addr h.ipv4.src_addr + mov m.ipv4_dst_addr h.ipv4.dst_addr + mov m.udp_src_port h.udp.src_port + mov m.udp_dst_port h.udp.dst_port + + // Using metadata fields for RSS hash calculation + rss rss0 m.hash m.ipv4_protocol m.udp_dst_port + + and m.hash 3 + mov m.port m.hash + emit h.ethernet + emit h.ipv4 + tx m.port +} diff --git a/dep/pipeline/rss_003/cmd_files/cmd.txt b/dep/pipeline/rss_003/cmd_files/cmd.txt new file mode 100644 index 00000000..1f623c3c --- /dev/null +++ b/dep/pipeline/rss_003/cmd_files/cmd.txt @@ -0,0 +1 @@ +match 0x525400124457 action generate_rss diff --git a/dep/pipeline/rss_003/ethdev.io b/dep/pipeline/rss_003/ethdev.io new file mode 100644 index 00000000..4e31f499 --- /dev/null +++ b/dep/pipeline/rss_003/ethdev.io @@ -0,0 +1,27 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline packet mirroring. +; +mirroring slots 4 sessions 64 + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ethdev 0000:00:05.0 rxq 0 bsz 1 +port in 2 ethdev 0000:00:06.0 rxq 0 bsz 1 +port in 3 ethdev 0000:00:07.0 rxq 0 bsz 1 + +; +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ethdev 0000:00:05.0 txq 0 bsz 1 +port out 2 ethdev 0000:00:06.0 txq 0 bsz 1 +port out 3 ethdev 0000:00:07.0 txq 0 bsz 1 diff --git a/dep/pipeline/rss_003/pcap_files/in_1.txt b/dep/pipeline/rss_003/pcap_files/in_1.txt new file mode 100644 index 00000000..9679056e --- /dev/null +++ b/dep/pipeline/rss_003/pcap_files/in_1.txt @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 52 54 00 12 44 57 a4 bf 01 70 70 b0 08 00 45 00 +000010 00 34 00 01 00 00 40 11 78 b0 00 00 01 01 01 00 +000020 00 08 00 64 00 c8 00 20 d8 55 58 58 58 58 58 58 +000030 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 +000040 58 58 +# Packet 0 +000000 53 54 00 12 44 57 a4 bf 01 70 70 b0 08 00 45 00 +000010 00 34 00 01 00 00 40 11 78 b0 00 00 01 01 01 00 +000020 00 08 00 64 00 c8 00 20 d8 55 58 58 58 58 58 58 +000030 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 +000040 58 58 diff --git a/dep/pipeline/rss_003/pcap_files/out_1.txt b/dep/pipeline/rss_003/pcap_files/out_1.txt new file mode 100644 index 00000000..6b4ef62d --- /dev/null +++ b/dep/pipeline/rss_003/pcap_files/out_1.txt @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 52 54 00 12 44 57 a4 bf 01 70 70 b0 08 00 45 00 +000010 00 34 00 01 00 00 40 11 78 b0 00 00 01 01 01 00 +000020 00 08 00 64 00 c8 00 20 d8 55 58 58 58 58 58 58 +000030 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 +000040 58 58 diff --git a/dep/pipeline/rss_003/readme.md b/dep/pipeline/rss_003/readme.md new file mode 100644 index 00000000..63722078 --- /dev/null +++ b/dep/pipeline/rss_003/readme.md @@ -0,0 +1,21 @@ + +Test Case: test_rss_001 +----------------------- + + Instruction being tested: + rss rss_obect_name m.field h.field h.field + + Scenario being tested: + To verify Receive Side Scaling (RSS) hash algorithm support + over an n-tuple set of fields read from the packet headers + by using the "rss" instruction. + + Description: + Initially, the application is run without providing any RSS + key. Through, control plane, RSS key is provided and test + case expect the packet out on Port 0. The RSS key is changed + from control plane and for the similar packet we expect the + packet out on Port 1, as RSS computed hash changes. + + Verification: + Packet verification should happen according to the description. diff --git a/dep/pipeline/rss_003/rss_003.cli b/dep/pipeline/rss_003/rss_003.cli new file mode 100644 index 00000000..c0f34b19 --- /dev/null +++ b/dep/pipeline/rss_003/rss_003.cli @@ -0,0 +1,23 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/rss_003/rss_003.spec /tmp/pipeline/rss_003/rss_003.c +pipeline libbuild /tmp/pipeline/rss_003/rss_003.c /tmp/pipeline/rss_003/rss_003.so + +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:05.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:06.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:07.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + + +pipeline PIPELINE0 build lib /tmp/pipeline/rss_003/rss_003.so io /tmp/pipeline/rss_003/ethdev.io numa 0 + +pipeline PIPELINE0 table rss_table add /tmp/pipeline/rss_003/cmd_files/cmd.txt +pipeline PIPELINE0 commit + +pipeline PIPELINE0 enable thread 1 diff --git a/dep/pipeline/rss_003/rss_003.spec b/dep/pipeline/rss_003/rss_003.spec new file mode 100644 index 00000000..4ff5d50c --- /dev/null +++ b/dep/pipeline/rss_003/rss_003.spec @@ -0,0 +1,85 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2023 Intel Corporation + +// +// Headers +// +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<8> ver_ihl + bit<8> diffserv + bit<16> total_len + bit<16> identification + bit<16> flags_offset + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h + +// +// Meta-data. +// +struct metadata_t { + bit<32> port + bit<32> hash +} + +metadata instanceof metadata_t + +// +// RSS. +// +rss rss0 + +action generate_rss args none { + // Using header fields for RSS hash calculation + rss rss0 m.hash h.ipv4.src_addr h.ipv4.dst_addr + + and m.hash 3 + mov m.port m.hash + return + +} + +action drop args none { + drop +} + +table rss_table { + key { + h.ethernet.dst_addr exact + } + + actions { + generate_rss + drop + } + + default_action drop args none + size 1048576 +} + +// +// Pipeline. +// +apply { + rx m.port + extract h.ethernet + extract h.ipv4 + + table rss_table + + emit h.ethernet + emit h.ipv4 + tx m.port +} diff --git a/dep/pipeline/selector_002/selector_002.spec b/dep/pipeline/selector_002/selector_002.spec index 4858eaea..84b12272 100644 --- a/dep/pipeline/selector_002/selector_002.spec +++ b/dep/pipeline/selector_002/selector_002.spec @@ -58,10 +58,10 @@ struct selector_002_action_02_args_t { action selector_002_action_02 args instanceof selector_002_action_02_args_t { //Set Ethernet header. + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr mov h.ethernet.ethertype t.ethernet_ethertype - validate h.ethernet //Decrement the TTL and update the checksum within the IPv4 header. cksub h.ipv4.hdr_checksum h.ipv4.ttl diff --git a/dep/pipeline/selector_003/cmd_files/cmd_1.txt b/dep/pipeline/selector_003/cmd_files/cmd_1.txt new file mode 100644 index 00000000..f6680c94 --- /dev/null +++ b/dep/pipeline/selector_003/cmd_files/cmd_1.txt @@ -0,0 +1,4 @@ +match 0x3200000a action selector_003_action_01 nexthop_group_id 0 +match 0x6400000a action selector_003_action_01 nexthop_group_id 1 +match 0x9600000a action selector_003_action_01 nexthop_group_id 2 +match 0xC800000a action selector_003_action_01 nexthop_group_id 3 diff --git a/dep/pipeline/selector_003/cmd_files/cmd_2.txt b/dep/pipeline/selector_003/cmd_files/cmd_2.txt new file mode 100644 index 00000000..00028074 --- /dev/null +++ b/dep/pipeline/selector_003/cmd_files/cmd_2.txt @@ -0,0 +1,11 @@ +// Nexthop group #0 (Single member) +group 0 member 0 weight 1 + +// Nexthop group #1 (Single member) +group 1 member 1 weight 1 + +// Nexthop group #2 (Single member) +group 2 member 2 weight 1 + +// Nexthop group #3 (Single member) +group 3 member 3 weight 1 diff --git a/dep/pipeline/selector_003/cmd_files/cmd_3.txt b/dep/pipeline/selector_003/cmd_files/cmd_3.txt new file mode 100644 index 00000000..62f8b08c --- /dev/null +++ b/dep/pipeline/selector_003/cmd_files/cmd_3.txt @@ -0,0 +1,4 @@ +match 0 action selector_003_action_02 ethernet_dst_addr 0xaabbcc000000 ethernet_src_addr 0xddeeff000000 ethernet_ethertype 0x0800 port_out 0 +match 1 action selector_003_action_02 ethernet_dst_addr 0xaabbcc000001 ethernet_src_addr 0xddeeff000001 ethernet_ethertype 0x0800 port_out 1 +match 2 action selector_003_action_02 ethernet_dst_addr 0xaabbcc000002 ethernet_src_addr 0xddeeff000002 ethernet_ethertype 0x0800 port_out 2 +match 3 action selector_003_action_02 ethernet_dst_addr 0xaabbcc000003 ethernet_src_addr 0xddeeff000003 ethernet_ethertype 0x0800 port_out 3 diff --git a/dep/pipeline/selector_003/ethdev.io b/dep/pipeline/selector_003/ethdev.io new file mode 100644 index 00000000..4e31f499 --- /dev/null +++ b/dep/pipeline/selector_003/ethdev.io @@ -0,0 +1,27 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline packet mirroring. +; +mirroring slots 4 sessions 64 + +; +; Pipeline input ports. +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:00:04.0 rxq 0 bsz 1 +port in 1 ethdev 0000:00:05.0 rxq 0 bsz 1 +port in 2 ethdev 0000:00:06.0 rxq 0 bsz 1 +port in 3 ethdev 0000:00:07.0 rxq 0 bsz 1 + +; +; Pipeline output ports. +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:00:04.0 txq 0 bsz 1 +port out 1 ethdev 0000:00:05.0 txq 0 bsz 1 +port out 2 ethdev 0000:00:06.0 txq 0 bsz 1 +port out 3 ethdev 0000:00:07.0 txq 0 bsz 1 diff --git a/dep/pipeline/selector_003/pcap_files/in_1.txt b/dep/pipeline/selector_003/pcap_files/in_1.txt new file mode 100644 index 00000000..1a3485d4 --- /dev/null +++ b/dep/pipeline/selector_003/pcap_files/in_1.txt @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc dd 00 00 00 66 77 88 99 aa 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 48 c0 00 00 00 00 32 00 +000020 00 0a 00 64 00 c8 00 00 00 00 00 00 00 00 50 02 +000030 20 00 53 9e 00 00 58 58 58 58 58 58 +# Packet 1 +000000 aa bb cc dd 00 00 00 66 77 88 99 aa 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 16 c0 00 00 00 00 64 00 +000020 00 0a 00 64 00 c8 00 00 00 00 00 00 00 00 50 02 +000030 20 00 21 9e 00 00 58 58 58 58 58 58 +# Packet 2 +000000 aa bb cc dd 00 00 00 66 77 88 99 aa 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 e4 bf 00 00 00 00 96 00 +000020 00 0a 00 64 00 c8 00 00 00 00 00 00 00 00 50 02 +000030 20 00 ef 9d 00 00 58 58 58 58 58 58 +# Packet 3 +000000 aa bb cc dd 00 00 00 66 77 88 99 aa 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 b2 bf 00 00 00 00 c8 00 +000020 00 0a 00 64 00 c8 00 00 00 00 00 00 00 00 50 02 +000030 20 00 bd 9d 00 00 58 58 58 58 58 58 diff --git a/dep/pipeline/selector_003/pcap_files/out_1.txt b/dep/pipeline/selector_003/pcap_files/out_1.txt new file mode 100644 index 00000000..50d921e0 --- /dev/null +++ b/dep/pipeline/selector_003/pcap_files/out_1.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc 00 00 00 dd ee ff 00 00 00 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 48 c0 00 00 00 00 32 00 +000020 00 0a 00 64 00 c8 00 00 00 00 00 00 00 00 50 02 +000030 20 00 53 9e 00 00 58 58 58 58 58 58 diff --git a/dep/pipeline/selector_003/pcap_files/out_2.txt b/dep/pipeline/selector_003/pcap_files/out_2.txt new file mode 100644 index 00000000..a9cbfee0 --- /dev/null +++ b/dep/pipeline/selector_003/pcap_files/out_2.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc 00 00 01 dd ee ff 00 00 01 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 16 c0 00 00 00 00 64 00 +000020 00 0a 00 64 00 c8 00 00 00 00 00 00 00 00 50 02 +000030 20 00 21 9e 00 00 58 58 58 58 58 58 diff --git a/dep/pipeline/selector_003/pcap_files/out_3.txt b/dep/pipeline/selector_003/pcap_files/out_3.txt new file mode 100644 index 00000000..3e5590c5 --- /dev/null +++ b/dep/pipeline/selector_003/pcap_files/out_3.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc 00 00 02 dd ee ff 00 00 02 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 e4 bf 00 00 00 00 96 00 +000020 00 0a 00 64 00 c8 00 00 00 00 00 00 00 00 50 02 +000030 20 00 ef 9d 00 00 58 58 58 58 58 58 diff --git a/dep/pipeline/selector_003/pcap_files/out_4.txt b/dep/pipeline/selector_003/pcap_files/out_4.txt new file mode 100644 index 00000000..41d86426 --- /dev/null +++ b/dep/pipeline/selector_003/pcap_files/out_4.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation +# + +# text to pcap: text2pcap packet.txt packet.pcap +# pcap to text: tcpdump -r packet.pcap -xx + +# Packet 0 +000000 aa bb cc 00 00 03 dd ee ff 00 00 03 08 00 45 00 +000010 00 2e 00 01 00 00 40 06 b2 bf 00 00 00 00 c8 00 +000020 00 0a 00 64 00 c8 00 00 00 00 00 00 00 00 50 02 +000030 20 00 bd 9d 00 00 58 58 58 58 58 58 diff --git a/dep/pipeline/selector_003/readme.md b/dep/pipeline/selector_003/readme.md new file mode 100644 index 00000000..7752bee8 --- /dev/null +++ b/dep/pipeline/selector_003/readme.md @@ -0,0 +1,13 @@ + +Test Case: test_selector_003 +---------------------------- + +Instruction being tested: + selector (not power of 2 members and groups in a selector) + +Description: + In this testcase, We set limit for maximum no of group as 6553 and maximum no of members + per group as 80. +Verification: + We verified the action selector functionality, the action selector is working fine. + Packets are fowarded to the configured ports, and are updated as per expectation. diff --git a/dep/pipeline/selector_003/selector_003.cli b/dep/pipeline/selector_003/selector_003.cli new file mode 100644 index 00000000..7c46ec63 --- /dev/null +++ b/dep/pipeline/selector_003/selector_003.cli @@ -0,0 +1,29 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2010-2020 Intel Corporation + +; +; Pipeline code generation & shared object library build +; +pipeline codegen /tmp/pipeline/selector_003/selector_003.spec /tmp/pipeline/selector_003/selector_003.c +pipeline libbuild /tmp/pipeline/selector_003/selector_003.c /tmp/pipeline/selector_003/selector_003.so + +mempool MEMPOOL0 meta 128 pkt 9472 pool 32K cache 256 numa 0 + +ethdev 0000:00:04.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:05.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:06.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on +ethdev 0000:00:07.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on + + +pipeline PIPELINE0 build lib /tmp/pipeline/selector_003/selector_003.so io /tmp/pipeline/selector_003/ethdev.io numa 0 + +pipeline PIPELINE0 table selector_003_1_table add /tmp/pipeline/selector_003/cmd_files/cmd_1.txt +pipeline PIPELINE0 selector selector_003_2_table group add +pipeline PIPELINE0 selector selector_003_2_table group add +pipeline PIPELINE0 selector selector_003_2_table group add +pipeline PIPELINE0 selector selector_003_2_table group add +pipeline PIPELINE0 selector selector_003_2_table group member add /tmp/pipeline/selector_003/cmd_files/cmd_2.txt +pipeline PIPELINE0 table selector_003_3_table add /tmp/pipeline/selector_003/cmd_files/cmd_3.txt +pipeline PIPELINE0 commit + +pipeline PIPELINE0 enable thread 1 diff --git a/dep/pipeline/selector_003/selector_003.spec b/dep/pipeline/selector_003/selector_003.spec new file mode 100644 index 00000000..071a1492 --- /dev/null +++ b/dep/pipeline/selector_003/selector_003.spec @@ -0,0 +1,136 @@ +// +// Headers +// +struct ethernet_h { + bit<48> dst_addr + bit<48> src_addr + bit<16> ethertype +} + +struct ipv4_h { + bit<8> ver_ihl + bit<8> diffserv + bit<16> total_len + bit<16> identification + bit<16> flags_offset + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +header ethernet instanceof ethernet_h +header ipv4 instanceof ipv4_h + +// +// Meta-data +// +struct metadata_t { + bit<32> port_in + bit<32> port_out + bit<32> vrf_id + bit<32> dst_addr + bit<32> nexthop_group_id + bit<32> nexthop_id +} + +metadata instanceof metadata_t + +// +// Actions +// +struct selector_003_action_01_args_t { + bit<32> nexthop_group_id +} + +action selector_003_action_01 args instanceof selector_003_action_01_args_t { + mov m.nexthop_group_id t.nexthop_group_id + return +} + +struct selector_003_action_02_args_t { + bit<48> ethernet_dst_addr + bit<48> ethernet_src_addr + bit<16> ethernet_ethertype + bit<32> port_out +} + +action selector_003_action_02 args instanceof selector_003_action_02_args_t { + //Set Ethernet header. + validate h.ethernet + mov h.ethernet.dst_addr t.ethernet_dst_addr + mov h.ethernet.src_addr t.ethernet_src_addr + mov h.ethernet.ethertype t.ethernet_ethertype + mov m.port_out t.port_out + + return +} + +action drop args none { + drop +} + +// +// Tables +// +table selector_003_1_table { + key { + h.ipv4.dst_addr exact + } + + actions { + selector_003_action_01 + drop + } + + default_action drop args none + + size 1048576 +} + +selector selector_003_2_table { + group_id m.nexthop_group_id + + selector { + h.ipv4.protocol + h.ipv4.src_addr + h.ipv4.dst_addr + } + + member_id m.nexthop_id + + n_groups_max 6553 + + n_members_per_group_max 80 +} + +table selector_003_3_table { + key { + m.nexthop_id exact + } + + actions { + selector_003_action_02 + drop + } + + default_action drop args none + + size 1048576 +} + +// +// Pipeline +// +apply { + rx m.port_in + extract h.ethernet + extract h.ipv4 + table selector_003_1_table + table selector_003_2_table + table selector_003_3_table + emit h.ethernet + emit h.ipv4 + tx m.port_out +} diff --git a/dep/pipeline/table_002/table_002.spec b/dep/pipeline/table_002/table_002.spec index a352c662..7e0e3e7a 100644 --- a/dep/pipeline/table_002/table_002.spec +++ b/dep/pipeline/table_002/table_002.spec @@ -30,18 +30,19 @@ struct table_002_args_t { } action table_002_action_01 args instanceof table_002_args_t { + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr mov h.ethernet.ethertype t.ethernet_ethertype - validate h.ethernet + return } action table_002_action_02 args instanceof table_002_args_t { + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr mov h.ethernet.ethertype t.ethernet_ethertype - validate h.ethernet xor m.port 1 return } diff --git a/dep/pipeline/table_003/table_003.spec b/dep/pipeline/table_003/table_003.spec index 7691dbdb..6a0efef3 100644 --- a/dep/pipeline/table_003/table_003.spec +++ b/dep/pipeline/table_003/table_003.spec @@ -30,19 +30,19 @@ struct table_003_args_t { } action table_003_action_01 args instanceof table_003_args_t { + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr mov h.ethernet.ethertype t.ethernet_ethertype - validate h.ethernet - return + return } action table_003_action_02 args instanceof table_003_args_t { + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr mov h.ethernet.ethertype t.ethernet_ethertype - validate h.ethernet - xor m.port 1 + xor m.port 1 return } diff --git a/dep/pipeline/table_004/table_004.spec b/dep/pipeline/table_004/table_004.spec index 1e707c22..ed27e806 100644 --- a/dep/pipeline/table_004/table_004.spec +++ b/dep/pipeline/table_004/table_004.spec @@ -45,10 +45,10 @@ struct table_004_args_t { } action table_004_action args instanceof table_004_args_t { + validate h.ethernet mov h.ethernet.dst_addr t.ethernet_dst_addr mov h.ethernet.src_addr t.ethernet_src_addr mov h.ethernet.ethertype t.ethernet_ethertype - validate h.ethernet return } diff --git a/dep/pipeline/vxlan_001/vxlan_001.spec b/dep/pipeline/vxlan_001/vxlan_001.spec index f1ff67b4..0dc09b87 100755 --- a/dep/pipeline/vxlan_001/vxlan_001.spec +++ b/dep/pipeline/vxlan_001/vxlan_001.spec @@ -147,8 +147,8 @@ action vxlan_encap args instanceof vxlan_encap_args_t { mov h.outer_vxlan.vni t.vxlan_vni mov h.outer_vxlan.reserved2 t.vxlan_reserved2 - //Set the output port. - mov m.port_out t.port_out + //Set the output port. + mov m.port_out t.port_out //Update h.outer_ipv4.total_len field. add h.outer_ipv4.total_len h.ipv4.total_len -- 2.25.1