From 4005380cbaecb95de711ce50c41d6f6c24e97c46 Mon Sep 17 00:00:00 2001 From: maheswari-s Date: Mon, 23 Dec 2024 22:41:14 +0530 Subject: [PATCH] Added support for 128 bit constants usage in dpdk backend (#5074) Signed-off-by: Maheswari Subramanian --- backends/dpdk/DpdkXfail.cmake | 1 - backends/dpdk/dpdkArch.cpp | 17 +- backends/dpdk/dpdkHelpers.cpp | 73 +- backends/dpdk/dpdkHelpers.h | 3 + backends/dpdk/dpdkUtils.cpp | 14 +- backends/dpdk/spec.cpp | 2 +- .../dash-pipeline-pna-dpdk.p4 | 1237 ---------- .../psa-dpdk-128bitCast_error.p4 | 126 + .../psa-dpdk-128bitCast_error.p4-error | 3 + .../psa-dpdk-128bitCast_error.p4.bfrt.json | 39 + .../pna-dpdk-large-constants.p4 | 0 .../p4_16_samples/pna-dpdk_128bit_odd_size.p4 | 126 + testdata/p4_16_samples/pna-ipv6-actions.p4 | 33 +- .../dash}/dash-pipeline-pna-dpdk.p4-error | 7 - .../dash}/dash-pipeline-pna-dpdk.p4.bfrt.json | 0 .../dash/dash-pipeline-pna-dpdk.p4.spec | 2194 +++++++++++++++++ .../pna-direction-main-parser-err.p4.spec | 4 +- .../pna-dpdk-large-constants-first.p4 | 149 ++ .../pna-dpdk-large-constants-frontend.p4 | 148 ++ .../pna-dpdk-large-constants-midend.p4 | 164 ++ .../pna-dpdk-large-constants.p4 | 148 ++ .../pna-dpdk-large-constants.p4-error | 3 + .../pna-dpdk-large-constants.p4-stderr | 3 + .../pna-dpdk-large-constants.p4.bfrt.json | 187 ++ .../pna-dpdk-large-constants.p4.spec | 212 ++ .../pna-dpdk-parser-state-err.p4.spec | 10 +- .../pna-dpdk-parser-wrong-arith.p4.spec | 6 +- .../pna-dpdk_128bit_odd_size-first.p4 | 79 + .../pna-dpdk_128bit_odd_size-frontend.p4 | 81 + .../pna-dpdk_128bit_odd_size-midend.p4 | 89 + .../pna-dpdk_128bit_odd_size.p4 | 79 + .../pna-dpdk_128bit_odd_size.p4-error | 0 .../pna-dpdk_128bit_odd_size.p4-stderr | 0 .../pna-dpdk_128bit_odd_size.p4.bfrt.json | 69 + .../pna-dpdk_128bit_odd_size.p4.spec | 66 + .../pna-example-ipsec.p4.spec | 2 +- .../pna-example-pass-1.p4.spec | 2 +- .../pna-example-pass-2.p4.spec | 2 +- .../pna-example-pass-3.p4.spec | 4 +- .../pna-example-pass-parser.p4.spec | 8 +- .../pna-example-pass.p4.spec | 2 +- .../pna-example-recirculate.p4.spec | 2 +- .../pna-example-tunnel.p4.spec | 4 +- .../pna-example-varIndex-1.p4.spec | 18 +- .../pna-example-varIndex-2.p4.spec | 8 +- .../pna-example-varIndex.p4.spec | 14 +- .../pna-ipv6-actions-first.p4 | 21 + .../pna-ipv6-actions-frontend.p4 | 25 +- .../pna-ipv6-actions-midend.p4 | 35 +- .../p4_16_samples_outputs/pna-ipv6-actions.p4 | 21 + .../pna-ipv6-actions.p4-error | 2 +- .../pna-ipv6-actions.p4-stderr | 2 +- .../pna-ipv6-actions.p4.bfrt.json | 61 + .../pna-ipv6-actions.p4.spec | 88 +- .../pna-mux-dismantle.p4.spec | 14 +- .../psa-dpdk-128bitCast.p4.spec | 20 +- .../psa-dpdk-checksum-arg-header.p4.spec | 2 +- ...a-dpdk-table-entries-exact-ternary.p4.spec | 2 +- .../psa-example-dpdk-byte-alignment_1.p4.spec | 6 +- .../psa-example-dpdk-byte-alignment_2.p4.spec | 6 +- .../psa-example-dpdk-byte-alignment_3.p4.spec | 10 +- .../psa-example-dpdk-byte-alignment_5.p4.spec | 6 +- .../psa-example-dpdk-byte-alignment_6.p4.spec | 8 +- .../psa-example-dpdk-byte-alignment_7.p4.spec | 8 +- .../psa-example-dpdk-byte-alignment_8.p4.spec | 8 +- .../psa-example-dpdk-byte-alignment_9.p4.spec | 8 +- .../psa-example-dpdk-externs.p4.spec | 2 +- .../psa-example-dpdk-meter.p4.spec | 2 +- .../psa-example-dpdk-meter1.p4.spec | 2 +- .../psa-example-parser-checksum.p4.spec | 8 +- .../psa-register1.p4.spec | 2 +- .../psa-register2.p4.spec | 2 +- .../psa-register3.p4.spec | 2 +- .../psa-subtract-inst1.p4.spec | 26 +- .../psa-variable-index.p4.spec | 6 +- .../table-entries-priority-bmv2-first.p4 | 4 +- .../table-entries-priority-bmv2-frontend.p4 | 4 +- .../table-entries-priority-bmv2-midend.p4 | 4 +- .../table-entries-priority-bmv2.p4 | 4 +- 79 files changed, 4432 insertions(+), 1427 deletions(-) delete mode 100644 testdata/p4_16_dpdk_errors/dash-pipeline-pna-dpdk.p4 create mode 100644 testdata/p4_16_dpdk_errors/psa-dpdk-128bitCast_error.p4 create mode 100644 testdata/p4_16_dpdk_errors_outputs/psa-dpdk-128bitCast_error.p4-error create mode 100644 testdata/p4_16_dpdk_errors_outputs/psa-dpdk-128bitCast_error.p4.bfrt.json rename testdata/{p4_16_dpdk_errors => p4_16_samples}/pna-dpdk-large-constants.p4 (100%) create mode 100644 testdata/p4_16_samples/pna-dpdk_128bit_odd_size.p4 rename testdata/{p4_16_dpdk_errors_outputs => p4_16_samples_outputs/dash}/dash-pipeline-pna-dpdk.p4-error (91%) rename testdata/{p4_16_dpdk_errors_outputs => p4_16_samples_outputs/dash}/dash-pipeline-pna-dpdk.p4.bfrt.json (100%) create mode 100644 testdata/p4_16_samples_outputs/dash/dash-pipeline-pna-dpdk.p4.spec create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk-large-constants-first.p4 create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk-large-constants-frontend.p4 create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk-large-constants-midend.p4 create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4 create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4-error create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4-stderr create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4.bfrt.json create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4.spec create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-first.p4 create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-frontend.p4 create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-midend.p4 create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4 create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4-error create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4-stderr create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4.bfrt.json create mode 100644 testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4.spec diff --git a/backends/dpdk/DpdkXfail.cmake b/backends/dpdk/DpdkXfail.cmake index 9df082cf9ee..8fc1f992463 100644 --- a/backends/dpdk/DpdkXfail.cmake +++ b/backends/dpdk/DpdkXfail.cmake @@ -26,7 +26,6 @@ p4c_add_xfail_reason("dpdk" testdata/p4_16_samples/pna-dpdk-invalid-hdr-warnings5.p4 testdata/p4_16_samples/pna-dpdk-invalid-hdr-warnings6.p4 testdata/p4_16_samples/pna-dpdk-header-union-stack2.p4 - testdata/p4_16_samples/dash/dash-pipeline-pna-dpdk.p4 ) p4c_add_xfail_reason("dpdk" diff --git a/backends/dpdk/dpdkArch.cpp b/backends/dpdk/dpdkArch.cpp index e6ca7e0a0c7..e540e919b11 100644 --- a/backends/dpdk/dpdkArch.cpp +++ b/backends/dpdk/dpdkArch.cpp @@ -2957,6 +2957,14 @@ MoveNonHeaderFieldsToPseudoHeader::addAssignmentStmt(const IR::Expression *e) { const IR::Node *MoveNonHeaderFieldsToPseudoHeader::postorder(IR::AssignmentStatement *assn) { if (is_all_args_header) return assn; auto result = new IR::IndexedVector(); + if (isLargeFieldOperand(assn->left) && assn->right->is()) { + auto leftType = assn->left->type->to()->width_bits(); + auto rightType = assn->right->type->to()->width_bits(); + if (leftType == SupportedBitWidth && rightType == leftType) { + auto cst = assn->right->to(); + if (!cst->fitsUint64()) return assn; + } + } if ((isLargeFieldOperand(assn->left) && !isLargeFieldOperand(assn->right) && !isInsideHeader(assn->right)) || (isLargeFieldOperand(assn->left) && assn->right->is())) { @@ -2964,10 +2972,11 @@ const IR::Node *MoveNonHeaderFieldsToPseudoHeader::postorder(IR::AssignmentState if (auto base = assn->right->to()) expr = base->expr; if (auto cst = assn->right->to()) { if (!cst->fitsUint64()) { - ::P4::error( - ErrorType::ERR_OVERLIMIT, - "DPDK target supports up-to 64-bit immediate values, %1% exceeds the limit", - cst); + ::P4::error(ErrorType::ERR_OVERLIMIT, + "DPDK target supports constant values " + "that are up to 64-bits, and also exactly 128-bits, but no other " + "sizes. %1% is not a supported size", + cst); return assn; } } diff --git a/backends/dpdk/dpdkHelpers.cpp b/backends/dpdk/dpdkHelpers.cpp index 3d623a8c8c5..7be732c77b9 100644 --- a/backends/dpdk/dpdkHelpers.cpp +++ b/backends/dpdk/dpdkHelpers.cpp @@ -598,7 +598,7 @@ bool ConvertStatementToDpdk::preorder(const IR::AssignmentStatement *a) { "Negate operation is only supported on BIT types"); return false; } - if (n->expr->type->to()->width_bits() == 128) { + if (n->expr->type->to()->width_bits() == SupportedBitWidth) { add128bitComplInstr(left, n->expr); } else { BUG_CHECK(metadataStruct, "Metadata structure missing unexpectedly!"); @@ -632,7 +632,12 @@ bool ConvertStatementToDpdk::preorder(const IR::AssignmentStatement *a) { } } else if (right->is() || right->is() || right->is() || right->is()) { - i = new IR::DpdkMovStatement(a->left, a->right); + if (right->is() && + right->type->to()->width_bits() == SupportedBitWidth) { + add128bitMovInstr(left, right); + } else { + i = new IR::DpdkMovStatement(left, right); + } } else { std::cerr << right->node_type_name() << std::endl; BUG("Not implemented."); @@ -1506,9 +1511,9 @@ bool ConvertStatementToDpdk::preorder(const IR::SwitchStatement *s) { bool ConvertStatementToDpdk::checkIf128bitOp(const IR::Expression *src1Op, const IR::Expression *src2Op) { if (auto src1Type = src1Op->type->to()) { - if (src1Type->width_bits() == 128) { + if (src1Type->width_bits() == SupportedBitWidth) { if (auto src2Type = src2Op->type->to()) { - if (src2Type->width_bits() == 128) return true; + if (src2Type->width_bits() == SupportedBitWidth) return true; } } } @@ -1559,22 +1564,25 @@ void ConvertStatementToDpdk::add128bitwiseInstr(const IR::Expression *src1Op, add_instr(new IR::DpdkMovhStatement(src1OpUpper, src1Op)); add_instr(new IR::DpdkMovStatement(src1OpLower, src1Op)); if (src2Op->is()) { + auto ConstVal = src2Op->to()->value; + auto upperConst = new IR::Constant(ConstVal >> 64); + auto lowerConst = new IR::Constant(ConstVal & 0xFFFFFFFFFFFFFFFF); add_instr(new IR::DpdkMovStatement(tmp, src1OpLower)); if (strcmp(op, "xor") == 0) { - add_instr(new IR::DpdkXorStatement(tmp, tmp, src2Op)); + add_instr(new IR::DpdkXorStatement(tmp, tmp, lowerConst)); } else if (strcmp(op, "or") == 0) { - add_instr(new IR::DpdkOrStatement(tmp, tmp, src2Op)); + add_instr(new IR::DpdkOrStatement(tmp, tmp, lowerConst)); } else if (strcmp(op, "and") == 0) { - add_instr(new IR::DpdkAndStatement(tmp, tmp, src2Op)); + add_instr(new IR::DpdkAndStatement(tmp, tmp, lowerConst)); } add_instr(new IR::DpdkMovStatement(src1Op, tmp)); add_instr(new IR::DpdkMovStatement(tmp, src1OpUpper)); if (strcmp(op, "xor") == 0) { - add_instr(new IR::DpdkXorStatement(tmp, tmp, src2Op)); + add_instr(new IR::DpdkXorStatement(tmp, tmp, upperConst)); } else if (strcmp(op, "or") == 0) { - add_instr(new IR::DpdkOrStatement(tmp, tmp, src2Op)); + add_instr(new IR::DpdkOrStatement(tmp, tmp, upperConst)); } else if (strcmp(op, "and") == 0) { - add_instr(new IR::DpdkAndStatement(tmp, tmp, src2Op)); + add_instr(new IR::DpdkAndStatement(tmp, tmp, upperConst)); } add_instr(new IR::DpdkMovhStatement(src1Op, tmp)); } else { @@ -1624,7 +1632,7 @@ void ConvertStatementToDpdk::createSandboxHeader() { void ConvertStatementToDpdk::createTmpVarForSandbox() { auto fields = new IR::IndexedVector; - fields->push_back(new IR::StructField("tmp", IR::Type_Bits::get(64))); + fields->push_back(new IR::StructField("inter", IR::Type_Bits::get(64))); const IR::Type_Header *headerStruct = new IR::Type_Header(IR::ID("_p4c_tmp128_t"), *fields); structure->header_types.emplace(cstring("_p4c_tmp128_t"), headerStruct); } @@ -1659,8 +1667,11 @@ void ConvertStatementToDpdk::add128ComparisonInstr(cstring true_label, const IR: add_instr(new IR::DpdkMovhStatement(src1OpUpper, src1Op)); add_instr(new IR::DpdkMovStatement(src1OpLower, src1Op)); if (src2Op->is()) { - add_instr(new IR::DpdkXorStatement(src1OpUpper, src1OpUpper, src2Op)); - add_instr(new IR::DpdkXorStatement(src1OpLower, src1OpLower, src2Op)); + auto ConstVal = src2Op->to()->value; + auto upperConst = new IR::Constant(ConstVal >> 64); + auto lowerConst = new IR::Constant(ConstVal & 0xFFFFFFFFFFFFFFFF); + add_instr(new IR::DpdkXorStatement(src1OpUpper, src1OpUpper, upperConst)); + add_instr(new IR::DpdkXorStatement(src1OpLower, src1OpLower, lowerConst)); } else { auto src2OpHeaderName = src2Op->toString(); if (src2Op->is()) { @@ -1734,4 +1745,40 @@ void ConvertStatementToDpdk::add128bitComplInstr(const IR::Expression *dst, add_instr(new IR::DpdkMovStatement(dst, src1OpLower)); add_instr(new IR::DpdkMovhStatement(dst, src1OpUpper)); } + +void ConvertStatementToDpdk::add128bitMovInstr(const IR::Expression *left, + const IR::Expression *right) { + if (!createSandboxHeaderType) { + createSandboxHeaderType = true; + createSandboxHeader(); + } + const IR::Type_Header *Type_Header = nullptr; + for (auto header : structure->header_types) { + if (header.first == "_p4c_sandbox_header_t") { + Type_Header = header.second; + } + } + if (Type_Header == nullptr) { + BUG("Header type not found"); + } + auto leftHeaderName = left->toString(); + if (left->is()) { + leftHeaderName = left->to()->member.name; + } + leftHeaderName = leftHeaderName + "_128"; + auto leftHeader = new IR::Declaration_Variable(leftHeaderName, Type_Header); + auto leftHeaderInstance = new IR::DpdkHeaderInstance(leftHeader, Type_Header); + structure->addHeaderInstances(leftHeaderInstance); + auto leftUpper = + new IR::Member(new IR::PathExpression("h." + leftHeader->name), IR::ID("upper_half")); + auto leftLower = + new IR::Member(new IR::PathExpression("h." + leftHeader->name), IR::ID("lower_half")); + auto ConstVal = right->to()->value; + auto upperConst = new IR::Constant(ConstVal >> 64); + auto lowerConst = new IR::Constant(ConstVal & 0xFFFFFFFFFFFFFFFF); + add_instr(new IR::DpdkMovStatement(leftUpper, upperConst)); + add_instr(new IR::DpdkMovStatement(leftLower, lowerConst)); + add_instr(new IR::DpdkMovStatement(left, leftLower)); + add_instr(new IR::DpdkMovhStatement(left, leftUpper)); +} } // namespace P4::DPDK diff --git a/backends/dpdk/dpdkHelpers.h b/backends/dpdk/dpdkHelpers.h index 7e9979179b3..6f76f912a23 100644 --- a/backends/dpdk/dpdkHelpers.h +++ b/backends/dpdk/dpdkHelpers.h @@ -37,6 +37,8 @@ limitations under the License. namespace P4::DPDK { +static const int SupportedBitWidth = 128; + class ConvertStatementToDpdk; /// @brief Name of the metadata used as output port. @@ -199,6 +201,7 @@ class ConvertStatementToDpdk : public Inspector { void add128ComparisonInstr(cstring true_label, const IR::Expression *src1Op, const IR::Expression *src2Op, const char *op); void add128bitComplInstr(const IR::Expression *, const IR::Expression *); + void add128bitMovInstr(const IR::Expression *left, const IR::Expression *right); }; /// Only simplify complex expression in ingress/egress. class ProcessControls : public P4::RemoveComplexExpressionsPolicy { diff --git a/backends/dpdk/dpdkUtils.cpp b/backends/dpdk/dpdkUtils.cpp index 115ed5dc6ea..9f8bcc5f517 100644 --- a/backends/dpdk/dpdkUtils.cpp +++ b/backends/dpdk/dpdkUtils.cpp @@ -151,15 +151,13 @@ bool reservedNames(P4::ReferenceMap *refMap, const std::vector &names, return true; } -/// Update bitwidth of Metadata fields to 32 or 64 bits if it 8-bit aligned. +/// The DPDK pipeline requirement is all header/metadata fields to be multiple of 8bits. +/// There is no limitation on total bit width. This function allows any bit width but +/// if the width is odd size, then nearest multiple of 8bit value is returned. int getMetadataFieldWidth(int width) { - if (width % 8 != 0) { - BUG_CHECK(width <= 64, "Metadata bit-width expected to be within 64-bits, found %1%", - width); - if (width < 32) - return 32; - else - return 64; + if ((width & 0x7) != 0) { + auto resize = (width + 7) & 0xFFFFFFF8; + return resize; } return width; } diff --git a/backends/dpdk/spec.cpp b/backends/dpdk/spec.cpp index bde9c0b56c9..6aee664891b 100644 --- a/backends/dpdk/spec.cpp +++ b/backends/dpdk/spec.cpp @@ -219,7 +219,7 @@ std::ostream &IR::DpdkHeaderType::toSpec(std::ostream &out) const { } std::ostream &IR::DpdkHeaderInstance::toSpec(std::ostream &out) const { - out << "header " << name->toString() << " instanceof " << headerType->toString(); + out << "header " << name->toString() << " instanceof " << headerType->name.name; return out; } diff --git a/testdata/p4_16_dpdk_errors/dash-pipeline-pna-dpdk.p4 b/testdata/p4_16_dpdk_errors/dash-pipeline-pna-dpdk.p4 deleted file mode 100644 index 93c0db4ff6b..00000000000 --- a/testdata/p4_16_dpdk_errors/dash-pipeline-pna-dpdk.p4 +++ /dev/null @@ -1,1237 +0,0 @@ -error { - IPv4IncorrectVersion, - IPv4OptionsNotSupported, - InvalidIPv4Header -} -#include -#include - -typedef bit<48> EthernetAddress; -typedef bit<32> IPv4Address; -typedef bit<128> IPv6Address; -typedef bit<128> IPv4ORv6Address; -header ethernet_t { - EthernetAddress dst_addr; - EthernetAddress src_addr; - bit<16> ether_type; -} - -const bit<16> ETHER_HDR_SIZE = 112 / 8; -header ipv4_t { - bit<4> version; - bit<4> ihl; - bit<8> diffserv; - bit<16> total_len; - bit<16> identification; - bit<3> flags; - bit<13> frag_offset; - bit<8> ttl; - bit<8> protocol; - bit<16> hdr_checksum; - IPv4Address src_addr; - IPv4Address dst_addr; -} - -const bit<16> IPV4_HDR_SIZE = 160 / 8; -header ipv4options_t { - varbit<320> options; -} - -header udp_t { - bit<16> src_port; - bit<16> dst_port; - bit<16> length; - bit<16> checksum; -} - -const bit<16> UDP_HDR_SIZE = 64 / 8; -header vxlan_t { - bit<8> flags; - bit<24> reserved; - bit<24> vni; - bit<8> reserved_2; -} - -const bit<16> VXLAN_HDR_SIZE = 64 / 8; -header nvgre_t { - bit<4> flags; - bit<9> reserved; - bit<3> version; - bit<16> protocol_type; - bit<24> vsid; - bit<8> flow_id; -} - -const bit<16> NVGRE_HDR_SIZE = 64 / 8; -header tcp_t { - bit<16> src_port; - bit<16> dst_port; - bit<32> seq_no; - bit<32> ack_no; - bit<4> data_offset; - bit<3> res; - bit<3> ecn; - bit<6> flags; - bit<16> window; - bit<16> checksum; - bit<16> urgent_ptr; -} - -const bit<16> TCP_HDR_SIZE = 160 / 8; -header ipv6_t { - bit<4> version; - bit<8> traffic_class; - bit<20> flow_label; - bit<16> payload_length; - bit<8> next_header; - bit<8> hop_limit; - IPv6Address src_addr; - IPv6Address dst_addr; -} - -const bit<16> IPV6_HDR_SIZE = 320 / 8; -struct headers_t { - ethernet_t u1_ethernet; - ipv4_t u1_ipv4; - ipv4options_t u1_ipv4options; - ipv6_t u1_ipv6; - udp_t u1_udp; - tcp_t u1_tcp; - vxlan_t u1_vxlan; - nvgre_t u1_nvgre; - ethernet_t u0_ethernet; - ipv4_t u0_ipv4; - ipv4options_t u0_ipv4options; - ipv6_t u0_ipv6; - udp_t u0_udp; - tcp_t u0_tcp; - vxlan_t u0_vxlan; - nvgre_t u0_nvgre; - ethernet_t customer_ethernet; - ipv4_t customer_ipv4; - ipv6_t customer_ipv6; - udp_t customer_udp; - tcp_t customer_tcp; -} - -enum bit<16> dash_encapsulation_t { - INVALID = 0, - VXLAN = 1, - NVGRE = 2 -} - -enum bit<32> dash_routing_actions_t { - NONE = 0, - STATIC_ENCAP = 1 << 0, - NAT46 = 1 << 1, - NAT64 = 1 << 2 -} - -enum bit<16> dash_direction_t { - INVALID = 0, - OUTBOUND = 1, - INBOUND = 2 -} - -enum bit<16> dash_pipeline_stage_t { - INVALID = 0, - INBOUND_STAGE_START = 100, - OUTBOUND_STAGE_START = 200, - OUTBOUND_ROUTING = 200, - OUTBOUND_MAPPING = 201, - ROUTING_ACTION_APPLY = 300 -} - -struct conntrack_data_t { - bool allow_in; - bool allow_out; -} - -enum bit<16> dash_tunnel_dscp_mode_t { - PRESERVE_MODEL = 0, - PIPE_MODEL = 1 -} - -struct eni_data_t { - bit<32> cps; - bit<32> pps; - bit<32> flows; - bit<1> admin_state; - IPv6Address pl_sip; - IPv6Address pl_sip_mask; - IPv4Address pl_underlay_sip; - bit<6> dscp; - dash_tunnel_dscp_mode_t dscp_mode; -} - -struct encap_data_t { - bit<24> vni; - bit<24> dest_vnet_vni; - IPv4Address underlay_sip; - IPv4Address underlay_dip; - EthernetAddress underlay_smac; - EthernetAddress underlay_dmac; - dash_encapsulation_t dash_encapsulation; -} - -struct overlay_rewrite_data_t { - bool is_ipv6; - EthernetAddress dmac; - IPv4ORv6Address sip; - IPv4ORv6Address dip; - IPv6Address sip_mask; - IPv6Address dip_mask; -} - -struct metadata_t { - dash_direction_t direction; - EthernetAddress eni_addr; - bit<16> vnet_id; - bit<16> dst_vnet_id; - bit<16> eni_id; - eni_data_t eni_data; - bit<16> inbound_vm_id; - bit<8> appliance_id; - bit<1> is_overlay_ip_v6; - bit<1> is_lkup_dst_ip_v6; - bit<8> ip_protocol; - IPv4ORv6Address dst_ip_addr; - IPv4ORv6Address src_ip_addr; - IPv4ORv6Address lkup_dst_ip_addr; - conntrack_data_t conntrack_data; - bit<16> src_l4_port; - bit<16> dst_l4_port; - bit<16> stage1_dash_acl_group_id; - bit<16> stage2_dash_acl_group_id; - bit<16> stage3_dash_acl_group_id; - bit<16> stage4_dash_acl_group_id; - bit<16> stage5_dash_acl_group_id; - bit<1> meter_policy_en; - bit<1> mapping_meter_class_override; - bit<16> meter_policy_id; - bit<16> policy_meter_class; - bit<16> route_meter_class; - bit<16> mapping_meter_class; - bit<16> meter_class; - bit<32> meter_bucket_index; - bit<16> tunnel_pointer; - bool is_fast_path_icmp_flow_redirection_packet; - bit<1> fast_path_icmp_flow_redirection_disabled; - dash_pipeline_stage_t target_stage; - bit<32> routing_actions; - bool dropped; - encap_data_t encap_data; - overlay_rewrite_data_t overlay_data; -} - -parser dash_parser(packet_in packet, out headers_t hd, inout metadata_t meta, in pna_main_parser_input_metadata_t istd) { - state start { - packet.extract(hd.u0_ethernet); - transition select(hd.u0_ethernet.ether_type) { - 0x800: parse_u0_ipv4; - 0x86dd: parse_u0_ipv6; - default: accept; - } - } - state parse_u0_ipv4 { - packet.extract(hd.u0_ipv4); - verify(hd.u0_ipv4.version == 4w4, error.IPv4IncorrectVersion); - verify(hd.u0_ipv4.ihl >= 5, error.InvalidIPv4Header); - transition select(hd.u0_ipv4.ihl) { - 5: dispatch_on_u0_protocol; - default: parse_u0_ipv4options; - } - } - state parse_u0_ipv4options { - packet.extract(hd.u0_ipv4options, (bit<32>)(((bit<16>)hd.u0_ipv4.ihl - 5) * 32)); - transition dispatch_on_u0_protocol; - } - state dispatch_on_u0_protocol { - transition select(hd.u0_ipv4.protocol) { - 17: parse_u0_udp; - 6: parse_u0_tcp; - default: accept; - } - } - state parse_u0_ipv6 { - packet.extract(hd.u0_ipv6); - transition select(hd.u0_ipv6.next_header) { - 17: parse_u0_udp; - 6: parse_u0_tcp; - default: accept; - } - } - state parse_u0_udp { - packet.extract(hd.u0_udp); - transition select(hd.u0_udp.dst_port) { - 4789: parse_u0_vxlan; - default: accept; - } - } - state parse_u0_tcp { - packet.extract(hd.u0_tcp); - transition accept; - } - state parse_u0_vxlan { - packet.extract(hd.u0_vxlan); - transition parse_customer_ethernet; - } - state parse_customer_ethernet { - packet.extract(hd.customer_ethernet); - transition select(hd.customer_ethernet.ether_type) { - 0x800: parse_customer_ipv4; - 0x86dd: parse_customer_ipv6; - default: accept; - } - } - state parse_customer_ipv4 { - packet.extract(hd.customer_ipv4); - verify(hd.customer_ipv4.version == 4w4, error.IPv4IncorrectVersion); - verify(hd.customer_ipv4.ihl == 4w5, error.IPv4OptionsNotSupported); - transition select(hd.customer_ipv4.protocol) { - 17: parse_customer_udp; - 6: parse_customer_tcp; - default: accept; - } - } - state parse_customer_ipv6 { - packet.extract(hd.customer_ipv6); - transition select(hd.customer_ipv6.next_header) { - 17: parse_customer_udp; - 6: parse_customer_tcp; - default: accept; - } - } - state parse_customer_tcp { - packet.extract(hd.customer_tcp); - transition accept; - } - state parse_customer_udp { - packet.extract(hd.customer_udp); - transition accept; - } -} - -control dash_deparser(packet_out packet, in headers_t hdr, in metadata_t meta, in pna_main_output_metadata_t ostd) { - apply { - packet.emit(hdr.u0_ethernet); - packet.emit(hdr.u0_ipv4); - packet.emit(hdr.u0_ipv4options); - packet.emit(hdr.u0_ipv6); - packet.emit(hdr.u0_udp); - packet.emit(hdr.u0_tcp); - packet.emit(hdr.u0_vxlan); - packet.emit(hdr.u0_nvgre); - packet.emit(hdr.customer_ethernet); - packet.emit(hdr.customer_ipv4); - packet.emit(hdr.customer_ipv6); - packet.emit(hdr.customer_tcp); - packet.emit(hdr.customer_udp); - } -} - -action push_vxlan_tunnel_u0(inout headers_t hdr, in EthernetAddress overlay_dmac, in EthernetAddress underlay_dmac, in EthernetAddress underlay_smac, in IPv4Address underlay_dip, in IPv4Address underlay_sip, in bit<24> tunnel_key) { - hdr.customer_ethernet.dst_addr = overlay_dmac; - hdr.u0_ethernet.setValid(); - hdr.u0_ethernet.dst_addr = underlay_dmac; - hdr.u0_ethernet.src_addr = underlay_smac; - hdr.u0_ethernet.ether_type = 0x800; - hdr.u0_ipv4.setValid(); - bit<16> customer_ip_len = 0; - if (hdr.customer_ipv4.isValid()) { - customer_ip_len = customer_ip_len + hdr.customer_ipv4.total_len; - } - if (hdr.customer_ipv6.isValid()) { - customer_ip_len = customer_ip_len + IPV6_HDR_SIZE + hdr.customer_ipv6.payload_length; - } - hdr.u0_ipv4.total_len = ETHER_HDR_SIZE + IPV4_HDR_SIZE + UDP_HDR_SIZE + VXLAN_HDR_SIZE + customer_ip_len; - hdr.u0_ipv4.version = 4; - hdr.u0_ipv4.ihl = 5; - hdr.u0_ipv4.diffserv = 0; - hdr.u0_ipv4.identification = 1; - hdr.u0_ipv4.flags = 0; - hdr.u0_ipv4.frag_offset = 0; - hdr.u0_ipv4.ttl = 64; - hdr.u0_ipv4.protocol = 17; - hdr.u0_ipv4.dst_addr = underlay_dip; - hdr.u0_ipv4.src_addr = underlay_sip; - hdr.u0_ipv4.hdr_checksum = 0; - hdr.u0_udp.setValid(); - hdr.u0_udp.src_port = 0; - hdr.u0_udp.dst_port = 4789; - hdr.u0_udp.length = UDP_HDR_SIZE + VXLAN_HDR_SIZE + ETHER_HDR_SIZE + customer_ip_len; - hdr.u0_udp.checksum = 0; - hdr.u0_vxlan.setValid(); - hdr.u0_vxlan.reserved = 0; - hdr.u0_vxlan.reserved_2 = 0; - hdr.u0_vxlan.flags = 0; - hdr.u0_vxlan.vni = tunnel_key; -} -action push_vxlan_tunnel_u1(inout headers_t hdr, in EthernetAddress overlay_dmac, in EthernetAddress underlay_dmac, in EthernetAddress underlay_smac, in IPv4Address underlay_dip, in IPv4Address underlay_sip, in bit<24> tunnel_key) { - hdr.u0_ethernet.dst_addr = overlay_dmac; - hdr.u1_ethernet.setValid(); - hdr.u1_ethernet.dst_addr = underlay_dmac; - hdr.u1_ethernet.src_addr = underlay_smac; - hdr.u1_ethernet.ether_type = 0x800; - hdr.u1_ipv4.setValid(); - bit<16> u0_ip_len = 0; - if (hdr.u0_ipv4.isValid()) { - u0_ip_len = u0_ip_len + hdr.u0_ipv4.total_len; - } - if (hdr.u0_ipv6.isValid()) { - u0_ip_len = u0_ip_len + IPV6_HDR_SIZE + hdr.u0_ipv6.payload_length; - } - hdr.u1_ipv4.total_len = ETHER_HDR_SIZE + IPV4_HDR_SIZE + UDP_HDR_SIZE + VXLAN_HDR_SIZE + u0_ip_len; - hdr.u1_ipv4.version = 4; - hdr.u1_ipv4.ihl = 5; - hdr.u1_ipv4.diffserv = 0; - hdr.u1_ipv4.identification = 1; - hdr.u1_ipv4.flags = 0; - hdr.u1_ipv4.frag_offset = 0; - hdr.u1_ipv4.ttl = 64; - hdr.u1_ipv4.protocol = 17; - hdr.u1_ipv4.dst_addr = underlay_dip; - hdr.u1_ipv4.src_addr = underlay_sip; - hdr.u1_ipv4.hdr_checksum = 0; - hdr.u1_udp.setValid(); - hdr.u1_udp.src_port = 0; - hdr.u1_udp.dst_port = 4789; - hdr.u1_udp.length = UDP_HDR_SIZE + VXLAN_HDR_SIZE + ETHER_HDR_SIZE + u0_ip_len; - hdr.u1_udp.checksum = 0; - hdr.u1_vxlan.setValid(); - hdr.u1_vxlan.reserved = 0; - hdr.u1_vxlan.reserved_2 = 0; - hdr.u1_vxlan.flags = 0; - hdr.u1_vxlan.vni = tunnel_key; -} -action push_nvgre_tunnel_u0(inout headers_t hdr, in EthernetAddress overlay_dmac, in EthernetAddress underlay_dmac, in EthernetAddress underlay_smac, in IPv4Address underlay_dip, in IPv4Address underlay_sip, in bit<24> tunnel_key) { - hdr.customer_ethernet.dst_addr = overlay_dmac; - hdr.u0_ethernet.setValid(); - hdr.u0_ethernet.dst_addr = underlay_dmac; - hdr.u0_ethernet.src_addr = underlay_smac; - hdr.u0_ethernet.ether_type = 0x800; - hdr.u0_ipv4.setValid(); - bit<16> customer_ip_len = 0; - if (hdr.customer_ipv4.isValid()) { - customer_ip_len = customer_ip_len + hdr.customer_ipv4.total_len; - } - if (hdr.customer_ipv6.isValid()) { - customer_ip_len = customer_ip_len + IPV6_HDR_SIZE + hdr.customer_ipv6.payload_length; - } - hdr.u0_ipv4.total_len = ETHER_HDR_SIZE + IPV4_HDR_SIZE + UDP_HDR_SIZE + NVGRE_HDR_SIZE + customer_ip_len; - hdr.u0_ipv4.total_len = ETHER_HDR_SIZE + IPV4_HDR_SIZE + NVGRE_HDR_SIZE + hdr.u0_ipv4.total_len; - hdr.u0_ipv4.version = 4; - hdr.u0_ipv4.ihl = 5; - hdr.u0_ipv4.diffserv = 0; - hdr.u0_ipv4.identification = 1; - hdr.u0_ipv4.flags = 0; - hdr.u0_ipv4.frag_offset = 0; - hdr.u0_ipv4.ttl = 64; - hdr.u0_ipv4.protocol = 0x2f; - hdr.u0_ipv4.dst_addr = underlay_dip; - hdr.u0_ipv4.src_addr = underlay_sip; - hdr.u0_ipv4.hdr_checksum = 0; - hdr.u0_nvgre.setValid(); - hdr.u0_nvgre.flags = 4; - hdr.u0_nvgre.reserved = 0; - hdr.u0_nvgre.version = 0; - hdr.u0_nvgre.protocol_type = 0x6558; - hdr.u0_nvgre.vsid = tunnel_key; - hdr.u0_nvgre.flow_id = 0; -} -action push_nvgre_tunnel_u1(inout headers_t hdr, in EthernetAddress overlay_dmac, in EthernetAddress underlay_dmac, in EthernetAddress underlay_smac, in IPv4Address underlay_dip, in IPv4Address underlay_sip, in bit<24> tunnel_key) { - hdr.u0_ethernet.dst_addr = overlay_dmac; - hdr.u1_ethernet.setValid(); - hdr.u1_ethernet.dst_addr = underlay_dmac; - hdr.u1_ethernet.src_addr = underlay_smac; - hdr.u1_ethernet.ether_type = 0x800; - hdr.u1_ipv4.setValid(); - bit<16> u0_ip_len = 0; - if (hdr.u0_ipv4.isValid()) { - u0_ip_len = u0_ip_len + hdr.u0_ipv4.total_len; - } - if (hdr.u0_ipv6.isValid()) { - u0_ip_len = u0_ip_len + IPV6_HDR_SIZE + hdr.u0_ipv6.payload_length; - } - hdr.u1_ipv4.total_len = ETHER_HDR_SIZE + IPV4_HDR_SIZE + UDP_HDR_SIZE + NVGRE_HDR_SIZE + u0_ip_len; - hdr.u1_ipv4.total_len = ETHER_HDR_SIZE + IPV4_HDR_SIZE + NVGRE_HDR_SIZE + hdr.u1_ipv4.total_len; - hdr.u1_ipv4.version = 4; - hdr.u1_ipv4.ihl = 5; - hdr.u1_ipv4.diffserv = 0; - hdr.u1_ipv4.identification = 1; - hdr.u1_ipv4.flags = 0; - hdr.u1_ipv4.frag_offset = 0; - hdr.u1_ipv4.ttl = 64; - hdr.u1_ipv4.protocol = 0x2f; - hdr.u1_ipv4.dst_addr = underlay_dip; - hdr.u1_ipv4.src_addr = underlay_sip; - hdr.u1_ipv4.hdr_checksum = 0; - hdr.u1_nvgre.setValid(); - hdr.u1_nvgre.flags = 4; - hdr.u1_nvgre.reserved = 0; - hdr.u1_nvgre.version = 0; - hdr.u1_nvgre.protocol_type = 0x6558; - hdr.u1_nvgre.vsid = tunnel_key; - hdr.u1_nvgre.flow_id = 0; -} -action tunnel_decap(inout headers_t hdr, inout metadata_t meta) { - hdr.u0_ethernet.setInvalid(); - hdr.u0_ipv4.setInvalid(); - hdr.u0_ipv6.setInvalid(); - hdr.u0_nvgre.setInvalid(); - hdr.u0_vxlan.setInvalid(); - hdr.u0_udp.setInvalid(); - meta.tunnel_pointer = 0; -} -match_kind { - list, - range_list -} - -control acl(inout headers_t hdr, inout metadata_t meta) { - action permit() { - } - action permit_and_continue() { - } - action deny() { - meta.dropped = true; - } - action deny_and_continue() { - meta.dropped = true; - } - @SaiTable[name="dash_acl_rule", stage="acl.stage1", api="dash_acl", isobject="true"] table stage1 { - key = { - meta.stage1_dash_acl_group_id: exact @SaiVal[name="dash_acl_group_id"]; - meta.dst_ip_addr : ternary @SaiVal[name="dip", type="sai_ip_prefix_list_t"]; - meta.src_ip_addr : ternary @SaiVal[name="sip", type="sai_ip_prefix_list_t"]; - meta.ip_protocol : ternary @SaiVal[name="protocol", type="sai_u8_list_t"]; - meta.src_l4_port : range @SaiVal[name="src_port", type="sai_u16_range_list_t"]; - meta.dst_l4_port : range @SaiVal[name="dst_port", type="sai_u16_range_list_t"]; - } - actions = { - permit; - permit_and_continue; - deny; - deny_and_continue; - } - default_action = deny; - } - @SaiTable[name="dash_acl_rule", stage="acl.stage2", api="dash_acl", isobject="true"] table stage2 { - key = { - meta.stage2_dash_acl_group_id: exact @SaiVal[name="dash_acl_group_id"]; - meta.dst_ip_addr : ternary @SaiVal[name="dip", type="sai_ip_prefix_list_t"]; - meta.src_ip_addr : ternary @SaiVal[name="sip", type="sai_ip_prefix_list_t"]; - meta.ip_protocol : ternary @SaiVal[name="protocol", type="sai_u8_list_t"]; - meta.src_l4_port : range @SaiVal[name="src_port", type="sai_u16_range_list_t"]; - meta.dst_l4_port : range @SaiVal[name="dst_port", type="sai_u16_range_list_t"]; - } - actions = { - permit; - permit_and_continue; - deny; - deny_and_continue; - } - default_action = deny; - } - @SaiTable[name="dash_acl_rule", stage="acl.stage3", api="dash_acl", isobject="true"] table stage3 { - key = { - meta.stage3_dash_acl_group_id: exact @SaiVal[name="dash_acl_group_id"]; - meta.dst_ip_addr : ternary @SaiVal[name="dip", type="sai_ip_prefix_list_t"]; - meta.src_ip_addr : ternary @SaiVal[name="sip", type="sai_ip_prefix_list_t"]; - meta.ip_protocol : ternary @SaiVal[name="protocol", type="sai_u8_list_t"]; - meta.src_l4_port : range @SaiVal[name="src_port", type="sai_u16_range_list_t"]; - meta.dst_l4_port : range @SaiVal[name="dst_port", type="sai_u16_range_list_t"]; - } - actions = { - permit; - permit_and_continue; - deny; - deny_and_continue; - } - default_action = deny; - } - apply { - if (meta.stage1_dash_acl_group_id != 0) { - switch (stage1.apply().action_run) { - permit: { - return; - } - deny: { - return; - } - } - } - if (meta.stage2_dash_acl_group_id != 0) { - switch (stage2.apply().action_run) { - permit: { - return; - } - deny: { - return; - } - } - } - if (meta.stage3_dash_acl_group_id != 0) { - switch (stage3.apply().action_run) { - permit: { - return; - } - deny: { - return; - } - } - } - } -} - -action push_action_static_encap(in headers_t hdr, inout metadata_t meta, in dash_encapsulation_t encap=dash_encapsulation_t.VXLAN, in bit<24> vni=0, in IPv4Address underlay_sip=0, in IPv4Address underlay_dip=0, in EthernetAddress underlay_smac=0, in EthernetAddress underlay_dmac=0, in EthernetAddress overlay_dmac=0) { - meta.routing_actions = meta.routing_actions | dash_routing_actions_t.STATIC_ENCAP; - meta.encap_data.dash_encapsulation = encap; - meta.encap_data.vni = (vni == 0 ? meta.encap_data.vni : vni); - meta.encap_data.underlay_smac = (underlay_smac == 0 ? meta.encap_data.underlay_smac : underlay_smac); - meta.encap_data.underlay_dmac = (underlay_dmac == 0 ? meta.encap_data.underlay_dmac : underlay_dmac); - meta.encap_data.underlay_sip = (underlay_sip == 0 ? meta.encap_data.underlay_sip : underlay_sip); - meta.encap_data.underlay_dip = (underlay_dip == 0 ? meta.encap_data.underlay_dip : underlay_dip); - meta.overlay_data.dmac = (overlay_dmac == 0 ? meta.overlay_data.dmac : overlay_dmac); -} -control do_action_static_encap(inout headers_t hdr, inout metadata_t meta) { - apply { - if (meta.routing_actions & dash_routing_actions_t.STATIC_ENCAP == 0) { - return; - } - if (meta.encap_data.dash_encapsulation == dash_encapsulation_t.VXLAN) { - if (meta.tunnel_pointer == 0) { - push_vxlan_tunnel_u0(hdr, meta.overlay_data.dmac, meta.encap_data.underlay_dmac, meta.encap_data.underlay_smac, meta.encap_data.underlay_dip, meta.encap_data.underlay_sip, meta.encap_data.vni); - } else if (meta.tunnel_pointer == 1) { - push_vxlan_tunnel_u1(hdr, meta.overlay_data.dmac, meta.encap_data.underlay_dmac, meta.encap_data.underlay_smac, meta.encap_data.underlay_dip, meta.encap_data.underlay_sip, meta.encap_data.vni); - } - } else if (meta.encap_data.dash_encapsulation == dash_encapsulation_t.NVGRE) { - if (meta.tunnel_pointer == 0) { - push_vxlan_tunnel_u0(hdr, meta.overlay_data.dmac, meta.encap_data.underlay_dmac, meta.encap_data.underlay_smac, meta.encap_data.underlay_dip, meta.encap_data.underlay_sip, meta.encap_data.vni); - } else if (meta.tunnel_pointer == 1) { - push_vxlan_tunnel_u1(hdr, meta.overlay_data.dmac, meta.encap_data.underlay_dmac, meta.encap_data.underlay_smac, meta.encap_data.underlay_dip, meta.encap_data.underlay_sip, meta.encap_data.vni); - } - } - meta.tunnel_pointer = meta.tunnel_pointer + 1; - } -} - -action push_action_nat46(in headers_t hdr, inout metadata_t meta, in IPv6Address sip, in IPv6Address sip_mask, in IPv6Address dip, in IPv6Address dip_mask) { - meta.routing_actions = meta.routing_actions | dash_routing_actions_t.NAT46; - meta.overlay_data.is_ipv6 = true; - meta.overlay_data.sip = sip; - meta.overlay_data.sip_mask = sip_mask; - meta.overlay_data.dip = dip; - meta.overlay_data.dip_mask = dip_mask; -} -control do_action_nat46(inout headers_t hdr, in metadata_t meta) { - apply { - if (meta.routing_actions & dash_routing_actions_t.NAT46 == 0) { - return; - } - ; - hdr.u0_ipv6.setValid(); - hdr.u0_ipv6.version = 6; - hdr.u0_ipv6.traffic_class = 0; - hdr.u0_ipv6.flow_label = 0; - hdr.u0_ipv6.payload_length = hdr.u0_ipv4.total_len - IPV4_HDR_SIZE; - hdr.u0_ipv6.next_header = hdr.u0_ipv4.protocol; - hdr.u0_ipv6.hop_limit = hdr.u0_ipv4.ttl; - hdr.u0_ipv6.dst_addr = (IPv6Address)hdr.u0_ipv4.dst_addr & ~meta.overlay_data.dip_mask | meta.overlay_data.dip & meta.overlay_data.dip_mask; - hdr.u0_ipv6.src_addr = (IPv6Address)hdr.u0_ipv4.src_addr & ~meta.overlay_data.sip_mask | meta.overlay_data.sip & meta.overlay_data.sip_mask; - hdr.u0_ipv4.setInvalid(); - hdr.u0_ethernet.ether_type = 0x86dd; - } -} - -action push_action_nat64(in headers_t hdr, inout metadata_t meta, in IPv4Address src, in IPv4Address dst) { - meta.routing_actions = meta.routing_actions | dash_routing_actions_t.NAT64; - meta.overlay_data.is_ipv6 = false; - meta.overlay_data.sip = (IPv4ORv6Address)src; - meta.overlay_data.dip = (IPv4ORv6Address)dst; -} -control do_action_nat64(inout headers_t hdr, in metadata_t meta) { - apply { - if (meta.routing_actions & dash_routing_actions_t.NAT64 == 0) { - return; - } - ; - hdr.u0_ipv4.setValid(); - hdr.u0_ipv4.version = 4; - hdr.u0_ipv4.ihl = 5; - hdr.u0_ipv4.diffserv = 0; - hdr.u0_ipv4.total_len = hdr.u0_ipv6.payload_length + IPV4_HDR_SIZE; - hdr.u0_ipv4.identification = 1; - hdr.u0_ipv4.flags = 0; - hdr.u0_ipv4.frag_offset = 0; - hdr.u0_ipv4.protocol = hdr.u0_ipv6.next_header; - hdr.u0_ipv4.ttl = hdr.u0_ipv6.hop_limit; - hdr.u0_ipv4.hdr_checksum = 0; - hdr.u0_ipv4.dst_addr = (IPv4Address)meta.overlay_data.dip; - hdr.u0_ipv4.src_addr = (IPv4Address)meta.overlay_data.sip; - hdr.u0_ipv6.setInvalid(); - hdr.u0_ethernet.ether_type = 0x800; - } -} - -action set_route_meter_attrs(inout metadata_t meta, bit<1> meter_policy_en, bit<16> meter_class) { - meta.meter_policy_en = meter_policy_en; - meta.route_meter_class = meter_class; -} -action set_mapping_meter_attr(inout metadata_t meta, in bit<16> meter_class, in bit<1> meter_class_override) { - meta.mapping_meter_class = meter_class; - meta.mapping_meter_class_override = meter_class_override; -} -action drop(inout metadata_t meta) { - meta.target_stage = dash_pipeline_stage_t.ROUTING_ACTION_APPLY; - meta.dropped = true; -} -action route_vnet(inout headers_t hdr, inout metadata_t meta, @SaiVal[type="sai_object_id_t"] bit<16> dst_vnet_id, bit<1> meter_policy_en, bit<16> meter_class) { - meta.target_stage = dash_pipeline_stage_t.OUTBOUND_MAPPING; - meta.dst_vnet_id = dst_vnet_id; - set_route_meter_attrs(meta, meter_policy_en, meter_class); -} -action route_vnet_direct(inout headers_t hdr, inout metadata_t meta, bit<16> dst_vnet_id, bit<1> overlay_ip_is_v6, @SaiVal[type="sai_ip_address_t"] IPv4ORv6Address overlay_ip, bit<1> meter_policy_en, bit<16> meter_class) { - meta.target_stage = dash_pipeline_stage_t.OUTBOUND_MAPPING; - meta.dst_vnet_id = dst_vnet_id; - meta.lkup_dst_ip_addr = overlay_ip; - meta.is_lkup_dst_ip_v6 = overlay_ip_is_v6; - set_route_meter_attrs(meta, meter_policy_en, meter_class); -} -action route_direct(inout headers_t hdr, inout metadata_t meta, bit<1> meter_policy_en, bit<16> meter_class) { - meta.target_stage = dash_pipeline_stage_t.ROUTING_ACTION_APPLY; - set_route_meter_attrs(meta, meter_policy_en, meter_class); -} -action route_service_tunnel(inout headers_t hdr, inout metadata_t meta, bit<1> overlay_dip_is_v6, IPv4ORv6Address overlay_dip, bit<1> overlay_dip_mask_is_v6, IPv4ORv6Address overlay_dip_mask, bit<1> overlay_sip_is_v6, IPv4ORv6Address overlay_sip, bit<1> overlay_sip_mask_is_v6, IPv4ORv6Address overlay_sip_mask, bit<1> underlay_dip_is_v6, IPv4ORv6Address underlay_dip, bit<1> underlay_sip_is_v6, IPv4ORv6Address underlay_sip, @SaiVal[type="sai_dash_encapsulation_t", default_value="SAI_DASH_ENCAPSULATION_VXLAN"] dash_encapsulation_t dash_encapsulation, bit<24> tunnel_key, bit<1> meter_policy_en, bit<16> meter_class) { - meta.target_stage = dash_pipeline_stage_t.ROUTING_ACTION_APPLY; - push_action_nat46(hdr = hdr, meta = meta, sip = overlay_sip, sip_mask = overlay_sip_mask, dip = overlay_dip, dip_mask = overlay_dip_mask); - push_action_static_encap(hdr = hdr, meta = meta, encap = dash_encapsulation, vni = tunnel_key, underlay_sip = (underlay_sip == 0 ? hdr.u0_ipv4.src_addr : (IPv4Address)underlay_sip), underlay_dip = (underlay_dip == 0 ? hdr.u0_ipv4.dst_addr : (IPv4Address)underlay_dip), overlay_dmac = hdr.u0_ethernet.dst_addr); - set_route_meter_attrs(meta, meter_policy_en, meter_class); -} -action set_tunnel_mapping(inout headers_t hdr, inout metadata_t meta, @SaiVal[type="sai_ip_address_t"] IPv4Address underlay_dip, EthernetAddress overlay_dmac, bit<1> use_dst_vnet_vni, bit<16> meter_class, bit<1> meter_class_override) { - meta.target_stage = dash_pipeline_stage_t.ROUTING_ACTION_APPLY; - if (use_dst_vnet_vni == 1) { - meta.vnet_id = meta.dst_vnet_id; - } - push_action_static_encap(hdr = hdr, meta = meta, underlay_dip = underlay_dip, overlay_dmac = overlay_dmac); - set_mapping_meter_attr(meta, meter_class, meter_class_override); -} -action set_private_link_mapping(inout headers_t hdr, inout metadata_t meta, @SaiVal[type="sai_ip_address_t"] IPv4Address underlay_dip, IPv6Address overlay_sip, IPv6Address overlay_dip, @SaiVal[type="sai_dash_encapsulation_t"] dash_encapsulation_t dash_encapsulation, bit<24> tunnel_key, bit<16> meter_class, bit<1> meter_class_override) { - meta.target_stage = dash_pipeline_stage_t.ROUTING_ACTION_APPLY; - push_action_static_encap(hdr = hdr, meta = meta, encap = dash_encapsulation, vni = tunnel_key, underlay_sip = meta.eni_data.pl_underlay_sip, underlay_dip = underlay_dip, overlay_dmac = hdr.u0_ethernet.dst_addr); - push_action_nat46(hdr = hdr, meta = meta, dip = overlay_dip, dip_mask = 0xffffffffffffffffffffffff, sip = overlay_sip & ~meta.eni_data.pl_sip_mask | meta.eni_data.pl_sip | (IPv6Address)hdr.u0_ipv4.src_addr, sip_mask = 0xffffffffffffffffffffffff); - set_mapping_meter_attr(meta, meter_class, meter_class_override); -} -control outbound_routing_stage(inout headers_t hdr, inout metadata_t meta) { - @SaiTable[name="outbound_routing", api="dash_outbound_routing"] table routing { - key = { - meta.eni_id : exact @SaiVal[type="sai_object_id_t"]; - meta.is_overlay_ip_v6: exact @SaiVal[name="destination_is_v6"]; - meta.dst_ip_addr : lpm @SaiVal[name="destination"]; - } - actions = { - route_vnet(hdr, meta); - route_vnet_direct(hdr, meta); - route_direct(hdr, meta); - route_service_tunnel(hdr, meta); - drop(meta); - } - const default_action = drop(meta); - } - apply { - if (meta.target_stage != dash_pipeline_stage_t.OUTBOUND_ROUTING) { - return; - } - routing.apply(); - } -} - -control outbound_mapping_stage(inout headers_t hdr, inout metadata_t meta) { - @SaiTable[name="outbound_ca_to_pa", api="dash_outbound_ca_to_pa"] table ca_to_pa { - key = { - meta.dst_vnet_id : exact @SaiVal[type="sai_object_id_t"]; - meta.is_lkup_dst_ip_v6: exact @SaiVal[name="dip_is_v6"]; - meta.lkup_dst_ip_addr : exact @SaiVal[name="dip"]; - } - actions = { - set_tunnel_mapping(hdr, meta); - set_private_link_mapping(hdr, meta); - @defaultonly drop(meta); - } - const default_action = drop(meta); - } - action set_vnet_attrs(bit<24> vni) { - meta.encap_data.vni = vni; - } - @SaiTable[name="vnet", api="dash_vnet", isobject="true"] table vnet { - key = { - meta.vnet_id: exact @SaiVal[type="sai_object_id_t"]; - } - actions = { - set_vnet_attrs; - } - } - apply { - if (meta.target_stage != dash_pipeline_stage_t.OUTBOUND_MAPPING) { - return; - } - switch (ca_to_pa.apply().action_run) { - set_tunnel_mapping: { - vnet.apply(); - } - } - } -} - -control outbound(inout headers_t hdr, inout metadata_t meta) { - apply { - if (!meta.conntrack_data.allow_out) { - acl.apply(hdr, meta); - } - meta.lkup_dst_ip_addr = meta.dst_ip_addr; - meta.is_lkup_dst_ip_v6 = meta.is_overlay_ip_v6; - outbound_routing_stage.apply(hdr, meta); - outbound_mapping_stage.apply(hdr, meta); - } -} - -action service_tunnel_encode(inout headers_t hdr, in IPv6Address st_dst, in IPv6Address st_dst_mask, in IPv6Address st_src, in IPv6Address st_src_mask) { - hdr.u0_ipv6.setValid(); - hdr.u0_ipv6.version = 6; - hdr.u0_ipv6.traffic_class = 0; - hdr.u0_ipv6.flow_label = 0; - hdr.u0_ipv6.payload_length = hdr.u0_ipv4.total_len - IPV4_HDR_SIZE; - hdr.u0_ipv6.next_header = hdr.u0_ipv4.protocol; - hdr.u0_ipv6.hop_limit = hdr.u0_ipv4.ttl; - hdr.u0_ipv6.dst_addr = (IPv6Address)hdr.u0_ipv4.dst_addr & ~st_dst_mask | st_dst & st_dst_mask; - hdr.u0_ipv6.src_addr = (IPv6Address)hdr.u0_ipv4.src_addr & ~st_src_mask | st_src & st_src_mask; - hdr.u0_ipv4.setInvalid(); - hdr.u0_ethernet.ether_type = 0x86dd; -} -action service_tunnel_decode(inout headers_t hdr, in IPv4Address src, in IPv4Address dst) { - hdr.u0_ipv4.setValid(); - hdr.u0_ipv4.version = 4; - hdr.u0_ipv4.ihl = 5; - hdr.u0_ipv4.diffserv = 0; - hdr.u0_ipv4.total_len = hdr.u0_ipv6.payload_length + IPV4_HDR_SIZE; - hdr.u0_ipv4.identification = 1; - hdr.u0_ipv4.flags = 0; - hdr.u0_ipv4.frag_offset = 0; - hdr.u0_ipv4.protocol = hdr.u0_ipv6.next_header; - hdr.u0_ipv4.ttl = hdr.u0_ipv6.hop_limit; - hdr.u0_ipv4.hdr_checksum = 0; - hdr.u0_ipv4.dst_addr = dst; - hdr.u0_ipv4.src_addr = src; - hdr.u0_ipv6.setInvalid(); - hdr.u0_ethernet.ether_type = 0x800; -} -control inbound(inout headers_t hdr, inout metadata_t meta) { - apply { - if (!meta.conntrack_data.allow_in) { - acl.apply(hdr, meta); - } - { - if (dash_encapsulation_t.VXLAN == dash_encapsulation_t.VXLAN) { - if (meta.tunnel_pointer == 0) { - push_vxlan_tunnel_u0(hdr, meta.overlay_data.dmac, meta.encap_data.underlay_dmac, meta.encap_data.underlay_smac, meta.encap_data.underlay_dip, meta.encap_data.underlay_sip, meta.encap_data.vni); - } else if (meta.tunnel_pointer == 1) { - push_vxlan_tunnel_u1(hdr, meta.overlay_data.dmac, meta.encap_data.underlay_dmac, meta.encap_data.underlay_smac, meta.encap_data.underlay_dip, meta.encap_data.underlay_sip, meta.encap_data.vni); - } - } else if (dash_encapsulation_t.VXLAN == dash_encapsulation_t.NVGRE) { - if (meta.tunnel_pointer == 0) { - push_nvgre_tunnel_u0(hdr, meta.overlay_data.dmac, meta.encap_data.underlay_dmac, meta.encap_data.underlay_smac, meta.encap_data.underlay_dip, meta.encap_data.underlay_sip, meta.encap_data.vni); - } else if (meta.tunnel_pointer == 1) { - push_nvgre_tunnel_u1(hdr, meta.overlay_data.dmac, meta.encap_data.underlay_dmac, meta.encap_data.underlay_smac, meta.encap_data.underlay_dip, meta.encap_data.underlay_sip, meta.encap_data.vni); - } - } - meta.tunnel_pointer = meta.tunnel_pointer + 1; - } - ; - } -} - -control direction_lookup_stage(inout headers_t hdr, inout metadata_t meta) { - action set_outbound_direction() { - meta.direction = dash_direction_t.OUTBOUND; - } - action set_inbound_direction() { - meta.direction = dash_direction_t.INBOUND; - } - @SaiTable[name="direction_lookup", api="dash_direction_lookup"] table direction_lookup { - key = { - hdr.u0_vxlan.vni: exact @SaiVal[name="VNI"]; - } - actions = { - set_outbound_direction; - @defaultonly set_inbound_direction; - } - const default_action = set_inbound_direction; - } - apply { - direction_lookup.apply(); - } -} - -control eni_lookup_stage(inout headers_t hdr, inout metadata_t meta) { - action set_eni(@SaiVal[type="sai_object_id_t"] bit<16> eni_id) { - meta.eni_id = eni_id; - } - action deny() { - meta.dropped = true; - } - @SaiTable[name="eni_ether_address_map", api="dash_eni", order=0] table eni_ether_address_map { - key = { - meta.eni_addr: exact @SaiVal[name="address", type="sai_mac_t"]; - } - actions = { - set_eni; - @defaultonly deny; - } - const default_action = deny; - } - apply { - meta.eni_addr = (meta.direction == dash_direction_t.OUTBOUND ? hdr.customer_ethernet.src_addr : hdr.customer_ethernet.dst_addr); - if (!eni_ether_address_map.apply().hit) { - if (meta.is_fast_path_icmp_flow_redirection_packet) { - ; - } - } - } -} - -control routing_action_apply(inout headers_t hdr, inout metadata_t meta) { - apply { - do_action_nat46.apply(hdr, meta); - do_action_nat64.apply(hdr, meta); - do_action_static_encap.apply(hdr, meta); - } -} - -control metering_update_stage(inout headers_t hdr, inout metadata_t meta) { - action check_ip_addr_family(@SaiVal[type="sai_ip_addr_family_t", isresourcetype="true"] bit<32> ip_addr_family) { - if (ip_addr_family == 0) { - if (meta.is_overlay_ip_v6 == 1) { - meta.dropped = true; - } - } else { - if (meta.is_overlay_ip_v6 == 0) { - meta.dropped = true; - } - } - } - @SaiTable[name="meter_policy", api="dash_meter", order=1, isobject="true"] table meter_policy { - key = { - meta.meter_policy_id: exact; - } - actions = { - check_ip_addr_family; - } - } - action set_policy_meter_class(bit<16> meter_class) { - meta.policy_meter_class = meter_class; - } - @SaiTable[name="meter_rule", api="dash_meter", order=2, isobject="true"] table meter_rule { - key = { - meta.meter_policy_id: exact @SaiVal[type="sai_object_id_t", isresourcetype="true", objects="METER_POLICY"]; - hdr.u0_ipv4.dst_addr: ternary @SaiVal[name="dip", type="sai_ip_address_t"]; - } - actions = { - set_policy_meter_class; - @defaultonly NoAction; - } - const default_action = NoAction(); - } - action meter_bucket_action(@SaiVal[type="sai_uint32_t", skipattr="true"] bit<32> meter_bucket_index) { - meta.meter_bucket_index = meter_bucket_index; - } - @SaiTable[name="meter_bucket", api="dash_meter", order=0, isobject="true"] table meter_bucket { - key = { - meta.eni_id : exact @SaiVal[type="sai_object_id_t"]; - meta.meter_class: exact; - } - actions = { - meter_bucket_action; - @defaultonly NoAction; - } - const default_action = NoAction(); - } - @SaiTable[ignored="true"] table eni_meter { - key = { - meta.eni_id : exact @SaiVal[type="sai_object_id_t"]; - meta.direction: exact; - meta.dropped : exact; - } - actions = { - NoAction; - } - } - apply { - if (meta.meter_policy_en == 1) { - meter_policy.apply(); - meter_rule.apply(); - } - { - if (meta.meter_policy_en == 1) { - meta.meter_class = meta.policy_meter_class; - } else { - meta.meter_class = meta.route_meter_class; - } - if (meta.meter_class == 0 || meta.mapping_meter_class_override == 1) { - meta.meter_class = meta.mapping_meter_class; - } - } - meter_bucket.apply(); - if (meta.direction == dash_direction_t.OUTBOUND) { - ; - } else if (meta.direction == dash_direction_t.INBOUND) { - ; - } - eni_meter.apply(); - } -} - -control underlay(inout headers_t hdr, inout metadata_t meta, in pna_main_input_metadata_t istd) { - action set_nhop(bit<9> next_hop_id) { - } - action pkt_act(bit<9> packet_action, bit<9> next_hop_id) { - if (packet_action == 0) { - meta.dropped = true; - } else if (packet_action == 1) { - set_nhop(next_hop_id); - } - } - action def_act() { - } - @SaiTable[name="route", api="route", api_type="underlay"] table underlay_routing { - key = { - meta.dst_ip_addr: lpm @SaiVal[name="destination"]; - } - actions = { - pkt_act; - @defaultonly def_act; - } - } - apply { - underlay_routing.apply(); - } -} - -control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { - action drop_action() { - drop_packet(); - } - action deny() { - meta.dropped = true; - } - action accept() { - } - @SaiTable[name="vip", api="dash_vip"] table vip { - key = { - hdr.u0_ipv4.dst_addr: exact @SaiVal[name="VIP", type="sai_ip_address_t"]; - } - actions = { - accept; - @defaultonly deny; - } - const default_action = deny; - } - action set_appliance(EthernetAddress neighbor_mac, EthernetAddress mac) { - meta.encap_data.underlay_dmac = neighbor_mac; - meta.encap_data.underlay_smac = mac; - } - @SaiTable[ignored="true"] table appliance { - key = { - meta.appliance_id: ternary; - } - actions = { - set_appliance; - } - } - action set_eni_attrs(bit<32> cps, bit<32> pps, bit<32> flows, bit<1> admin_state, @SaiVal[type="sai_ip_address_t"] IPv4Address vm_underlay_dip, @SaiVal[type="sai_uint32_t"] bit<24> vm_vni, @SaiVal[type="sai_object_id_t"] bit<16> vnet_id, IPv6Address pl_sip, IPv6Address pl_sip_mask, @SaiVal[type="sai_ip_address_t"] IPv4Address pl_underlay_sip, @SaiVal[type="sai_object_id_t"] bit<16> v4_meter_policy_id, @SaiVal[type="sai_object_id_t"] bit<16> v6_meter_policy_id, @SaiVal[type="sai_dash_tunnel_dscp_mode_t"] dash_tunnel_dscp_mode_t dash_tunnel_dscp_mode, @SaiVal[type="sai_uint8_t", validonly="SAI_ENI_ATTR_DASH_TUNNEL_DSCP_MODE == SAI_DASH_TUNNEL_DSCP_MODE_PIPE_MODEL"] bit<6> dscp, @SaiVal[type="sai_object_id_t"] bit<16> inbound_v4_stage1_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> inbound_v4_stage2_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> inbound_v4_stage3_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> inbound_v4_stage4_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> inbound_v4_stage5_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> inbound_v6_stage1_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> inbound_v6_stage2_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> inbound_v6_stage3_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> inbound_v6_stage4_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> inbound_v6_stage5_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> outbound_v4_stage1_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> outbound_v4_stage2_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> outbound_v4_stage3_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> outbound_v4_stage4_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> outbound_v4_stage5_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> outbound_v6_stage1_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> outbound_v6_stage2_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> outbound_v6_stage3_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> outbound_v6_stage4_dash_acl_group_id, @SaiVal[type="sai_object_id_t"] bit<16> outbound_v6_stage5_dash_acl_group_id, bit<1> disable_fast_path_icmp_flow_redirection) { - meta.eni_data.cps = cps; - meta.eni_data.pps = pps; - meta.eni_data.flows = flows; - meta.eni_data.admin_state = admin_state; - meta.eni_data.pl_sip = pl_sip; - meta.eni_data.pl_sip_mask = pl_sip_mask; - meta.eni_data.pl_underlay_sip = pl_underlay_sip; - meta.encap_data.underlay_dip = vm_underlay_dip; - if (dash_tunnel_dscp_mode == dash_tunnel_dscp_mode_t.PIPE_MODEL) { - meta.eni_data.dscp = dscp; - } - meta.encap_data.vni = vm_vni; - meta.vnet_id = vnet_id; - if (meta.is_overlay_ip_v6 == 1) { - if (meta.direction == dash_direction_t.OUTBOUND) { - meta.stage1_dash_acl_group_id = outbound_v6_stage1_dash_acl_group_id; - meta.stage2_dash_acl_group_id = outbound_v6_stage2_dash_acl_group_id; - meta.stage3_dash_acl_group_id = outbound_v6_stage3_dash_acl_group_id; - meta.stage4_dash_acl_group_id = outbound_v6_stage4_dash_acl_group_id; - meta.stage5_dash_acl_group_id = outbound_v6_stage5_dash_acl_group_id; - ; - } else { - meta.stage1_dash_acl_group_id = inbound_v6_stage1_dash_acl_group_id; - meta.stage2_dash_acl_group_id = inbound_v6_stage2_dash_acl_group_id; - meta.stage3_dash_acl_group_id = inbound_v6_stage3_dash_acl_group_id; - meta.stage4_dash_acl_group_id = inbound_v6_stage4_dash_acl_group_id; - meta.stage5_dash_acl_group_id = inbound_v6_stage5_dash_acl_group_id; - ; - } - meta.meter_policy_id = v6_meter_policy_id; - } else { - if (meta.direction == dash_direction_t.OUTBOUND) { - meta.stage1_dash_acl_group_id = outbound_v4_stage1_dash_acl_group_id; - meta.stage2_dash_acl_group_id = outbound_v4_stage2_dash_acl_group_id; - meta.stage3_dash_acl_group_id = outbound_v4_stage3_dash_acl_group_id; - meta.stage4_dash_acl_group_id = outbound_v4_stage4_dash_acl_group_id; - meta.stage5_dash_acl_group_id = outbound_v4_stage5_dash_acl_group_id; - ; - } else { - meta.stage1_dash_acl_group_id = inbound_v4_stage1_dash_acl_group_id; - meta.stage2_dash_acl_group_id = inbound_v4_stage2_dash_acl_group_id; - meta.stage3_dash_acl_group_id = inbound_v4_stage3_dash_acl_group_id; - meta.stage4_dash_acl_group_id = inbound_v4_stage4_dash_acl_group_id; - meta.stage5_dash_acl_group_id = inbound_v4_stage5_dash_acl_group_id; - ; - } - meta.meter_policy_id = v4_meter_policy_id; - } - meta.fast_path_icmp_flow_redirection_disabled = disable_fast_path_icmp_flow_redirection; - } - @SaiTable[name="eni", api="dash_eni", order=1, isobject="true"] table eni { - key = { - meta.eni_id: exact @SaiVal[type="sai_object_id_t"]; - } - actions = { - set_eni_attrs; - @defaultonly deny; - } - const default_action = deny; - } - action permit() { - } - action tunnel_decap_pa_validate(@SaiVal[type="sai_object_id_t"] bit<16> src_vnet_id) { - meta.vnet_id = src_vnet_id; - } - @SaiTable[name="pa_validation", api="dash_pa_validation"] table pa_validation { - key = { - meta.vnet_id : exact @SaiVal[type="sai_object_id_t"]; - hdr.u0_ipv4.src_addr: exact @SaiVal[name="sip", type="sai_ip_address_t"]; - } - actions = { - permit; - @defaultonly deny; - } - const default_action = deny; - } - @SaiTable[name="inbound_routing", api="dash_inbound_routing"] table inbound_routing { - key = { - meta.eni_id : exact @SaiVal[type="sai_object_id_t"]; - hdr.u0_vxlan.vni : exact @SaiVal[name="VNI"]; - hdr.u0_ipv4.src_addr: ternary @SaiVal[name="sip", type="sai_ip_address_t"]; - } - actions = { - tunnel_decap(hdr, meta); - tunnel_decap_pa_validate; - @defaultonly deny; - } - const default_action = deny; - } - action set_acl_group_attrs(@SaiVal[type="sai_ip_addr_family_t", isresourcetype="true"] bit<32> ip_addr_family) { - if (ip_addr_family == 0) { - if (meta.is_overlay_ip_v6 == 1) { - meta.dropped = true; - } - } else { - if (meta.is_overlay_ip_v6 == 0) { - meta.dropped = true; - } - } - } - @SaiTable[name="dash_acl_group", api="dash_acl", order=0, isobject="true"] table acl_group { - key = { - meta.stage1_dash_acl_group_id: exact @SaiVal[name="dash_acl_group_id"]; - } - actions = { - set_acl_group_attrs(); - } - } - apply { - if (meta.is_fast_path_icmp_flow_redirection_packet) { - ; - } - if (vip.apply().hit) { - meta.encap_data.underlay_sip = hdr.u0_ipv4.dst_addr; - } else { - if (meta.is_fast_path_icmp_flow_redirection_packet) { - } - } - direction_lookup_stage.apply(hdr, meta); - appliance.apply(); - eni_lookup_stage.apply(hdr, meta); - meta.eni_data.dscp_mode = dash_tunnel_dscp_mode_t.PRESERVE_MODEL; - meta.eni_data.dscp = (bit<6>)hdr.u0_ipv4.diffserv; - if (meta.direction == dash_direction_t.OUTBOUND) { - tunnel_decap(hdr, meta); - } else if (meta.direction == dash_direction_t.INBOUND) { - switch (inbound_routing.apply().action_run) { - tunnel_decap_pa_validate: { - pa_validation.apply(); - tunnel_decap(hdr, meta); - } - } - } - meta.is_overlay_ip_v6 = 0; - meta.ip_protocol = 0; - meta.dst_ip_addr = 0; - meta.src_ip_addr = 0; - if (hdr.customer_ipv6.isValid()) { - meta.ip_protocol = hdr.customer_ipv6.next_header; - meta.src_ip_addr = hdr.customer_ipv6.src_addr; - meta.dst_ip_addr = hdr.customer_ipv6.dst_addr; - meta.is_overlay_ip_v6 = 1; - } else if (hdr.customer_ipv4.isValid()) { - meta.ip_protocol = hdr.customer_ipv4.protocol; - meta.src_ip_addr = (bit<128>)hdr.customer_ipv4.src_addr; - meta.dst_ip_addr = (bit<128>)hdr.customer_ipv4.dst_addr; - } - if (hdr.customer_tcp.isValid()) { - meta.src_l4_port = hdr.customer_tcp.src_port; - meta.dst_l4_port = hdr.customer_tcp.dst_port; - } else if (hdr.customer_udp.isValid()) { - meta.src_l4_port = hdr.customer_udp.src_port; - meta.dst_l4_port = hdr.customer_udp.dst_port; - } - eni.apply(); - if (meta.eni_data.admin_state == 0) { - deny(); - } - if (meta.is_fast_path_icmp_flow_redirection_packet) { - ; - } - acl_group.apply(); - if (meta.direction == dash_direction_t.OUTBOUND) { - meta.target_stage = dash_pipeline_stage_t.OUTBOUND_ROUTING; - outbound.apply(hdr, meta); - } else if (meta.direction == dash_direction_t.INBOUND) { - inbound.apply(hdr, meta); - } - routing_action_apply.apply(hdr, meta); - meta.dst_ip_addr = (bit<128>)hdr.u0_ipv4.dst_addr; - underlay.apply(hdr, meta, istd); - if (meta.eni_data.dscp_mode == dash_tunnel_dscp_mode_t.PIPE_MODEL) { - hdr.u0_ipv4.diffserv = (bit<8>)meta.eni_data.dscp; - } - metering_update_stage.apply(hdr, meta); - if (meta.dropped) { - drop_action(); - } - } -} - -control dash_precontrol(in headers_t pre_hdr, inout metadata_t pre_user_meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { - apply { - } -} - -PNA_NIC(dash_parser(), dash_precontrol(), dash_ingress(), dash_deparser()) main; diff --git a/testdata/p4_16_dpdk_errors/psa-dpdk-128bitCast_error.p4 b/testdata/p4_16_dpdk_errors/psa-dpdk-128bitCast_error.p4 new file mode 100644 index 00000000000..21cb1ffc9d8 --- /dev/null +++ b/testdata/p4_16_dpdk_errors/psa-dpdk-128bitCast_error.p4 @@ -0,0 +1,126 @@ +/* -*- P4_16 -*- */ +#include +#include + +/************ H E A D E R S *******************************/ +struct EMPTY {}; + +header ethernet_t { + bit<48> dst_addr; + bit<48> src_addr; + bit<16> ether_type; + bit<80> val; +} + +struct headers_t { + ethernet_t ethernet; +} + +struct user_meta_data_t { + bit<48> addr; + // bit<80> val; +} + + + +/************************************************************************* + **************** I N G R E S S P R O C E S S I N G ***************** + *************************************************************************/ +parser MyIngressParser( + packet_in pkt, + out headers_t hdr, + inout user_meta_data_t m, + in psa_ingress_parser_input_metadata_t c, + in EMPTY d, + in EMPTY e) { + + state start { + pkt.extract(hdr.ethernet); + transition accept; + } +} + +control MyIngressControl( + inout headers_t hdr, + inout user_meta_data_t m, + in psa_ingress_input_metadata_t c, + inout psa_ingress_output_metadata_t d) { + bit<80> flg = 0x123456789AAAAA; + action macswp() { + //if (m.val == 0x1 && hdr.ethernet.val == 0x2) { + if ((bit<64>)flg == 0x2) { + m.addr = hdr.ethernet.dst_addr; + hdr.ethernet.dst_addr = hdr.ethernet.src_addr; + hdr.ethernet.src_addr = m.addr; + hdr.ethernet.val = 0xFFFFBBBB12345342AAAA; + } + } + table stub { + key = {} + + actions = { + macswp; + } + size=1000000; + } + + apply { + d.egress_port = (PortId_t) ((bit <32>) c.ingress_port ^ 1); + stub.apply(); + } +} + +control MyIngressDeparser( + packet_out pkt, + out EMPTY a, + out EMPTY b, + out EMPTY c, + inout headers_t hdr, + in user_meta_data_t e, + in psa_ingress_output_metadata_t f) { + + apply { + pkt.emit(hdr.ethernet); + } +} + +/************************************************************************* + **************** E G R E S S P R O C E S S I N G ******************* + *************************************************************************/ +parser MyEgressParser( + packet_in pkt, + out EMPTY a, + inout EMPTY b, + in psa_egress_parser_input_metadata_t c, + in EMPTY d, + in EMPTY e, + in EMPTY f) { + state start { + transition accept; + } +} + +control MyEgressControl( + inout EMPTY a, + inout EMPTY b, + in psa_egress_input_metadata_t c, + inout psa_egress_output_metadata_t d) { + apply {} +} +control MyEgressDeparser( + packet_out pkt, + out EMPTY a, + out EMPTY b, + inout EMPTY c, + in EMPTY d, + in psa_egress_output_metadata_t e, + in psa_egress_deparser_input_metadata_t f) { + apply {} +} + +/************ F I N A L P A C K A G E ******************************/ +IngressPipeline(MyIngressParser(), MyIngressControl(), MyIngressDeparser()) ip; + +EgressPipeline(MyEgressParser(), MyEgressControl(), MyEgressDeparser()) ep; + +PSA_Switch(ip, PacketReplicationEngine(), ep, BufferingQueueingEngine()) main; diff --git a/testdata/p4_16_dpdk_errors_outputs/psa-dpdk-128bitCast_error.p4-error b/testdata/p4_16_dpdk_errors_outputs/psa-dpdk-128bitCast_error.p4-error new file mode 100644 index 00000000000..70b63e696c1 --- /dev/null +++ b/testdata/p4_16_dpdk_errors_outputs/psa-dpdk-128bitCast_error.p4-error @@ -0,0 +1,3 @@ +psa-dpdk-128bitCast_error.p4(55): [--Werror=overlimit] error: DPDK target supports constant values that are up to 64-bits, and also exactly 128-bits, but no other sizes. 80w0xffffbbbb12345342aaaa is not a supported size + hdr.ethernet.val = 0xFFFFBBBB12345342AAAA; + ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testdata/p4_16_dpdk_errors_outputs/psa-dpdk-128bitCast_error.p4.bfrt.json b/testdata/p4_16_dpdk_errors_outputs/psa-dpdk-128bitCast_error.p4.bfrt.json new file mode 100644 index 00000000000..70676b2554e --- /dev/null +++ b/testdata/p4_16_dpdk_errors_outputs/psa-dpdk-128bitCast_error.p4.bfrt.json @@ -0,0 +1,39 @@ +{ + "schema_version" : "1.0.0", + "tables" : [ + { + "name" : "ip.MyIngressControl.stub", + "id" : 43002152, + "table_type" : "MatchAction_Direct", + "size" : 1000000, + "annotations" : [], + "depends_on" : [], + "has_const_default_action" : false, + "key" : [], + "action_specs" : [ + { + "id" : 20013177, + "name" : "MyIngressControl.macswp", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + }, + { + "id" : 21257015, + "name" : "NoAction", + "action_scope" : "DefaultOnly", + "annotations" : [ + { + "name" : "@defaultonly" + } + ], + "data" : [] + } + ], + "data" : [], + "supported_operations" : [], + "attributes" : ["EntryScope"] + } + ], + "learn_filters" : [] +} \ No newline at end of file diff --git a/testdata/p4_16_dpdk_errors/pna-dpdk-large-constants.p4 b/testdata/p4_16_samples/pna-dpdk-large-constants.p4 similarity index 100% rename from testdata/p4_16_dpdk_errors/pna-dpdk-large-constants.p4 rename to testdata/p4_16_samples/pna-dpdk-large-constants.p4 diff --git a/testdata/p4_16_samples/pna-dpdk_128bit_odd_size.p4 b/testdata/p4_16_samples/pna-dpdk_128bit_odd_size.p4 new file mode 100644 index 00000000000..7b620a2681e --- /dev/null +++ b/testdata/p4_16_samples/pna-dpdk_128bit_odd_size.p4 @@ -0,0 +1,126 @@ +/* +Copyright 2024 Andy Fingerhut + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include +#include "dpdk/pna.p4" + + +typedef bit<48> EthernetAddress; + +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header custom_t { + bit<1> padding; + bit<1> f1; + bit<2> f2; + bit<4> f4; + bit<8> f8; + bit<16> f16; + bit<32> f32; + bit<64> f64; + bit<128> f128; +} + +struct main_metadata_t { +} + +struct headers_t { + ethernet_t ethernet; + custom_t custom; +} + +control PreControlImpl( + in headers_t hdr, + inout main_metadata_t meta, + in pna_pre_input_metadata_t istd, + inout pna_pre_output_metadata_t ostd) +{ + apply { + } +} + +parser MainParserImpl( + packet_in pkt, + out headers_t hdr, + inout main_metadata_t main_meta, + in pna_main_parser_input_metadata_t istd) +{ + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 0x08ff: parse_custom; + default: accept; + } + } + state parse_custom { + pkt.extract(hdr.custom); + transition accept; + } +} + +control MainControlImpl( + inout headers_t hdr, + inout main_metadata_t user_meta, + in pna_main_input_metadata_t istd, + inout pna_main_output_metadata_t ostd) +{ + action a1(bit<73> x) { + hdr.custom.f128 = (bit<128>) x; + } + table t1 { + key = { + hdr.ethernet.dstAddr: exact; + } + actions = { + @tableonly a1; + @defaultonly NoAction; + } + size = 512; + const default_action = NoAction(); + } + apply { + if (hdr.custom.isValid()) { + t1.apply(); + } + } +} + +control MainDeparserImpl( + packet_out pkt, + in headers_t hdr, + in main_metadata_t user_meta, + in pna_main_output_metadata_t ostd) +{ + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.custom); + } +} + +PNA_NIC( + MainParserImpl(), + PreControlImpl(), + MainControlImpl(), + MainDeparserImpl() + // Hoping to make this optional parameter later, but not supported + // by p4c yet. + //, PreParserImpl() + ) main; + diff --git a/testdata/p4_16_samples/pna-ipv6-actions.p4 b/testdata/p4_16_samples/pna-ipv6-actions.p4 index 56f85e02c9b..18214c5b1ca 100644 --- a/testdata/p4_16_samples/pna-ipv6-actions.p4 +++ b/testdata/p4_16_samples/pna-ipv6-actions.p4 @@ -125,18 +125,36 @@ control MainControlImpl( headers.ipv6.dstAddr = tmp & headers.ipv6.srcAddr; } + action ipv6_addr_and2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr & 128w0x123456789abcdef12345678; + } + + action ipv6_addr_or2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr | 128w0x123456789abcdef; + } + action ipv6_addr_xor() { headers.ipv6.dstAddr = headers.ipv6.dstAddr ^ tmp; } - action ipv6_addr_comp1() { - headers.ipv6.dstAddr = (headers.ipv6.dstAddr == headers.ipv6.srcAddr) ? headers.ipv6.dstAddr : headers.ipv6.srcAddr; + action ipv6_addr_xor2(bit<128> arg) { + headers.ipv6.dstAddr = arg; } - action ipv6_addr_comp2() { - headers.ipv6.dstAddr = (headers.ipv6.dstAddr != headers.ipv6.srcAddr) ? headers.ipv6.dstAddr : headers.ipv6.srcAddr; + action ipv6_modify_dstAddr2(bit<32> dstAddr) { + headers.ipv6.dstAddr = (bit<128>)dstAddr; + } + action ipv6_swap_addr2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr; + headers.ipv6.srcAddr = 128w0x123456789abcdef0AABBCCDDEEFF0011; } + action ipv6_addr_comp1() { + headers.ipv6.dstAddr = (headers.ipv6.dstAddr == headers.ipv6.srcAddr ? headers.ipv6.dstAddr : headers.ipv6.srcAddr); + } + action ipv6_addr_comp2() { + headers.ipv6.dstAddr = (headers.ipv6.dstAddr != headers.ipv6.srcAddr ? headers.ipv6.dstAddr : headers.ipv6.srcAddr); + } action ipv6_addr_cmpl() { headers.ipv6.dstAddr = ~headers.ipv6.srcAddr; } @@ -181,8 +199,13 @@ control MainControlImpl( ipv6_swap_addr; set_flowlabel; ipv6_addr_or; - ipv6_addr_xor; + ipv6_addr_or2; // + ipv6_addr_xor; // + ipv6_addr_xor2; // ipv6_addr_and; + ipv6_addr_and2; // + ipv6_modify_dstAddr2; // + ipv6_swap_addr2; // ipv6_addr_comp1; ipv6_addr_comp2; ipv6_addr_cmpl; diff --git a/testdata/p4_16_dpdk_errors_outputs/dash-pipeline-pna-dpdk.p4-error b/testdata/p4_16_samples_outputs/dash/dash-pipeline-pna-dpdk.p4-error similarity index 91% rename from testdata/p4_16_dpdk_errors_outputs/dash-pipeline-pna-dpdk.p4-error rename to testdata/p4_16_samples_outputs/dash/dash-pipeline-pna-dpdk.p4-error index 0ae4fcf0047..fe960b51439 100644 --- a/testdata/p4_16_dpdk_errors_outputs/dash-pipeline-pna-dpdk.p4-error +++ b/testdata/p4_16_samples_outputs/dash/dash-pipeline-pna-dpdk.p4-error @@ -97,10 +97,3 @@ dash-pipeline-pna-dpdk.p4(936): [--Wwarn=invalid_header] warning: accessing a fi [--Wwarn=mismatch] warning: Mismatched header/metadata struct for key elements in table metering_update_stage_meter_rule. Copying all match fields to metadata [--Wwarn=mismatch] warning: Mismatched header/metadata struct for key elements in table metering_update_stage_meter_bucket. Copying all match fields to metadata [--Wwarn=mismatch] warning: Mismatched header/metadata struct for key elements in table metering_update_stage_eni_meter. Copying all match fields to metadata -[--Werror=overlimit] error: DPDK target supports up-to 64-bit immediate values, 128w0xffffffffffffffffffffffff exceeds the limit -[--Werror=overlimit] error: DPDK target supports up-to 64-bit immediate values, 128w0xffffffffffffffffffffffff exceeds the limit -[--Werror=overlimit] error: DPDK target supports up-to 64-bit immediate values, 128w0xffffffffffffffffffffffff exceeds the limit -[--Werror=overlimit] error: DPDK target supports up-to 64-bit immediate values, 128w0xffffffffffffffffffffffff exceeds the limit -dash-pipeline-pna-dpdk.p4(719): [--Werror=overlimit] error: DPDK target supports up-to 64-bit immediate values, 128w0xffffffffffffffffffffffff exceeds the limit -...apping(inout headers_t hdr, inout metadata_t meta, @SaiVal[type="sai_ip_address_t"] IPv4Addres... - ^^^^ diff --git a/testdata/p4_16_dpdk_errors_outputs/dash-pipeline-pna-dpdk.p4.bfrt.json b/testdata/p4_16_samples_outputs/dash/dash-pipeline-pna-dpdk.p4.bfrt.json similarity index 100% rename from testdata/p4_16_dpdk_errors_outputs/dash-pipeline-pna-dpdk.p4.bfrt.json rename to testdata/p4_16_samples_outputs/dash/dash-pipeline-pna-dpdk.p4.bfrt.json diff --git a/testdata/p4_16_samples_outputs/dash/dash-pipeline-pna-dpdk.p4.spec b/testdata/p4_16_samples_outputs/dash/dash-pipeline-pna-dpdk.p4.spec new file mode 100644 index 00000000000..093f66df09b --- /dev/null +++ b/testdata/p4_16_samples_outputs/dash/dash-pipeline-pna-dpdk.p4.spec @@ -0,0 +1,2194 @@ + +struct ethernet_t { + bit<48> dst_addr + bit<48> src_addr + bit<16> ether_type +} + +struct ipv4_t { + bit<8> version_ihl + bit<8> diffserv + bit<16> total_len + bit<16> identification + bit<16> flags_frag_offset + bit<8> ttl + bit<8> protocol + bit<16> hdr_checksum + bit<32> src_addr + bit<32> dst_addr +} + +struct ipv4options_t { + varbit<320> options +} + +struct ipv6_t { + ;oldname:version_traffic_class_flow_label + bit<32> version_traffic_class_flow_la0 + bit<16> payload_length + bit<8> next_header + bit<8> hop_limit + bit<128> src_addr + bit<128> dst_addr +} + +struct udp_t { + bit<16> src_port + bit<16> dst_port + bit<16> length + bit<16> checksum +} + +struct tcp_t { + bit<16> src_port + bit<16> dst_port + bit<32> seq_no + bit<32> ack_no + bit<16> data_offset_res_ecn_flags + bit<16> window + bit<16> checksum + bit<16> urgent_ptr +} + +struct vxlan_t { + bit<8> flags + bit<24> reserved + bit<24> vni + bit<8> reserved_2 +} + +struct nvgre_t { + bit<16> flags_reserved_version + bit<16> protocol_type + bit<24> vsid + bit<8> flow_id +} + +struct dpdk_pseudo_header_t { + bit<32> pseudo + bit<32> pseudo_0 + bit<64> pseudo_1 + bit<64> pseudo_2 +} + +struct _p4c_tmp128_t { + bit<64> inter +} + +struct _p4c_sandbox_header_t { + bit<64> upper_half + bit<64> lower_half +} + +struct eni_lookup_stage_set_eni_0_arg_t { + bit<16> eni_id +} + +struct metering_update_stage_check_ip_addr_family_0_arg_t { + bit<32> ip_addr_family +} + +struct metering_update_stage_meter_bucket_action_0_arg_t { + bit<32> meter_bucket_index +} + +struct metering_update_stage_set_policy_meter_class_0_arg_t { + bit<16> meter_class +} + +struct outbound_outbound_mapping_stage_set_vnet_attrs_0_arg_t { + bit<24> vni +} + +struct route_direct_0_arg_t { + bit<8> meter_policy_en + bit<16> meter_class +} + +struct route_service_tunnel_0_arg_t { + bit<8> overlay_dip_is_v6 + bit<128> overlay_dip + bit<8> overlay_dip_mask_is_v6 + bit<128> overlay_dip_mask + bit<8> overlay_sip_is_v6 + bit<128> overlay_sip + bit<8> overlay_sip_mask_is_v6 + bit<128> overlay_sip_mask + bit<8> underlay_dip_is_v6 + bit<128> underlay_dip + bit<8> underlay_sip_is_v6 + bit<128> underlay_sip + bit<16> dash_encapsulation + bit<24> tunnel_key + bit<8> meter_policy_en + bit<16> meter_class +} + +struct route_vnet_0_arg_t { + bit<16> dst_vnet_id + bit<8> meter_policy_en + bit<16> meter_class +} + +struct route_vnet_direct_0_arg_t { + bit<16> dst_vnet_id + bit<8> overlay_ip_is_v6 + bit<128> overlay_ip + bit<8> meter_policy_en + bit<16> meter_class +} + +struct set_acl_group_attrs_arg_t { + bit<32> ip_addr_family +} + +struct set_appliance_arg_t { + bit<48> neighbor_mac + bit<48> mac +} + +struct set_eni_attrs_arg_t { + bit<32> cps + bit<32> pps + bit<32> flows + bit<8> admin_state + bit<32> vm_underlay_dip + bit<24> vm_vni + bit<16> vnet_id + bit<128> pl_sip + bit<128> pl_sip_mask + bit<32> pl_underlay_sip + bit<16> v4_meter_policy_id + bit<16> v6_meter_policy_id + bit<16> dash_tunnel_dscp_mode + bit<8> dscp + bit<16> inbound_v4_stage1_dash_acl_group_id + bit<16> inbound_v4_stage2_dash_acl_group_id + bit<16> inbound_v4_stage3_dash_acl_group_id + bit<16> inbound_v4_stage4_dash_acl_group_id + bit<16> inbound_v4_stage5_dash_acl_group_id + bit<16> inbound_v6_stage1_dash_acl_group_id + bit<16> inbound_v6_stage2_dash_acl_group_id + bit<16> inbound_v6_stage3_dash_acl_group_id + bit<16> inbound_v6_stage4_dash_acl_group_id + bit<16> inbound_v6_stage5_dash_acl_group_id + bit<16> outbound_v4_stage1_dash_acl_group_id + bit<16> outbound_v4_stage2_dash_acl_group_id + bit<16> outbound_v4_stage3_dash_acl_group_id + bit<16> outbound_v4_stage4_dash_acl_group_id + bit<16> outbound_v4_stage5_dash_acl_group_id + bit<16> outbound_v6_stage1_dash_acl_group_id + bit<16> outbound_v6_stage2_dash_acl_group_id + bit<16> outbound_v6_stage3_dash_acl_group_id + bit<16> outbound_v6_stage4_dash_acl_group_id + bit<16> outbound_v6_stage5_dash_acl_group_id + bit<8> disable_fast_path_icmp_flow_redirection +} + +struct set_private_link_mapping_0_arg_t { + bit<32> underlay_dip + bit<128> overlay_sip + bit<128> overlay_dip + bit<16> dash_encapsulation + bit<24> tunnel_key + bit<16> meter_class + bit<8> meter_class_override +} + +struct set_tunnel_mapping_0_arg_t { + bit<32> underlay_dip + bit<48> overlay_dmac + bit<8> use_dst_vnet_vni + bit<16> meter_class + bit<8> meter_class_override +} + +struct tunnel_decap_pa_validate_arg_t { + bit<16> src_vnet_id +} + +struct underlay_pkt_act_0_arg_t { + bit<16> packet_action + bit<16> next_hop_id +} + +header u1_ethernet instanceof ethernet_t +header u1_ipv4 instanceof ipv4_t +header u1_ipv4options instanceof ipv4options_t +header u1_ipv6 instanceof ipv6_t +header u1_udp instanceof udp_t +header u1_tcp instanceof tcp_t +header u1_vxlan instanceof vxlan_t +header u1_nvgre instanceof nvgre_t +header u0_ethernet instanceof ethernet_t +header u0_ipv4 instanceof ipv4_t +header u0_ipv4options instanceof ipv4options_t +header u0_ipv6 instanceof ipv6_t +header u0_udp instanceof udp_t +header u0_tcp instanceof tcp_t +header u0_vxlan instanceof vxlan_t +header u0_nvgre instanceof nvgre_t +header customer_ethernet instanceof ethernet_t +header customer_ipv4 instanceof ipv4_t +header customer_ipv6 instanceof ipv6_t +header customer_udp instanceof udp_t +header customer_tcp instanceof tcp_t +header dpdk_pseudo_header instanceof dpdk_pseudo_header_t + +struct metadata_t { + bit<16> pna_pre_input_metadata_parser_error + bit<32> pna_main_input_metadata_input_port + bit<16> local_metadata___direction00 + bit<48> local_metadata___eni_addr11 + bit<16> local_metadata___vnet_id22 + bit<16> local_metadata___dst_vnet_id33 + bit<16> local_metadata___eni_id44 + bit<32> local_metadata___eni_data_cps55 + bit<32> local_metadata___eni_data_pps66 + bit<32> local_metadata___eni_data_flows77 + bit<8> local_metadata___eni_data_admin_state88 + bit<128> local_metadata___eni_data_pl_sip99 + bit<128> local_metadata___eni_data_pl_sip_mask1010 + bit<32> local_metadata___eni_data_pl_underlay_sip1111 + bit<8> local_metadata___eni_data_dscp1212 + bit<16> local_metadata___eni_data_dscp_mode1313 + bit<8> local_metadata___appliance_id1515 + bit<8> local_metadata___is_overlay_ip_v61616 + bit<8> local_metadata___is_lkup_dst_ip_v61717 + bit<8> local_metadata___ip_protocol1818 + bit<128> local_metadata___dst_ip_addr1919 + bit<128> local_metadata___src_ip_addr2020 + bit<128> local_metadata___lkup_dst_ip_addr2121 + bit<8> local_metadata___conntrack_data_allow_in2222 + bit<8> local_metadata___conntrack_data_allow_out2323 + bit<16> local_metadata___src_l4_port2424 + bit<16> local_metadata___dst_l4_port2525 + bit<16> local_metadata___stage1_dash_acl_group_id2626 + bit<16> local_metadata___stage2_dash_acl_group_id2727 + bit<16> local_metadata___stage3_dash_acl_group_id2828 + bit<16> local_metadata___stage4_dash_acl_group_id2929 + bit<16> local_metadata___stage5_dash_acl_group_id3030 + bit<8> local_metadata___meter_policy_en3131 + bit<8> local_metadata___mapping_meter_class_override3232 + bit<16> local_metadata___meter_policy_id3333 + bit<16> local_metadata___policy_meter_class3434 + bit<16> local_metadata___route_meter_class3535 + bit<16> local_metadata___mapping_meter_class3636 + bit<16> local_metadata___meter_class3737 + bit<32> local_metadata___meter_bucket_index3838 + bit<16> local_metadata___tunnel_pointer3939 + ;oldname:local_metadata___fast_path_icmp_flow_redirection_disabled4141 + bit<8> local_metadata___fast_path_icmp_flow_redirection_disabled411 + bit<16> local_metadata___target_stage4242 + bit<32> local_metadata___routing_actions4343 + bit<8> local_metadata___dropped4444 + bit<24> local_metadata___encap_data_vni4545 + bit<32> local_metadata___encap_data_underlay_sip4747 + bit<32> local_metadata___encap_data_underlay_dip4848 + bit<48> local_metadata___encap_data_underlay_smac4949 + bit<48> local_metadata___encap_data_underlay_dmac5050 + bit<16> local_metadata___encap_data_dash_encapsulation5151 + bit<8> local_metadata___overlay_data_is_ipv65252 + bit<48> local_metadata___overlay_data_dmac5353 + bit<128> local_metadata___overlay_data_sip5454 + bit<128> local_metadata___overlay_data_dip5555 + bit<128> local_metadata___overlay_data_sip_mask5656 + bit<128> local_metadata___overlay_data_dip_mask5757 + bit<8> local_metadata__meta_43_overlay_data_is_ipv658 + bit<48> local_metadata__meta_43_overlay_data_dmac59 + bit<128> local_metadata__meta_43_overlay_data_sip60 + bit<128> local_metadata__meta_43_overlay_data_dip61 + bit<128> local_metadata__meta_43_overlay_data_sip_mask62 + bit<128> local_metadata__meta_43_overlay_data_dip_mask63 + bit<32> pna_main_output_metadata_output_port + bit<16> dash_ingress_pa_validation_local_metadata___vnet_id22 + bit<32> dash_ingress_pa_validation_u0_ipv4_src_addr + bit<24> dash_ingress_inbound_routing_u0_vxlan_vni + bit<32> dash_ingress_inbound_routing_u0_ipv4_src_addr + ;oldname:dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local_metadata___dst_vnet_id33 + bit<16> dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local2 + ;oldname:dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local_metadata___is_lkup_dst_ip_v61717 + bit<8> dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local3 + ;oldname:dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local_metadata___lkup_dst_ip_addr2121 + bit<128> dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local4 + ;oldname:dash_ingress_metering_update_stage_meter_rule_u0_ipv4_dst_addr + bit<32> dash_ingress_metering_update_stage_meter_rule_u0_ipv4_dst_a5 + ;oldname:dash_ingress_metering_update_stage_meter_bucket_local_metadata___eni_id44 + bit<16> dash_ingress_metering_update_stage_meter_bucket_local_metad6 + ;oldname:dash_ingress_metering_update_stage_meter_bucket_local_metadata___meter_class3737 + bit<16> dash_ingress_metering_update_stage_meter_bucket_local_metad7 + ;oldname:dash_ingress_metering_update_stage_eni_meter_local_metadata___eni_id44 + bit<16> dash_ingress_metering_update_stage_eni_meter_local_metadata8 + ;oldname:dash_ingress_metering_update_stage_eni_meter_local_metadata___direction00 + bit<16> dash_ingress_metering_update_stage_eni_meter_local_metadata9 + ;oldname:dash_ingress_metering_update_stage_eni_meter_local_metadata___dropped4444 + bit<8> dash_ingress_metering_update_stage_eni_meter_local_metadat10 + bit<8> MainParserT_parser_tmp + bit<8> MainParserT_parser_tmp_0 + bit<8> MainParserT_parser_tmp_1 + bit<8> MainParserT_parser_tmp_3 + bit<8> MainParserT_parser_tmp_4 + bit<8> MainParserT_parser_tmp_6 + bit<8> MainParserT_parser_tmp_7 + bit<8> MainParserT_parser_tmp_8 + bit<8> MainParserT_parser_tmp_10 + bit<8> MainParserT_parser_tmp_11 + bit<8> MainParserT_parser_tmp_13 + bit<8> MainParserT_parser_tmp_14 + bit<8> MainParserT_parser_tmp_15 + bit<8> MainParserT_parser_tmp_16 + bit<16> MainParserT_parser_tmp_19 + bit<16> MainParserT_parser_tmp_20 + bit<8> MainParserT_parser_tmp_21 + bit<8> MainParserT_parser_tmp_22 + bit<8> MainParserT_parser_tmp_23 + bit<8> MainParserT_parser_tmp_24 + bit<32> MainControlT_tmp + bit<32> MainControlT_tmp_0 + bit<32> MainControlT_tmp_1 + bit<128> MainControlT_tmp_2 + bit<128> MainControlT_tmp_3 + bit<128> MainControlT_tmp_4 + bit<128> MainControlT_tmp_5 + bit<128> MainControlT_tmp_6 + bit<128> MainControlT_tmp_7 + bit<32> MainControlT_tmp_8 + bit<128> MainControlT_tmp_9 + bit<128> MainControlT_tmp_10 + bit<128> MainControlT_tmp_11 + bit<128> MainControlT_tmp_12 + bit<128> MainControlT_tmp_13 + bit<128> MainControlT_tmp_14 + bit<128> MainControlT_tmp_15 + bit<128> MainControlT_tmp_16 + bit<32> MainControlT_tmp_17 + bit<16> MainControlT_tmp_18 + bit<8> MainControlT_tmp_19 + bit<8> MainControlT_tmp_20 + bit<16> MainControlT_tmp_21 + bit<16> MainControlT_tmp_22 + bit<16> MainControlT_tmp_23 + bit<8> MainControlT_tmp_24 + bit<8> MainControlT_tmp_25 + bit<16> MainControlT_tmp_26 + bit<16> MainControlT_tmp_27 + bit<16> MainControlT_tmp_28 + bit<8> MainControlT_tmp_29 + bit<8> MainControlT_tmp_30 + bit<16> MainControlT_tmp_31 + bit<16> MainControlT_tmp_32 + bit<16> MainControlT_tmp_33 + bit<8> MainControlT_tmp_34 + bit<8> MainControlT_tmp_35 + bit<16> MainControlT_tmp_36 + bit<16> MainControlT_tmp_37 + bit<16> MainControlT_tmp_38 + bit<8> MainControlT_tmp_39 + bit<8> MainControlT_tmp_40 + bit<16> MainControlT_tmp_41 + bit<16> MainControlT_tmp_42 + bit<16> MainControlT_tmp_43 + bit<8> MainControlT_tmp_44 + bit<8> MainControlT_tmp_45 + bit<16> MainControlT_tmp_46 + bit<16> MainControlT_tmp_47 + bit<8> MainControlT_tmp_48 + bit<8> MainControlT_tmp_49 + bit<8> MainControlT_tmp_50 + bit<32> MainControlT_tmp_51 + bit<32> MainControlT_tmp_52 + bit<32> MainControlT_tmp_53 + bit<128> MainControlT_tmp_55 + bit<128> MainControlT_tmp_56 + bit<128> MainControlT_tmp_57 + bit<128> MainControlT_tmp_59 + bit<128> MainControlT_tmp_60 + bit<128> MainControlT_tmp_61 + bit<8> MainControlT_tmp_62 + bit<8> MainControlT_tmp_63 + bit<16> MainControlT_tmp_64 + bit<16> MainControlT_tmp_65 + bit<128> MainControlT_tmp_66 + bit<128> MainControlT_tmp_67 + bit<128> MainControlT_tmp_68 + bit<128> MainControlT_tmp_69 + bit<128> MainControlT_tmp_70 + bit<128> MainControlT_tmp_71 + bit<32> MainControlT_tmp_72 + bit<32> MainControlT_tmp_73 + bit<24> MainControlT_tmp_74 + bit<32> MainControlT_tmp_77 + bit<32> MainControlT_tmp_78 + bit<48> MainControlT_tmp_79 + bit<24> MainControlT_tmp_80 + bit<32> MainControlT_tmp_83 + bit<32> MainControlT_tmp_84 + bit<48> MainControlT_tmp_85 + bit<24> MainControlT_tmp_86 + bit<32> MainControlT_tmp_89 + bit<32> MainControlT_tmp_90 + bit<48> MainControlT_tmp_91 + bit<16> MainControlT_customer_ip_len + bit<16> MainControlT_customer_ip_len_0 + bit<16> MainControlT_customer_ip_len_1 + bit<16> MainControlT_u0_ip_len + bit<16> MainControlT_u0_ip_len_0 + bit<16> MainControlT_u0_ip_len_1 + bit<48> MainControlT_eni_lookup_stage_tmp + bit<8> MainControlT_outbound_acl_hasReturned + bit<8> MainControlT_inbound_acl_hasReturned + bit<16> MainControlT_meta_42_vnet_id + bit<32> MainParserT_parser_tmp_26_extract_tmp +} +metadata instanceof metadata_t + +header local_metadata___overlay_data_dip_mask5757_128 instanceof _p4c_sandbox_header_t +header local_metadata___overlay_data_dip_mask5757_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_56_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_56_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_55_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_57_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_57_tmp instanceof _p4c_tmp128_t +header dst_addr_128 instanceof _p4c_sandbox_header_t +header dst_addr_tmp instanceof _p4c_tmp128_t +header local_metadata___overlay_data_sip_mask5656_128 instanceof _p4c_sandbox_header_t +header local_metadata___overlay_data_sip_mask5656_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_60_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_60_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_59_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_61_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_61_tmp instanceof _p4c_tmp128_t +header src_addr_128 instanceof _p4c_sandbox_header_t +header src_addr_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_66_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_66_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_67_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_67_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_68_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_68_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_69_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_69_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_70_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_70_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_71_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_71_tmp instanceof _p4c_tmp128_t +header underlay_sip_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_2_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_2_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_3_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_3_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_4_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_4_tmp instanceof _p4c_tmp128_t +header underlay_dip_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_5_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_5_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_6_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_6_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_7_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_7_tmp instanceof _p4c_tmp128_t +header local_metadata___eni_data_pl_sip_mask1010_128 instanceof _p4c_sandbox_header_t +header local_metadata___eni_data_pl_sip_mask1010_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_10_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_10_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_9_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_11_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_11_tmp instanceof _p4c_tmp128_t +header local_metadata___eni_data_pl_sip99_128 instanceof _p4c_sandbox_header_t +header local_metadata__meta_43_overlay_data_sip60_128 instanceof _p4c_sandbox_header_t +header local_metadata__meta_43_overlay_data_sip60_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_12_128 instanceof _p4c_sandbox_header_t +header local_metadata__meta_43_overlay_data_sip_mask62_128 instanceof _p4c_sandbox_header_t +header local_metadata__meta_43_overlay_data_dip_mask63_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_14_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_14_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_13_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_15_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_15_tmp instanceof _p4c_tmp128_t +header MainControlT_tmp_16_128 instanceof _p4c_sandbox_header_t +regarray direction size 0x100 initval 0 +action NoAction args none { + return +} + +action tunnel_decap_1 args none { + mov m.local_metadata___tunnel_pointer3939 0x0 + return +} + +action route_vnet_0 args instanceof route_vnet_0_arg_t { + mov m.local_metadata___dst_vnet_id33 t.dst_vnet_id + mov m.local_metadata___meter_policy_en3131 t.meter_policy_en + mov m.local_metadata___route_meter_class3535 t.meter_class + mov m.local_metadata___target_stage4242 0xC9 + return +} + +action route_vnet_direct_0 args instanceof route_vnet_direct_0_arg_t { + mov m.local_metadata___dst_vnet_id33 t.dst_vnet_id + mov m.local_metadata___is_lkup_dst_ip_v61717 t.overlay_ip_is_v6 + mov m.local_metadata___lkup_dst_ip_addr2121 t.overlay_ip + mov m.local_metadata___meter_policy_en3131 t.meter_policy_en + mov m.local_metadata___route_meter_class3535 t.meter_class + mov m.local_metadata___target_stage4242 0xC9 + return +} + +action route_direct_0 args instanceof route_direct_0_arg_t { + mov m.local_metadata___meter_policy_en3131 t.meter_policy_en + mov m.local_metadata___route_meter_class3535 t.meter_class + mov m.local_metadata___target_stage4242 0x12C + return +} + +action route_service_tunnel_0 args instanceof route_service_tunnel_0_arg_t { + movh h.underlay_sip_128.upper_half t.underlay_sip + mov h.underlay_sip_128.lower_half t.underlay_sip + xor h.underlay_sip_128.upper_half 0x0 + xor h.underlay_sip_128.lower_half 0x0 + xor h.underlay_sip_128.upper_half h.underlay_sip_128.lower_half + jmpneq LABEL_FALSE_55 h.underlay_sip_128.upper_half 0x0 + mov m.MainControlT_tmp_72 h.u0_ipv4.src_addr + jmp LABEL_END_59 + LABEL_FALSE_55 : mov m.MainControlT_tmp_2 t.underlay_sip + movh h.MainControlT_tmp_2_128.upper_half m.MainControlT_tmp_2 + mov h.MainControlT_tmp_2_128.lower_half m.MainControlT_tmp_2 + mov h.MainControlT_tmp_2_tmp.inter h.MainControlT_tmp_2_128.lower_half + and h.MainControlT_tmp_2_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_2 h.MainControlT_tmp_2_tmp.inter + mov h.MainControlT_tmp_2_tmp.inter h.MainControlT_tmp_2_128.upper_half + and h.MainControlT_tmp_2_tmp.inter 0x0 + movh m.MainControlT_tmp_2 h.MainControlT_tmp_2_tmp.inter + mov m.MainControlT_tmp_3 m.MainControlT_tmp_2 + movh h.MainControlT_tmp_3_128.upper_half m.MainControlT_tmp_3 + mov h.MainControlT_tmp_3_128.lower_half m.MainControlT_tmp_3 + mov h.MainControlT_tmp_3_tmp.inter h.MainControlT_tmp_3_128.lower_half + and h.MainControlT_tmp_3_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_3 h.MainControlT_tmp_3_tmp.inter + mov h.MainControlT_tmp_3_tmp.inter h.MainControlT_tmp_3_128.upper_half + and h.MainControlT_tmp_3_tmp.inter 0x0 + movh m.MainControlT_tmp_3 h.MainControlT_tmp_3_tmp.inter + mov m.MainControlT_tmp_4 m.MainControlT_tmp_3 + movh h.MainControlT_tmp_4_128.upper_half m.MainControlT_tmp_4 + mov h.MainControlT_tmp_4_128.lower_half m.MainControlT_tmp_4 + mov h.MainControlT_tmp_4_tmp.inter h.MainControlT_tmp_4_128.lower_half + and h.MainControlT_tmp_4_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_4 h.MainControlT_tmp_4_tmp.inter + mov h.MainControlT_tmp_4_tmp.inter h.MainControlT_tmp_4_128.upper_half + and h.MainControlT_tmp_4_tmp.inter 0x0 + movh m.MainControlT_tmp_4 h.MainControlT_tmp_4_tmp.inter + mov h.dpdk_pseudo_header.pseudo m.MainControlT_tmp_4 + mov m.MainControlT_tmp_72 h.dpdk_pseudo_header.pseudo + LABEL_END_59 : movh h.underlay_dip_128.upper_half t.underlay_dip + mov h.underlay_dip_128.lower_half t.underlay_dip + xor h.underlay_dip_128.upper_half 0x0 + xor h.underlay_dip_128.lower_half 0x0 + xor h.underlay_dip_128.upper_half h.underlay_dip_128.lower_half + jmpneq LABEL_FALSE_56 h.underlay_dip_128.upper_half 0x0 + mov m.MainControlT_tmp_73 h.u0_ipv4.dst_addr + jmp LABEL_END_60 + LABEL_FALSE_56 : mov m.MainControlT_tmp_5 t.underlay_dip + movh h.MainControlT_tmp_5_128.upper_half m.MainControlT_tmp_5 + mov h.MainControlT_tmp_5_128.lower_half m.MainControlT_tmp_5 + mov h.MainControlT_tmp_5_tmp.inter h.MainControlT_tmp_5_128.lower_half + and h.MainControlT_tmp_5_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_5 h.MainControlT_tmp_5_tmp.inter + mov h.MainControlT_tmp_5_tmp.inter h.MainControlT_tmp_5_128.upper_half + and h.MainControlT_tmp_5_tmp.inter 0x0 + movh m.MainControlT_tmp_5 h.MainControlT_tmp_5_tmp.inter + mov m.MainControlT_tmp_6 m.MainControlT_tmp_5 + movh h.MainControlT_tmp_6_128.upper_half m.MainControlT_tmp_6 + mov h.MainControlT_tmp_6_128.lower_half m.MainControlT_tmp_6 + mov h.MainControlT_tmp_6_tmp.inter h.MainControlT_tmp_6_128.lower_half + and h.MainControlT_tmp_6_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_6 h.MainControlT_tmp_6_tmp.inter + mov h.MainControlT_tmp_6_tmp.inter h.MainControlT_tmp_6_128.upper_half + and h.MainControlT_tmp_6_tmp.inter 0x0 + movh m.MainControlT_tmp_6 h.MainControlT_tmp_6_tmp.inter + mov m.MainControlT_tmp_7 m.MainControlT_tmp_6 + movh h.MainControlT_tmp_7_128.upper_half m.MainControlT_tmp_7 + mov h.MainControlT_tmp_7_128.lower_half m.MainControlT_tmp_7 + mov h.MainControlT_tmp_7_tmp.inter h.MainControlT_tmp_7_128.lower_half + and h.MainControlT_tmp_7_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_7 h.MainControlT_tmp_7_tmp.inter + mov h.MainControlT_tmp_7_tmp.inter h.MainControlT_tmp_7_128.upper_half + and h.MainControlT_tmp_7_tmp.inter 0x0 + movh m.MainControlT_tmp_7 h.MainControlT_tmp_7_tmp.inter + mov h.dpdk_pseudo_header.pseudo_0 m.MainControlT_tmp_7 + mov m.MainControlT_tmp_73 h.dpdk_pseudo_header.pseudo_0 + LABEL_END_60 : jmpneq LABEL_FALSE_57 t.tunnel_key 0x0 + mov m.MainControlT_tmp_74 m.local_metadata___encap_data_vni4545 + jmp LABEL_END_61 + LABEL_FALSE_57 : mov m.MainControlT_tmp_74 t.tunnel_key + LABEL_END_61 : jmpneq LABEL_FALSE_58 m.MainControlT_tmp_72 0x0 + mov m.MainControlT_tmp_77 m.local_metadata___encap_data_underlay_sip4747 + jmp LABEL_END_62 + LABEL_FALSE_58 : mov m.MainControlT_tmp_77 m.MainControlT_tmp_72 + LABEL_END_62 : jmpneq LABEL_FALSE_59 m.MainControlT_tmp_73 0x0 + mov m.MainControlT_tmp_78 m.local_metadata___encap_data_underlay_dip4848 + jmp LABEL_END_63 + LABEL_FALSE_59 : mov m.MainControlT_tmp_78 m.MainControlT_tmp_73 + LABEL_END_63 : jmpneq LABEL_FALSE_60 h.u0_ethernet.dst_addr 0x0 + mov m.MainControlT_tmp_79 m.local_metadata___overlay_data_dmac5353 + jmp LABEL_END_64 + LABEL_FALSE_60 : mov m.MainControlT_tmp_79 h.u0_ethernet.dst_addr + LABEL_END_64 : mov m.local_metadata___meter_policy_en3131 t.meter_policy_en + mov m.local_metadata___route_meter_class3535 t.meter_class + mov m.local_metadata___target_stage4242 0x12C + mov m.MainControlT_tmp_8 m.local_metadata___routing_actions4343 + or m.MainControlT_tmp_8 0x2 + mov m.local_metadata___routing_actions4343 m.MainControlT_tmp_8 + or m.local_metadata___routing_actions4343 0x1 + mov m.local_metadata___encap_data_dash_encapsulation5151 t.dash_encapsulation + mov m.local_metadata___overlay_data_is_ipv65252 1 + mov m.local_metadata___overlay_data_sip5454 t.overlay_sip + mov m.local_metadata___overlay_data_dip5555 t.overlay_dip + mov m.local_metadata___overlay_data_sip_mask5656 t.overlay_sip_mask + mov m.local_metadata___overlay_data_dip_mask5757 t.overlay_dip_mask + return +} + +action drop_1 args none { + mov m.local_metadata___target_stage4242 0x12C + mov m.local_metadata___dropped4444 1 + return +} + +action drop_2 args none { + mov m.local_metadata___target_stage4242 0x12C + mov m.local_metadata___dropped4444 1 + return +} + +action set_tunnel_mapping_0 args instanceof set_tunnel_mapping_0_arg_t { + mov m.MainControlT_meta_42_vnet_id m.local_metadata___vnet_id22 + jmpneq LABEL_END_65 t.use_dst_vnet_vni 0x1 + mov m.MainControlT_meta_42_vnet_id m.local_metadata___dst_vnet_id33 + LABEL_END_65 : mov m.MainControlT_tmp_80 m.local_metadata___encap_data_vni4545 + mov m.MainControlT_tmp_83 m.local_metadata___encap_data_underlay_sip4747 + jmpneq LABEL_FALSE_62 t.underlay_dip 0x0 + mov m.MainControlT_tmp_84 m.local_metadata___encap_data_underlay_dip4848 + jmp LABEL_END_66 + LABEL_FALSE_62 : mov m.MainControlT_tmp_84 t.underlay_dip + LABEL_END_66 : jmpneq LABEL_FALSE_63 t.overlay_dmac 0x0 + mov m.MainControlT_tmp_85 m.local_metadata___overlay_data_dmac5353 + jmp LABEL_END_67 + LABEL_FALSE_63 : mov m.MainControlT_tmp_85 t.overlay_dmac + LABEL_END_67 : mov m.local_metadata___mapping_meter_class_override3232 t.meter_class_override + mov m.local_metadata___mapping_meter_class3636 t.meter_class + mov m.local_metadata___target_stage4242 0x12C + or m.local_metadata___routing_actions4343 0x1 + mov m.local_metadata___encap_data_vni4545 m.MainControlT_tmp_80 + mov m.local_metadata___encap_data_underlay_sip4747 m.MainControlT_tmp_83 + mov m.local_metadata___encap_data_underlay_dip4848 m.MainControlT_tmp_84 + mov m.local_metadata___encap_data_dash_encapsulation5151 0x1 + mov m.local_metadata___overlay_data_dmac5353 m.MainControlT_tmp_85 + return +} + +action set_private_link_mapping_0 args instanceof set_private_link_mapping_0_arg_t { + mov m.local_metadata__meta_43_overlay_data_is_ipv658 m.local_metadata___overlay_data_is_ipv65252 + mov m.local_metadata__meta_43_overlay_data_dmac59 m.local_metadata___overlay_data_dmac5353 + mov m.local_metadata__meta_43_overlay_data_sip60 m.local_metadata___overlay_data_sip5454 + mov m.local_metadata__meta_43_overlay_data_dip61 m.local_metadata___overlay_data_dip5555 + mov m.local_metadata__meta_43_overlay_data_sip_mask62 m.local_metadata___overlay_data_sip_mask5656 + mov m.local_metadata__meta_43_overlay_data_dip_mask63 m.local_metadata___overlay_data_dip_mask5757 + jmpneq LABEL_FALSE_64 t.tunnel_key 0x0 + mov m.MainControlT_tmp_86 m.local_metadata___encap_data_vni4545 + jmp LABEL_END_68 + LABEL_FALSE_64 : mov m.MainControlT_tmp_86 t.tunnel_key + LABEL_END_68 : jmpneq LABEL_FALSE_65 m.local_metadata___eni_data_pl_underlay_sip1111 0x0 + mov m.MainControlT_tmp_89 m.local_metadata___encap_data_underlay_sip4747 + jmp LABEL_END_69 + LABEL_FALSE_65 : mov m.MainControlT_tmp_89 m.local_metadata___eni_data_pl_underlay_sip1111 + LABEL_END_69 : jmpneq LABEL_FALSE_66 t.underlay_dip 0x0 + mov m.MainControlT_tmp_90 m.local_metadata___encap_data_underlay_dip4848 + jmp LABEL_END_70 + LABEL_FALSE_66 : mov m.MainControlT_tmp_90 t.underlay_dip + LABEL_END_70 : jmpneq LABEL_FALSE_67 h.u0_ethernet.dst_addr 0x0 + mov m.MainControlT_tmp_91 m.local_metadata___overlay_data_dmac5353 + jmp LABEL_END_71 + LABEL_FALSE_67 : mov m.MainControlT_tmp_91 h.u0_ethernet.dst_addr + LABEL_END_71 : mov m.local_metadata__meta_43_overlay_data_is_ipv658 m.local_metadata___overlay_data_is_ipv65252 + mov m.local_metadata__meta_43_overlay_data_dmac59 m.MainControlT_tmp_91 + mov m.local_metadata__meta_43_overlay_data_sip60 m.local_metadata___overlay_data_sip5454 + mov m.local_metadata__meta_43_overlay_data_dip61 m.local_metadata___overlay_data_dip5555 + mov m.local_metadata__meta_43_overlay_data_sip_mask62 m.local_metadata___overlay_data_sip_mask5656 + mov m.local_metadata__meta_43_overlay_data_dip_mask63 m.local_metadata___overlay_data_dip_mask5757 + mov m.local_metadata__meta_43_overlay_data_is_ipv658 1 + mov m.local_metadata__meta_43_overlay_data_dmac59 m.MainControlT_tmp_91 + movh h.local_metadata___eni_data_pl_sip_mask1010_128.upper_half m.local_metadata___eni_data_pl_sip_mask1010 + mov h.local_metadata___eni_data_pl_sip_mask1010_128.lower_half m.local_metadata___eni_data_pl_sip_mask1010 + mov h.local_metadata___eni_data_pl_sip_mask1010_tmp.inter 0xFFFFFFFFFFFFFFFF + xor h.local_metadata___eni_data_pl_sip_mask1010_128.lower_half h.local_metadata___eni_data_pl_sip_mask1010_tmp.inter + xor h.local_metadata___eni_data_pl_sip_mask1010_128.upper_half h.local_metadata___eni_data_pl_sip_mask1010_tmp.inter + mov m.MainControlT_tmp_9 h.local_metadata___eni_data_pl_sip_mask1010_128.lower_half + movh m.MainControlT_tmp_9 h.local_metadata___eni_data_pl_sip_mask1010_128.upper_half + mov m.MainControlT_tmp_10 t.overlay_sip + movh h.MainControlT_tmp_10_128.upper_half m.MainControlT_tmp_10 + mov h.MainControlT_tmp_10_128.lower_half m.MainControlT_tmp_10 + movh h.MainControlT_tmp_9_128.upper_half m.MainControlT_tmp_9 + mov h.MainControlT_tmp_9_128.lower_half m.MainControlT_tmp_9 + mov h.MainControlT_tmp_10_tmp.inter h.MainControlT_tmp_10_128.lower_half + and h.MainControlT_tmp_10_tmp.inter h.MainControlT_tmp_9_128.lower_half + mov m.MainControlT_tmp_10 h.MainControlT_tmp_10_tmp.inter + mov h.MainControlT_tmp_10_tmp.inter h.MainControlT_tmp_10_128.upper_half + and h.MainControlT_tmp_10_tmp.inter h.MainControlT_tmp_9_128.upper_half + movh m.MainControlT_tmp_10 h.MainControlT_tmp_10_tmp.inter + mov m.MainControlT_tmp_11 m.MainControlT_tmp_10 + movh h.MainControlT_tmp_11_128.upper_half m.MainControlT_tmp_11 + mov h.MainControlT_tmp_11_128.lower_half m.MainControlT_tmp_11 + movh h.local_metadata___eni_data_pl_sip99_128.upper_half m.local_metadata___eni_data_pl_sip99 + mov h.local_metadata___eni_data_pl_sip99_128.lower_half m.local_metadata___eni_data_pl_sip99 + mov h.MainControlT_tmp_11_tmp.inter h.MainControlT_tmp_11_128.lower_half + or h.MainControlT_tmp_11_tmp.inter h.local_metadata___eni_data_pl_sip99_128.lower_half + mov m.MainControlT_tmp_11 h.MainControlT_tmp_11_tmp.inter + mov h.MainControlT_tmp_11_tmp.inter h.MainControlT_tmp_11_128.upper_half + or h.MainControlT_tmp_11_tmp.inter h.local_metadata___eni_data_pl_sip99_128.upper_half + movh m.MainControlT_tmp_11 h.MainControlT_tmp_11_tmp.inter + mov m.MainControlT_tmp_12 h.u0_ipv4.src_addr + mov m.local_metadata__meta_43_overlay_data_sip60 m.MainControlT_tmp_11 + movh h.local_metadata__meta_43_overlay_data_sip60_128.upper_half m.local_metadata__meta_43_overlay_data_sip60 + mov h.local_metadata__meta_43_overlay_data_sip60_128.lower_half m.local_metadata__meta_43_overlay_data_sip60 + movh h.MainControlT_tmp_12_128.upper_half m.MainControlT_tmp_12 + mov h.MainControlT_tmp_12_128.lower_half m.MainControlT_tmp_12 + mov h.local_metadata__meta_43_overlay_data_sip60_tmp.inter h.local_metadata__meta_43_overlay_data_sip60_128.lower_half + or h.local_metadata__meta_43_overlay_data_sip60_tmp.inter h.MainControlT_tmp_12_128.lower_half + mov m.local_metadata__meta_43_overlay_data_sip60 h.local_metadata__meta_43_overlay_data_sip60_tmp.inter + mov h.local_metadata__meta_43_overlay_data_sip60_tmp.inter h.local_metadata__meta_43_overlay_data_sip60_128.upper_half + or h.local_metadata__meta_43_overlay_data_sip60_tmp.inter h.MainControlT_tmp_12_128.upper_half + movh m.local_metadata__meta_43_overlay_data_sip60 h.local_metadata__meta_43_overlay_data_sip60_tmp.inter + mov m.local_metadata__meta_43_overlay_data_dip61 t.overlay_dip + mov h.local_metadata__meta_43_overlay_data_sip_mask62_128.upper_half 0xFFFFFFFF + mov h.local_metadata__meta_43_overlay_data_sip_mask62_128.lower_half 0xFFFFFFFFFFFFFFFF + mov m.local_metadata__meta_43_overlay_data_sip_mask62 h.local_metadata__meta_43_overlay_data_sip_mask62_128.lower_half + movh m.local_metadata__meta_43_overlay_data_sip_mask62 h.local_metadata__meta_43_overlay_data_sip_mask62_128.upper_half + mov h.local_metadata__meta_43_overlay_data_dip_mask63_128.upper_half 0xFFFFFFFF + mov h.local_metadata__meta_43_overlay_data_dip_mask63_128.lower_half 0xFFFFFFFFFFFFFFFF + mov m.local_metadata__meta_43_overlay_data_dip_mask63 h.local_metadata__meta_43_overlay_data_dip_mask63_128.lower_half + movh m.local_metadata__meta_43_overlay_data_dip_mask63 h.local_metadata__meta_43_overlay_data_dip_mask63_128.upper_half + mov m.local_metadata__meta_43_overlay_data_is_ipv658 1 + mov m.local_metadata__meta_43_overlay_data_dmac59 m.MainControlT_tmp_91 + movh h.local_metadata___eni_data_pl_sip_mask1010_128.upper_half m.local_metadata___eni_data_pl_sip_mask1010 + mov h.local_metadata___eni_data_pl_sip_mask1010_128.lower_half m.local_metadata___eni_data_pl_sip_mask1010 + mov h.local_metadata___eni_data_pl_sip_mask1010_tmp.inter 0xFFFFFFFFFFFFFFFF + xor h.local_metadata___eni_data_pl_sip_mask1010_128.lower_half h.local_metadata___eni_data_pl_sip_mask1010_tmp.inter + xor h.local_metadata___eni_data_pl_sip_mask1010_128.upper_half h.local_metadata___eni_data_pl_sip_mask1010_tmp.inter + mov m.MainControlT_tmp_13 h.local_metadata___eni_data_pl_sip_mask1010_128.lower_half + movh m.MainControlT_tmp_13 h.local_metadata___eni_data_pl_sip_mask1010_128.upper_half + mov m.MainControlT_tmp_14 t.overlay_sip + movh h.MainControlT_tmp_14_128.upper_half m.MainControlT_tmp_14 + mov h.MainControlT_tmp_14_128.lower_half m.MainControlT_tmp_14 + movh h.MainControlT_tmp_13_128.upper_half m.MainControlT_tmp_13 + mov h.MainControlT_tmp_13_128.lower_half m.MainControlT_tmp_13 + mov h.MainControlT_tmp_14_tmp.inter h.MainControlT_tmp_14_128.lower_half + and h.MainControlT_tmp_14_tmp.inter h.MainControlT_tmp_13_128.lower_half + mov m.MainControlT_tmp_14 h.MainControlT_tmp_14_tmp.inter + mov h.MainControlT_tmp_14_tmp.inter h.MainControlT_tmp_14_128.upper_half + and h.MainControlT_tmp_14_tmp.inter h.MainControlT_tmp_13_128.upper_half + movh m.MainControlT_tmp_14 h.MainControlT_tmp_14_tmp.inter + mov m.MainControlT_tmp_15 m.MainControlT_tmp_14 + movh h.MainControlT_tmp_15_128.upper_half m.MainControlT_tmp_15 + mov h.MainControlT_tmp_15_128.lower_half m.MainControlT_tmp_15 + movh h.local_metadata___eni_data_pl_sip99_128.upper_half m.local_metadata___eni_data_pl_sip99 + mov h.local_metadata___eni_data_pl_sip99_128.lower_half m.local_metadata___eni_data_pl_sip99 + mov h.MainControlT_tmp_15_tmp.inter h.MainControlT_tmp_15_128.lower_half + or h.MainControlT_tmp_15_tmp.inter h.local_metadata___eni_data_pl_sip99_128.lower_half + mov m.MainControlT_tmp_15 h.MainControlT_tmp_15_tmp.inter + mov h.MainControlT_tmp_15_tmp.inter h.MainControlT_tmp_15_128.upper_half + or h.MainControlT_tmp_15_tmp.inter h.local_metadata___eni_data_pl_sip99_128.upper_half + movh m.MainControlT_tmp_15 h.MainControlT_tmp_15_tmp.inter + mov m.MainControlT_tmp_16 h.u0_ipv4.src_addr + mov m.local_metadata__meta_43_overlay_data_sip60 m.MainControlT_tmp_15 + movh h.local_metadata__meta_43_overlay_data_sip60_128.upper_half m.local_metadata__meta_43_overlay_data_sip60 + mov h.local_metadata__meta_43_overlay_data_sip60_128.lower_half m.local_metadata__meta_43_overlay_data_sip60 + movh h.MainControlT_tmp_16_128.upper_half m.MainControlT_tmp_16 + mov h.MainControlT_tmp_16_128.lower_half m.MainControlT_tmp_16 + mov h.local_metadata__meta_43_overlay_data_sip60_tmp.inter h.local_metadata__meta_43_overlay_data_sip60_128.lower_half + or h.local_metadata__meta_43_overlay_data_sip60_tmp.inter h.MainControlT_tmp_16_128.lower_half + mov m.local_metadata__meta_43_overlay_data_sip60 h.local_metadata__meta_43_overlay_data_sip60_tmp.inter + mov h.local_metadata__meta_43_overlay_data_sip60_tmp.inter h.local_metadata__meta_43_overlay_data_sip60_128.upper_half + or h.local_metadata__meta_43_overlay_data_sip60_tmp.inter h.MainControlT_tmp_16_128.upper_half + movh m.local_metadata__meta_43_overlay_data_sip60 h.local_metadata__meta_43_overlay_data_sip60_tmp.inter + mov m.local_metadata__meta_43_overlay_data_dip61 t.overlay_dip + mov h.local_metadata__meta_43_overlay_data_sip_mask62_128.upper_half 0xFFFFFFFF + mov h.local_metadata__meta_43_overlay_data_sip_mask62_128.lower_half 0xFFFFFFFFFFFFFFFF + mov m.local_metadata__meta_43_overlay_data_sip_mask62 h.local_metadata__meta_43_overlay_data_sip_mask62_128.lower_half + movh m.local_metadata__meta_43_overlay_data_sip_mask62 h.local_metadata__meta_43_overlay_data_sip_mask62_128.upper_half + mov h.local_metadata__meta_43_overlay_data_dip_mask63_128.upper_half 0xFFFFFFFF + mov h.local_metadata__meta_43_overlay_data_dip_mask63_128.lower_half 0xFFFFFFFFFFFFFFFF + mov m.local_metadata__meta_43_overlay_data_dip_mask63 h.local_metadata__meta_43_overlay_data_dip_mask63_128.lower_half + movh m.local_metadata__meta_43_overlay_data_dip_mask63 h.local_metadata__meta_43_overlay_data_dip_mask63_128.upper_half + mov m.local_metadata___mapping_meter_class_override3232 t.meter_class_override + mov m.local_metadata___mapping_meter_class3636 t.meter_class + mov m.local_metadata___target_stage4242 0x12C + mov m.MainControlT_tmp_17 m.local_metadata___routing_actions4343 + or m.MainControlT_tmp_17 0x1 + mov m.local_metadata___routing_actions4343 m.MainControlT_tmp_17 + or m.local_metadata___routing_actions4343 0x2 + mov m.local_metadata___encap_data_vni4545 m.MainControlT_tmp_86 + mov m.local_metadata___encap_data_underlay_sip4747 m.MainControlT_tmp_89 + mov m.local_metadata___encap_data_underlay_dip4848 m.MainControlT_tmp_90 + mov m.local_metadata___encap_data_dash_encapsulation5151 t.dash_encapsulation + mov m.local_metadata___overlay_data_is_ipv65252 1 + mov m.local_metadata___overlay_data_dmac5353 m.MainControlT_tmp_91 + mov m.local_metadata___overlay_data_sip5454 m.local_metadata__meta_43_overlay_data_sip60 + mov m.local_metadata___overlay_data_dip5555 t.overlay_dip + mov h.local_metadata___overlay_data_sip_mask5656_128.upper_half 0xFFFFFFFF + mov h.local_metadata___overlay_data_sip_mask5656_128.lower_half 0xFFFFFFFFFFFFFFFF + mov m.local_metadata___overlay_data_sip_mask5656 h.local_metadata___overlay_data_sip_mask5656_128.lower_half + movh m.local_metadata___overlay_data_sip_mask5656 h.local_metadata___overlay_data_sip_mask5656_128.upper_half + mov h.local_metadata___overlay_data_dip_mask5757_128.upper_half 0xFFFFFFFF + mov h.local_metadata___overlay_data_dip_mask5757_128.lower_half 0xFFFFFFFFFFFFFFFF + mov m.local_metadata___overlay_data_dip_mask5757 h.local_metadata___overlay_data_dip_mask5757_128.lower_half + movh m.local_metadata___overlay_data_dip_mask5757 h.local_metadata___overlay_data_dip_mask5757_128.upper_half + return +} + +action deny args none { + mov m.local_metadata___dropped4444 1 + return +} + +action deny_0 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action deny_1 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action deny_3 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action accept_1 args none { + return +} + +action set_appliance args instanceof set_appliance_arg_t { + mov m.local_metadata___encap_data_underlay_dmac5050 t.neighbor_mac + mov m.local_metadata___encap_data_underlay_smac4949 t.mac + return +} + +action set_eni_attrs args instanceof set_eni_attrs_arg_t { + mov m.local_metadata___eni_data_cps55 t.cps + mov m.local_metadata___eni_data_pps66 t.pps + mov m.local_metadata___eni_data_flows77 t.flows + mov m.local_metadata___eni_data_admin_state88 t.admin_state + mov m.local_metadata___eni_data_pl_sip99 t.pl_sip + mov m.local_metadata___eni_data_pl_sip_mask1010 t.pl_sip_mask + mov m.local_metadata___eni_data_pl_underlay_sip1111 t.pl_underlay_sip + mov m.local_metadata___encap_data_underlay_dip4848 t.vm_underlay_dip + jmpneq LABEL_END_84 t.dash_tunnel_dscp_mode 0x1 + mov m.local_metadata___eni_data_dscp1212 t.dscp + LABEL_END_84 : mov m.local_metadata___encap_data_vni4545 t.vm_vni + mov m.local_metadata___vnet_id22 t.vnet_id + jmpneq LABEL_FALSE_81 m.local_metadata___is_overlay_ip_v61616 0x1 + jmpneq LABEL_FALSE_82 m.local_metadata___direction00 0x1 + mov m.local_metadata___stage1_dash_acl_group_id2626 t.outbound_v6_stage1_dash_acl_group_id + mov m.local_metadata___stage2_dash_acl_group_id2727 t.outbound_v6_stage2_dash_acl_group_id + mov m.local_metadata___stage3_dash_acl_group_id2828 t.outbound_v6_stage3_dash_acl_group_id + mov m.local_metadata___stage4_dash_acl_group_id2929 t.outbound_v6_stage4_dash_acl_group_id + mov m.local_metadata___stage5_dash_acl_group_id3030 t.outbound_v6_stage5_dash_acl_group_id + jmp LABEL_END_86 + LABEL_FALSE_82 : mov m.local_metadata___stage1_dash_acl_group_id2626 t.inbound_v6_stage1_dash_acl_group_id + mov m.local_metadata___stage2_dash_acl_group_id2727 t.inbound_v6_stage2_dash_acl_group_id + mov m.local_metadata___stage3_dash_acl_group_id2828 t.inbound_v6_stage3_dash_acl_group_id + mov m.local_metadata___stage4_dash_acl_group_id2929 t.inbound_v6_stage4_dash_acl_group_id + mov m.local_metadata___stage5_dash_acl_group_id3030 t.inbound_v6_stage5_dash_acl_group_id + LABEL_END_86 : mov m.local_metadata___meter_policy_id3333 t.v6_meter_policy_id + jmp LABEL_END_85 + LABEL_FALSE_81 : jmpneq LABEL_FALSE_83 m.local_metadata___direction00 0x1 + mov m.local_metadata___stage1_dash_acl_group_id2626 t.outbound_v4_stage1_dash_acl_group_id + mov m.local_metadata___stage2_dash_acl_group_id2727 t.outbound_v4_stage2_dash_acl_group_id + mov m.local_metadata___stage3_dash_acl_group_id2828 t.outbound_v4_stage3_dash_acl_group_id + mov m.local_metadata___stage4_dash_acl_group_id2929 t.outbound_v4_stage4_dash_acl_group_id + mov m.local_metadata___stage5_dash_acl_group_id3030 t.outbound_v4_stage5_dash_acl_group_id + jmp LABEL_END_87 + LABEL_FALSE_83 : mov m.local_metadata___stage1_dash_acl_group_id2626 t.inbound_v4_stage1_dash_acl_group_id + mov m.local_metadata___stage2_dash_acl_group_id2727 t.inbound_v4_stage2_dash_acl_group_id + mov m.local_metadata___stage3_dash_acl_group_id2828 t.inbound_v4_stage3_dash_acl_group_id + mov m.local_metadata___stage4_dash_acl_group_id2929 t.inbound_v4_stage4_dash_acl_group_id + mov m.local_metadata___stage5_dash_acl_group_id3030 t.inbound_v4_stage5_dash_acl_group_id + LABEL_END_87 : mov m.local_metadata___meter_policy_id3333 t.v4_meter_policy_id + LABEL_END_85 : mov m.local_metadata___fast_path_icmp_flow_redirection_disabled411 t.disable_fast_path_icmp_flow_redirection + return +} + +action permit args none { + return +} + +action tunnel_decap_pa_validate args instanceof tunnel_decap_pa_validate_arg_t { + mov m.local_metadata___vnet_id22 t.src_vnet_id + return +} + +action set_acl_group_attrs args instanceof set_acl_group_attrs_arg_t { + jmpneq LABEL_FALSE_84 t.ip_addr_family 0x0 + jmpneq LABEL_END_88 m.local_metadata___is_overlay_ip_v61616 0x1 + mov m.local_metadata___dropped4444 1 + jmp LABEL_END_88 + jmp LABEL_END_88 + LABEL_FALSE_84 : jmpneq LABEL_END_88 m.local_metadata___is_overlay_ip_v61616 0x0 + mov m.local_metadata___dropped4444 1 + LABEL_END_88 : return +} + +action direction_lookup_stage_set_outbound_direction_0 args none { + mov m.local_metadata___direction00 0x1 + return +} + +action direction_lookup_stage_set_inbound_direction_0 args none { + mov m.local_metadata___direction00 0x2 + return +} + +action eni_lookup_stage_set_eni_0 args instanceof eni_lookup_stage_set_eni_0_arg_t { + mov m.local_metadata___eni_id44 t.eni_id + return +} + +action eni_lookup_stage_deny_0 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action outbound_acl_permit_0 args none { + return +} + +action outbound_acl_permit_1 args none { + return +} + +action outbound_acl_permit_2 args none { + return +} + +action outbound_acl_permit_and_continue_0 args none { + return +} + +action outbound_acl_permit_and_continue_1 args none { + return +} + +action outbound_acl_permit_and_continue_2 args none { + return +} + +action outbound_acl_deny_0 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action outbound_acl_deny_1 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action outbound_acl_deny_2 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action outbound_acl_deny_and_continue_0 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action outbound_acl_deny_and_continue_1 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action outbound_acl_deny_and_continue_2 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action outbound_outbound_mapping_stage_set_vnet_attrs_0 args instanceof outbound_outbound_mapping_stage_set_vnet_attrs_0_arg_t { + mov m.local_metadata___encap_data_vni4545 t.vni + return +} + +action inbound_acl_permit_0 args none { + return +} + +action inbound_acl_permit_1 args none { + return +} + +action inbound_acl_permit_2 args none { + return +} + +action inbound_acl_permit_and_continue_0 args none { + return +} + +action inbound_acl_permit_and_continue_1 args none { + return +} + +action inbound_acl_permit_and_continue_2 args none { + return +} + +action inbound_acl_deny_0 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action inbound_acl_deny_1 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action inbound_acl_deny_2 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action inbound_acl_deny_and_continue_0 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action inbound_acl_deny_and_continue_1 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action inbound_acl_deny_and_continue_2 args none { + mov m.local_metadata___dropped4444 1 + return +} + +action underlay_pkt_act_0 args instanceof underlay_pkt_act_0_arg_t { + jmpneq LABEL_END_91 t.packet_action 0x0 + mov m.local_metadata___dropped4444 1 + LABEL_END_91 : return +} + +action underlay_def_act_0 args none { + return +} + +action metering_update_stage_check_ip_addr_family_0 args instanceof metering_update_stage_check_ip_addr_family_0_arg_t { + jmpneq LABEL_FALSE_88 t.ip_addr_family 0x0 + jmpneq LABEL_END_92 m.local_metadata___is_overlay_ip_v61616 0x1 + mov m.local_metadata___dropped4444 1 + jmp LABEL_END_92 + jmp LABEL_END_92 + LABEL_FALSE_88 : jmpneq LABEL_END_92 m.local_metadata___is_overlay_ip_v61616 0x0 + mov m.local_metadata___dropped4444 1 + LABEL_END_92 : return +} + +action metering_update_stage_set_policy_meter_class_0 args instanceof metering_update_stage_set_policy_meter_class_0_arg_t { + mov m.local_metadata___policy_meter_class3434 t.meter_class + return +} + +action metering_update_stage_meter_bucket_action_0 args instanceof metering_update_stage_meter_bucket_action_0_arg_t { + mov m.local_metadata___meter_bucket_index3838 t.meter_bucket_index + return +} + +table vip { + key { + h.u0_ipv4.dst_addr exact + } + actions { + accept_1 + deny @defaultonly + } + default_action deny args none const + size 0x10000 +} + + +table appliance { + key { + m.local_metadata___appliance_id1515 wildcard + } + actions { + set_appliance + NoAction @defaultonly + } + default_action NoAction args none + size 0x10000 +} + + +table eni { + key { + m.local_metadata___eni_id44 exact + } + actions { + set_eni_attrs + deny_0 @defaultonly + } + default_action deny_0 args none const + size 0x10000 +} + + +table pa_validation { + key { + m.dash_ingress_pa_validation_local_metadata___vnet_id22 exact + m.dash_ingress_pa_validation_u0_ipv4_src_addr exact + } + actions { + permit + deny_1 @defaultonly + } + default_action deny_1 args none const + size 0x10000 +} + + +table inbound_routing { + key { + m.local_metadata___eni_id44 exact + m.dash_ingress_inbound_routing_u0_vxlan_vni exact + m.dash_ingress_inbound_routing_u0_ipv4_src_addr wildcard + } + actions { + tunnel_decap_1 + tunnel_decap_pa_validate + deny_3 @defaultonly + } + default_action deny_3 args none const + size 0x10000 +} + + +table acl_group { + key { + m.local_metadata___stage1_dash_acl_group_id2626 exact + } + actions { + set_acl_group_attrs + NoAction @defaultonly + } + default_action NoAction args none + size 0x10000 +} + + +table direction_lookup_stage_direction_lookup { + key { + h.u0_vxlan.vni exact + } + actions { + direction_lookup_stage_set_outbound_direction_0 + direction_lookup_stage_set_inbound_direction_0 @defaultonly + } + default_action direction_lookup_stage_set_inbound_direction_0 args none const + size 0x10000 +} + + +table eni_lookup_stage_eni_ether_address_map { + key { + m.MainControlT_eni_lookup_stage_tmp exact + } + actions { + eni_lookup_stage_set_eni_0 + eni_lookup_stage_deny_0 @defaultonly + } + default_action eni_lookup_stage_deny_0 args none const + size 0x10000 +} + + +table outbound_acl_stage1 { + key { + m.local_metadata___stage1_dash_acl_group_id2626 exact + m.local_metadata___dst_ip_addr1919 wildcard + m.local_metadata___src_ip_addr2020 wildcard + m.local_metadata___ip_protocol1818 wildcard + m.local_metadata___src_l4_port2424 wildcard + m.local_metadata___dst_l4_port2525 wildcard + } + actions { + outbound_acl_permit_0 + outbound_acl_permit_and_continue_0 + outbound_acl_deny_0 + outbound_acl_deny_and_continue_0 + } + default_action outbound_acl_deny_0 args none + size 0x10000 +} + + +table outbound_acl_stage2 { + key { + m.local_metadata___stage2_dash_acl_group_id2727 exact + m.local_metadata___dst_ip_addr1919 wildcard + m.local_metadata___src_ip_addr2020 wildcard + m.local_metadata___ip_protocol1818 wildcard + m.local_metadata___src_l4_port2424 wildcard + m.local_metadata___dst_l4_port2525 wildcard + } + actions { + outbound_acl_permit_1 + outbound_acl_permit_and_continue_1 + outbound_acl_deny_1 + outbound_acl_deny_and_continue_1 + } + default_action outbound_acl_deny_1 args none + size 0x10000 +} + + +table outbound_acl_stage3 { + key { + m.local_metadata___stage3_dash_acl_group_id2828 exact + m.local_metadata___dst_ip_addr1919 wildcard + m.local_metadata___src_ip_addr2020 wildcard + m.local_metadata___ip_protocol1818 wildcard + m.local_metadata___src_l4_port2424 wildcard + m.local_metadata___dst_l4_port2525 wildcard + } + actions { + outbound_acl_permit_2 + outbound_acl_permit_and_continue_2 + outbound_acl_deny_2 + outbound_acl_deny_and_continue_2 + } + default_action outbound_acl_deny_2 args none + size 0x10000 +} + + +table outbound_outbound_routing_stage_routing { + key { + m.local_metadata___eni_id44 exact + m.local_metadata___is_overlay_ip_v61616 exact + m.local_metadata___dst_ip_addr1919 lpm + } + actions { + route_vnet_0 + route_vnet_direct_0 + route_direct_0 + route_service_tunnel_0 + drop_1 + } + default_action drop_1 args none const + size 0x10000 +} + + +table outbound_outbound_mapping_stage_ca_to_pa { + key { + m.dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local2 exact + m.dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local3 exact + m.dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local4 exact + } + actions { + set_tunnel_mapping_0 + set_private_link_mapping_0 + drop_2 @defaultonly + } + default_action drop_2 args none const + size 0x10000 +} + + +table outbound_outbound_mapping_stage_vnet { + key { + m.local_metadata___vnet_id22 exact + } + actions { + outbound_outbound_mapping_stage_set_vnet_attrs_0 + NoAction @defaultonly + } + default_action NoAction args none + size 0x10000 +} + + +table inbound_acl_stage1 { + key { + m.local_metadata___stage1_dash_acl_group_id2626 exact + m.local_metadata___dst_ip_addr1919 wildcard + m.local_metadata___src_ip_addr2020 wildcard + m.local_metadata___ip_protocol1818 wildcard + m.local_metadata___src_l4_port2424 wildcard + m.local_metadata___dst_l4_port2525 wildcard + } + actions { + inbound_acl_permit_0 + inbound_acl_permit_and_continue_0 + inbound_acl_deny_0 + inbound_acl_deny_and_continue_0 + } + default_action inbound_acl_deny_0 args none + size 0x10000 +} + + +table inbound_acl_stage2 { + key { + m.local_metadata___stage2_dash_acl_group_id2727 exact + m.local_metadata___dst_ip_addr1919 wildcard + m.local_metadata___src_ip_addr2020 wildcard + m.local_metadata___ip_protocol1818 wildcard + m.local_metadata___src_l4_port2424 wildcard + m.local_metadata___dst_l4_port2525 wildcard + } + actions { + inbound_acl_permit_1 + inbound_acl_permit_and_continue_1 + inbound_acl_deny_1 + inbound_acl_deny_and_continue_1 + } + default_action inbound_acl_deny_1 args none + size 0x10000 +} + + +table inbound_acl_stage3 { + key { + m.local_metadata___stage3_dash_acl_group_id2828 exact + m.local_metadata___dst_ip_addr1919 wildcard + m.local_metadata___src_ip_addr2020 wildcard + m.local_metadata___ip_protocol1818 wildcard + m.local_metadata___src_l4_port2424 wildcard + m.local_metadata___dst_l4_port2525 wildcard + } + actions { + inbound_acl_permit_2 + inbound_acl_permit_and_continue_2 + inbound_acl_deny_2 + inbound_acl_deny_and_continue_2 + } + default_action inbound_acl_deny_2 args none + size 0x10000 +} + + +table underlay_underlay_routing { + key { + m.local_metadata___dst_ip_addr1919 lpm + } + actions { + underlay_pkt_act_0 + underlay_def_act_0 @defaultonly + NoAction @defaultonly + } + default_action NoAction args none + size 0x10000 +} + + +table metering_update_stage_meter_policy { + key { + m.local_metadata___meter_policy_id3333 exact + } + actions { + metering_update_stage_check_ip_addr_family_0 + NoAction @defaultonly + } + default_action NoAction args none + size 0x10000 +} + + +table metering_update_stage_meter_rule { + key { + m.local_metadata___meter_policy_id3333 exact + m.dash_ingress_metering_update_stage_meter_rule_u0_ipv4_dst_a5 wildcard + } + actions { + metering_update_stage_set_policy_meter_class_0 + NoAction @defaultonly + } + default_action NoAction args none const + size 0x10000 +} + + +table metering_update_stage_meter_bucket { + key { + m.dash_ingress_metering_update_stage_meter_bucket_local_metad6 exact + m.dash_ingress_metering_update_stage_meter_bucket_local_metad7 exact + } + actions { + metering_update_stage_meter_bucket_action_0 + NoAction @defaultonly + } + default_action NoAction args none const + size 0x10000 +} + + +table metering_update_stage_eni_meter { + key { + m.dash_ingress_metering_update_stage_eni_meter_local_metadata8 exact + m.dash_ingress_metering_update_stage_eni_meter_local_metadata9 exact + m.dash_ingress_metering_update_stage_eni_meter_local_metadat10 exact + } + actions { + NoAction + } + default_action NoAction args none + size 0x10000 +} + + +apply { + rx m.pna_main_input_metadata_input_port + extract h.u0_ethernet + jmpeq DASH_PARSER_PARSE_U0_IPV4 h.u0_ethernet.ether_type 0x800 + jmpeq DASH_PARSER_PARSE_U0_IPV6 h.u0_ethernet.ether_type 0x86DD + jmp DASH_PARSER_ACCEPT + DASH_PARSER_PARSE_U0_IPV6 : extract h.u0_ipv6 + jmpeq DASH_PARSER_PARSE_U0_UDP h.u0_ipv6.next_header 0x11 + jmpeq DASH_PARSER_PARSE_U0_TCP h.u0_ipv6.next_header 0x6 + jmp DASH_PARSER_ACCEPT + DASH_PARSER_PARSE_U0_IPV4 : extract h.u0_ipv4 + mov m.MainParserT_parser_tmp_6 h.u0_ipv4.version_ihl + shr m.MainParserT_parser_tmp_6 0x4 + mov m.MainParserT_parser_tmp_7 m.MainParserT_parser_tmp_6 + and m.MainParserT_parser_tmp_7 0xF + mov m.MainParserT_parser_tmp_8 m.MainParserT_parser_tmp_7 + and m.MainParserT_parser_tmp_8 0xF + jmpeq LABEL_TRUE m.MainParserT_parser_tmp_8 0x4 + mov m.MainParserT_parser_tmp_23 0x0 + jmp LABEL_END + LABEL_TRUE : mov m.MainParserT_parser_tmp_23 0x1 + LABEL_END : jmpneq LABEL_END_0 m.MainParserT_parser_tmp_23 0 + mov m.pna_pre_input_metadata_parser_error 0x0 + jmp DASH_PARSER_ACCEPT + LABEL_END_0 : mov m.MainParserT_parser_tmp_10 h.u0_ipv4.version_ihl + and m.MainParserT_parser_tmp_10 0xF + mov m.MainParserT_parser_tmp_11 m.MainParserT_parser_tmp_10 + and m.MainParserT_parser_tmp_11 0xF + jmplt LABEL_FALSE_0 m.MainParserT_parser_tmp_11 0x5 + mov m.MainParserT_parser_tmp_24 0x1 + jmp LABEL_END_1 + LABEL_FALSE_0 : mov m.MainParserT_parser_tmp_24 0x0 + LABEL_END_1 : jmpneq LABEL_END_2 m.MainParserT_parser_tmp_24 0 + mov m.pna_pre_input_metadata_parser_error 0x2 + jmp DASH_PARSER_ACCEPT + LABEL_END_2 : mov m.MainParserT_parser_tmp_13 h.u0_ipv4.version_ihl + and m.MainParserT_parser_tmp_13 0xF + mov m.MainParserT_parser_tmp_14 m.MainParserT_parser_tmp_13 + and m.MainParserT_parser_tmp_14 0xF + jmpeq DASH_PARSER_DISPATCH_ON_U0_PROTOCOL m.MainParserT_parser_tmp_14 0x5 + mov m.MainParserT_parser_tmp_15 h.u0_ipv4.version_ihl + and m.MainParserT_parser_tmp_15 0xF + mov m.MainParserT_parser_tmp_16 m.MainParserT_parser_tmp_15 + and m.MainParserT_parser_tmp_16 0xF + mov m.MainParserT_parser_tmp_19 m.MainParserT_parser_tmp_16 + add m.MainParserT_parser_tmp_19 0xFFFB + mov m.MainParserT_parser_tmp_20 m.MainParserT_parser_tmp_19 + shl m.MainParserT_parser_tmp_20 0x5 + mov m.MainParserT_parser_tmp_26_extract_tmp m.MainParserT_parser_tmp_20 + shr m.MainParserT_parser_tmp_26_extract_tmp 0x3 + extract h.u0_ipv4options m.MainParserT_parser_tmp_26_extract_tmp + DASH_PARSER_DISPATCH_ON_U0_PROTOCOL : jmpeq DASH_PARSER_PARSE_U0_UDP h.u0_ipv4.protocol 0x11 + jmpeq DASH_PARSER_PARSE_U0_TCP h.u0_ipv4.protocol 0x6 + jmp DASH_PARSER_ACCEPT + DASH_PARSER_PARSE_U0_UDP : extract h.u0_udp + jmpeq DASH_PARSER_PARSE_U0_VXLAN h.u0_udp.dst_port 0x12B5 + jmp DASH_PARSER_ACCEPT + DASH_PARSER_PARSE_U0_VXLAN : extract h.u0_vxlan + extract h.customer_ethernet + jmpeq DASH_PARSER_PARSE_CUSTOMER_IPV4 h.customer_ethernet.ether_type 0x800 + jmpeq DASH_PARSER_PARSE_CUSTOMER_IPV6 h.customer_ethernet.ether_type 0x86DD + jmp DASH_PARSER_ACCEPT + DASH_PARSER_PARSE_CUSTOMER_IPV6 : extract h.customer_ipv6 + jmpeq DASH_PARSER_PARSE_CUSTOMER_UDP h.customer_ipv6.next_header 0x11 + jmpeq DASH_PARSER_PARSE_CUSTOMER_TCP h.customer_ipv6.next_header 0x6 + jmp DASH_PARSER_ACCEPT + DASH_PARSER_PARSE_CUSTOMER_IPV4 : extract h.customer_ipv4 + mov m.MainParserT_parser_tmp h.customer_ipv4.version_ihl + shr m.MainParserT_parser_tmp 0x4 + mov m.MainParserT_parser_tmp_0 m.MainParserT_parser_tmp + and m.MainParserT_parser_tmp_0 0xF + mov m.MainParserT_parser_tmp_1 m.MainParserT_parser_tmp_0 + and m.MainParserT_parser_tmp_1 0xF + jmpeq LABEL_TRUE_1 m.MainParserT_parser_tmp_1 0x4 + mov m.MainParserT_parser_tmp_21 0x0 + jmp LABEL_END_3 + LABEL_TRUE_1 : mov m.MainParserT_parser_tmp_21 0x1 + LABEL_END_3 : jmpneq LABEL_END_4 m.MainParserT_parser_tmp_21 0 + mov m.pna_pre_input_metadata_parser_error 0x0 + jmp DASH_PARSER_ACCEPT + LABEL_END_4 : mov m.MainParserT_parser_tmp_3 h.customer_ipv4.version_ihl + and m.MainParserT_parser_tmp_3 0xF + mov m.MainParserT_parser_tmp_4 m.MainParserT_parser_tmp_3 + and m.MainParserT_parser_tmp_4 0xF + jmpeq LABEL_TRUE_2 m.MainParserT_parser_tmp_4 0x5 + mov m.MainParserT_parser_tmp_22 0x0 + jmp LABEL_END_5 + LABEL_TRUE_2 : mov m.MainParserT_parser_tmp_22 0x1 + LABEL_END_5 : jmpneq LABEL_END_6 m.MainParserT_parser_tmp_22 0 + mov m.pna_pre_input_metadata_parser_error 0x1 + jmp DASH_PARSER_ACCEPT + LABEL_END_6 : jmpeq DASH_PARSER_PARSE_CUSTOMER_UDP h.customer_ipv4.protocol 0x11 + jmpeq DASH_PARSER_PARSE_CUSTOMER_TCP h.customer_ipv4.protocol 0x6 + jmp DASH_PARSER_ACCEPT + DASH_PARSER_PARSE_CUSTOMER_UDP : extract h.customer_udp + jmp DASH_PARSER_ACCEPT + DASH_PARSER_PARSE_CUSTOMER_TCP : extract h.customer_tcp + jmp DASH_PARSER_ACCEPT + DASH_PARSER_PARSE_U0_TCP : extract h.u0_tcp + DASH_PARSER_ACCEPT : table vip + jmpnh LABEL_END_7 + mov m.local_metadata___encap_data_underlay_sip4747 h.u0_ipv4.dst_addr + LABEL_END_7 : table direction_lookup_stage_direction_lookup + table appliance + jmpneq LABEL_FALSE_4 m.local_metadata___direction00 0x1 + mov m.MainControlT_eni_lookup_stage_tmp h.customer_ethernet.src_addr + jmp LABEL_END_8 + LABEL_FALSE_4 : mov m.MainControlT_eni_lookup_stage_tmp h.customer_ethernet.dst_addr + LABEL_END_8 : mov m.local_metadata___eni_addr11 m.MainControlT_eni_lookup_stage_tmp + table eni_lookup_stage_eni_ether_address_map + mov m.local_metadata___eni_data_dscp_mode1313 0x0 + mov m.MainControlT_tmp_48 h.u0_ipv4.diffserv + and m.MainControlT_tmp_48 0x3F + mov m.MainControlT_tmp_49 m.MainControlT_tmp_48 + and m.MainControlT_tmp_49 0x3F + mov m.MainControlT_tmp_50 m.MainControlT_tmp_49 + and m.MainControlT_tmp_50 0x3F + mov m.local_metadata___eni_data_dscp1212 m.MainControlT_tmp_50 + jmpneq LABEL_FALSE_6 m.local_metadata___direction00 0x1 + mov m.local_metadata___tunnel_pointer3939 0x0 + jmp LABEL_END_10 + LABEL_FALSE_6 : jmpneq LABEL_END_10 m.local_metadata___direction00 0x2 + mov m.dash_ingress_inbound_routing_u0_vxlan_vni h.u0_vxlan.vni + mov m.dash_ingress_inbound_routing_u0_ipv4_src_addr h.u0_ipv4.src_addr + table inbound_routing + jmpa LABEL_SWITCH tunnel_decap_pa_validate + jmp LABEL_END_10 + LABEL_SWITCH : mov m.dash_ingress_pa_validation_local_metadata___vnet_id22 m.local_metadata___vnet_id22 + mov m.dash_ingress_pa_validation_u0_ipv4_src_addr h.u0_ipv4.src_addr + table pa_validation + mov m.local_metadata___tunnel_pointer3939 0x0 + LABEL_END_10 : mov m.local_metadata___is_overlay_ip_v61616 0x0 + mov m.local_metadata___ip_protocol1818 0x0 + mov h.dpdk_pseudo_header.pseudo_1 0x0 + mov m.local_metadata___dst_ip_addr1919 h.dpdk_pseudo_header.pseudo_1 + mov h.dpdk_pseudo_header.pseudo_2 0x0 + mov m.local_metadata___src_ip_addr2020 h.dpdk_pseudo_header.pseudo_2 + jmpnv LABEL_FALSE_8 h.customer_ipv6 + mov m.local_metadata___ip_protocol1818 h.customer_ipv6.next_header + mov m.local_metadata___src_ip_addr2020 h.customer_ipv6.src_addr + mov m.local_metadata___dst_ip_addr1919 h.customer_ipv6.dst_addr + mov m.local_metadata___is_overlay_ip_v61616 0x1 + jmp LABEL_END_12 + LABEL_FALSE_8 : jmpnv LABEL_END_12 h.customer_ipv4 + mov m.local_metadata___ip_protocol1818 h.customer_ipv4.protocol + mov m.local_metadata___src_ip_addr2020 h.customer_ipv4.src_addr + mov m.local_metadata___dst_ip_addr1919 h.customer_ipv4.dst_addr + LABEL_END_12 : jmpnv LABEL_FALSE_10 h.customer_tcp + mov m.local_metadata___src_l4_port2424 h.customer_tcp.src_port + mov m.local_metadata___dst_l4_port2525 h.customer_tcp.dst_port + jmp LABEL_END_14 + LABEL_FALSE_10 : jmpnv LABEL_END_14 h.customer_udp + mov m.local_metadata___src_l4_port2424 h.customer_udp.src_port + mov m.local_metadata___dst_l4_port2525 h.customer_udp.dst_port + LABEL_END_14 : table eni + jmpneq LABEL_END_16 m.local_metadata___eni_data_admin_state88 0x0 + mov m.local_metadata___dropped4444 1 + LABEL_END_16 : table acl_group + jmpneq LABEL_FALSE_13 m.local_metadata___direction00 0x1 + mov m.local_metadata___target_stage4242 0xC8 + jmpneq LABEL_FALSE_14 m.local_metadata___conntrack_data_allow_out2323 0x1 + jmp LABEL_END_18 + LABEL_FALSE_14 : mov m.MainControlT_outbound_acl_hasReturned 0 + jmpeq LABEL_END_19 m.local_metadata___stage1_dash_acl_group_id2626 0x0 + table outbound_acl_stage1 + jmpa LABEL_SWITCH_0 outbound_acl_permit_0 + jmpa LABEL_SWITCH_1 outbound_acl_deny_0 + jmp LABEL_END_19 + LABEL_SWITCH_0 : mov m.MainControlT_outbound_acl_hasReturned 1 + jmp LABEL_END_19 + LABEL_SWITCH_1 : mov m.MainControlT_outbound_acl_hasReturned 1 + LABEL_END_19 : jmpneq LABEL_FALSE_16 m.MainControlT_outbound_acl_hasReturned 0x1 + jmp LABEL_END_20 + LABEL_FALSE_16 : jmpeq LABEL_END_20 m.local_metadata___stage2_dash_acl_group_id2727 0x0 + table outbound_acl_stage2 + jmpa LABEL_SWITCH_2 outbound_acl_permit_1 + jmpa LABEL_SWITCH_3 outbound_acl_deny_1 + jmp LABEL_END_20 + LABEL_SWITCH_2 : mov m.MainControlT_outbound_acl_hasReturned 1 + jmp LABEL_END_20 + LABEL_SWITCH_3 : mov m.MainControlT_outbound_acl_hasReturned 1 + LABEL_END_20 : jmpneq LABEL_FALSE_18 m.MainControlT_outbound_acl_hasReturned 0x1 + jmp LABEL_END_18 + LABEL_FALSE_18 : jmpeq LABEL_END_18 m.local_metadata___stage3_dash_acl_group_id2828 0x0 + table outbound_acl_stage3 + LABEL_END_18 : table outbound_outbound_routing_stage_routing + jmpeq LABEL_FALSE_20 m.local_metadata___target_stage4242 0xC9 + jmp LABEL_END_17 + LABEL_FALSE_20 : mov m.dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local2 m.local_metadata___dst_vnet_id33 + mov m.dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local3 m.local_metadata___is_overlay_ip_v61616 + mov m.dash_ingress_outbound_outbound_mapping_stage_ca_to_pa_local4 m.local_metadata___dst_ip_addr1919 + table outbound_outbound_mapping_stage_ca_to_pa + jmpa LABEL_SWITCH_6 set_tunnel_mapping_0 + jmp LABEL_END_17 + LABEL_SWITCH_6 : table outbound_outbound_mapping_stage_vnet + jmp LABEL_END_17 + LABEL_FALSE_13 : jmpneq LABEL_END_17 m.local_metadata___direction00 0x2 + jmpneq LABEL_FALSE_22 m.local_metadata___conntrack_data_allow_in2222 0x1 + jmp LABEL_END_26 + LABEL_FALSE_22 : mov m.MainControlT_inbound_acl_hasReturned 0 + jmpeq LABEL_END_27 m.local_metadata___stage1_dash_acl_group_id2626 0x0 + table inbound_acl_stage1 + jmpa LABEL_SWITCH_7 inbound_acl_permit_0 + jmpa LABEL_SWITCH_8 inbound_acl_deny_0 + jmp LABEL_END_27 + LABEL_SWITCH_7 : mov m.MainControlT_inbound_acl_hasReturned 1 + jmp LABEL_END_27 + LABEL_SWITCH_8 : mov m.MainControlT_inbound_acl_hasReturned 1 + LABEL_END_27 : jmpneq LABEL_FALSE_24 m.MainControlT_inbound_acl_hasReturned 0x1 + jmp LABEL_END_28 + LABEL_FALSE_24 : jmpeq LABEL_END_28 m.local_metadata___stage2_dash_acl_group_id2727 0x0 + table inbound_acl_stage2 + jmpa LABEL_SWITCH_9 inbound_acl_permit_1 + jmpa LABEL_SWITCH_10 inbound_acl_deny_1 + jmp LABEL_END_28 + LABEL_SWITCH_9 : mov m.MainControlT_inbound_acl_hasReturned 1 + jmp LABEL_END_28 + LABEL_SWITCH_10 : mov m.MainControlT_inbound_acl_hasReturned 1 + LABEL_END_28 : jmpneq LABEL_FALSE_26 m.MainControlT_inbound_acl_hasReturned 0x1 + jmp LABEL_END_26 + LABEL_FALSE_26 : jmpeq LABEL_END_26 m.local_metadata___stage3_dash_acl_group_id2828 0x0 + table inbound_acl_stage3 + LABEL_END_26 : jmpneq LABEL_FALSE_28 m.local_metadata___tunnel_pointer3939 0x0 + mov h.customer_ethernet.dst_addr m.local_metadata___overlay_data_dmac5353 + mov h.u0_ethernet.dst_addr m.local_metadata___encap_data_underlay_dmac5050 + mov h.u0_ethernet.src_addr m.local_metadata___encap_data_underlay_smac4949 + mov h.u0_ethernet.ether_type 0x800 + mov m.MainControlT_customer_ip_len 0x0 + jmpnv LABEL_END_33 h.customer_ipv4 + mov m.MainControlT_customer_ip_len h.customer_ipv4.total_len + LABEL_END_33 : jmpnv LABEL_END_34 h.customer_ipv6 + mov m.MainControlT_tmp_18 m.MainControlT_customer_ip_len + add m.MainControlT_tmp_18 0x28 + mov m.MainControlT_customer_ip_len m.MainControlT_tmp_18 + add m.MainControlT_customer_ip_len h.customer_ipv6.payload_length + LABEL_END_34 : mov h.u0_ipv4.total_len 0x32 + add h.u0_ipv4.total_len m.MainControlT_customer_ip_len + mov m.MainControlT_tmp_19 h.u0_ipv4.version_ihl + and m.MainControlT_tmp_19 0xF + mov h.u0_ipv4.version_ihl m.MainControlT_tmp_19 + or h.u0_ipv4.version_ihl 0x40 + mov m.MainControlT_tmp_20 h.u0_ipv4.version_ihl + and m.MainControlT_tmp_20 0xF0 + mov h.u0_ipv4.version_ihl m.MainControlT_tmp_20 + or h.u0_ipv4.version_ihl 0x5 + mov h.u0_ipv4.diffserv 0x0 + mov h.u0_ipv4.identification 0x1 + mov m.MainControlT_tmp_21 h.u0_ipv4.flags_frag_offset + and m.MainControlT_tmp_21 0x1FFF + mov h.u0_ipv4.flags_frag_offset m.MainControlT_tmp_21 + or h.u0_ipv4.flags_frag_offset 0x0 + mov m.MainControlT_tmp_22 h.u0_ipv4.flags_frag_offset + and m.MainControlT_tmp_22 0xE000 + mov h.u0_ipv4.flags_frag_offset m.MainControlT_tmp_22 + or h.u0_ipv4.flags_frag_offset 0x0 + mov h.u0_ipv4.ttl 0x40 + mov h.u0_ipv4.protocol 0x11 + mov h.u0_ipv4.dst_addr m.local_metadata___encap_data_underlay_dip4848 + mov h.u0_ipv4.src_addr m.local_metadata___encap_data_underlay_sip4747 + mov h.u0_ipv4.hdr_checksum 0x0 + mov h.u0_udp.src_port 0x0 + mov h.u0_udp.dst_port 0x12B5 + mov h.u0_udp.length 0x1E + add h.u0_udp.length m.MainControlT_customer_ip_len + mov h.u0_udp.checksum 0x0 + mov h.u0_vxlan.reserved 0x0 + mov h.u0_vxlan.reserved_2 0x0 + mov h.u0_vxlan.flags 0x0 + mov h.u0_vxlan.vni m.local_metadata___encap_data_vni4545 + jmp LABEL_END_32 + LABEL_FALSE_28 : jmpneq LABEL_END_32 m.local_metadata___tunnel_pointer3939 0x1 + mov h.u0_ethernet.dst_addr m.local_metadata___overlay_data_dmac5353 + mov h.u1_ethernet.dst_addr m.local_metadata___encap_data_underlay_dmac5050 + mov h.u1_ethernet.src_addr m.local_metadata___encap_data_underlay_smac4949 + mov h.u1_ethernet.ether_type 0x800 + mov m.MainControlT_u0_ip_len 0x0 + jmpnv LABEL_END_36 h.u0_ipv4 + mov m.MainControlT_u0_ip_len h.u0_ipv4.total_len + LABEL_END_36 : jmpnv LABEL_END_37 h.u0_ipv6 + mov m.MainControlT_tmp_33 m.MainControlT_u0_ip_len + add m.MainControlT_tmp_33 0x28 + mov m.MainControlT_u0_ip_len m.MainControlT_tmp_33 + add m.MainControlT_u0_ip_len h.u0_ipv6.payload_length + LABEL_END_37 : mov h.u1_ipv4.total_len 0x32 + add h.u1_ipv4.total_len m.MainControlT_u0_ip_len + mov m.MainControlT_tmp_34 h.u1_ipv4.version_ihl + and m.MainControlT_tmp_34 0xF + mov h.u1_ipv4.version_ihl m.MainControlT_tmp_34 + or h.u1_ipv4.version_ihl 0x40 + mov m.MainControlT_tmp_35 h.u1_ipv4.version_ihl + and m.MainControlT_tmp_35 0xF0 + mov h.u1_ipv4.version_ihl m.MainControlT_tmp_35 + or h.u1_ipv4.version_ihl 0x5 + mov h.u1_ipv4.diffserv 0x0 + mov h.u1_ipv4.identification 0x1 + mov m.MainControlT_tmp_36 h.u1_ipv4.flags_frag_offset + and m.MainControlT_tmp_36 0x1FFF + mov h.u1_ipv4.flags_frag_offset m.MainControlT_tmp_36 + or h.u1_ipv4.flags_frag_offset 0x0 + mov m.MainControlT_tmp_37 h.u1_ipv4.flags_frag_offset + and m.MainControlT_tmp_37 0xE000 + mov h.u1_ipv4.flags_frag_offset m.MainControlT_tmp_37 + or h.u1_ipv4.flags_frag_offset 0x0 + mov h.u1_ipv4.ttl 0x40 + mov h.u1_ipv4.protocol 0x11 + mov h.u1_ipv4.dst_addr m.local_metadata___encap_data_underlay_dip4848 + mov h.u1_ipv4.src_addr m.local_metadata___encap_data_underlay_sip4747 + mov h.u1_ipv4.hdr_checksum 0x0 + mov h.u1_udp.src_port 0x0 + mov h.u1_udp.dst_port 0x12B5 + mov h.u1_udp.length 0x1E + add h.u1_udp.length m.MainControlT_u0_ip_len + mov h.u1_udp.checksum 0x0 + mov h.u1_vxlan.reserved 0x0 + mov h.u1_vxlan.reserved_2 0x0 + mov h.u1_vxlan.flags 0x0 + mov h.u1_vxlan.vni m.local_metadata___encap_data_vni4545 + LABEL_END_32 : add m.local_metadata___tunnel_pointer3939 0x1 + LABEL_END_17 : mov m.MainControlT_tmp m.local_metadata___routing_actions4343 + and m.MainControlT_tmp 0x2 + jmpneq LABEL_FALSE_34 m.MainControlT_tmp 0x0 + jmp LABEL_END_38 + LABEL_FALSE_34 : validate h.u0_ipv6 + mov m.MainControlT_tmp_51 h.u0_ipv6.version_traffic_class_flow_la0 + and m.MainControlT_tmp_51 0xFFFFFFF + mov h.u0_ipv6.version_traffic_class_flow_la0 m.MainControlT_tmp_51 + or h.u0_ipv6.version_traffic_class_flow_la0 0x60000000 + mov m.MainControlT_tmp_52 h.u0_ipv6.version_traffic_class_flow_la0 + and m.MainControlT_tmp_52 0xF00FFFFF + mov h.u0_ipv6.version_traffic_class_flow_la0 m.MainControlT_tmp_52 + or h.u0_ipv6.version_traffic_class_flow_la0 0x0 + mov m.MainControlT_tmp_53 h.u0_ipv6.version_traffic_class_flow_la0 + and m.MainControlT_tmp_53 0xFFF00000 + mov h.u0_ipv6.version_traffic_class_flow_la0 m.MainControlT_tmp_53 + or h.u0_ipv6.version_traffic_class_flow_la0 0x0 + mov h.u0_ipv6.payload_length h.u0_ipv4.total_len + add h.u0_ipv6.payload_length 0xFFEC + mov h.u0_ipv6.next_header h.u0_ipv4.protocol + mov h.u0_ipv6.hop_limit h.u0_ipv4.ttl + movh h.local_metadata___overlay_data_dip_mask5757_128.upper_half m.local_metadata___overlay_data_dip_mask5757 + mov h.local_metadata___overlay_data_dip_mask5757_128.lower_half m.local_metadata___overlay_data_dip_mask5757 + mov h.local_metadata___overlay_data_dip_mask5757_tmp.inter 0xFFFFFFFFFFFFFFFF + xor h.local_metadata___overlay_data_dip_mask5757_128.lower_half h.local_metadata___overlay_data_dip_mask5757_tmp.inter + xor h.local_metadata___overlay_data_dip_mask5757_128.upper_half h.local_metadata___overlay_data_dip_mask5757_tmp.inter + mov m.MainControlT_tmp_55 h.local_metadata___overlay_data_dip_mask5757_128.lower_half + movh m.MainControlT_tmp_55 h.local_metadata___overlay_data_dip_mask5757_128.upper_half + mov m.MainControlT_tmp_56 h.u0_ipv4.dst_addr + movh h.MainControlT_tmp_56_128.upper_half m.MainControlT_tmp_56 + mov h.MainControlT_tmp_56_128.lower_half m.MainControlT_tmp_56 + movh h.MainControlT_tmp_55_128.upper_half m.MainControlT_tmp_55 + mov h.MainControlT_tmp_55_128.lower_half m.MainControlT_tmp_55 + mov h.MainControlT_tmp_56_tmp.inter h.MainControlT_tmp_56_128.lower_half + and h.MainControlT_tmp_56_tmp.inter h.MainControlT_tmp_55_128.lower_half + mov m.MainControlT_tmp_56 h.MainControlT_tmp_56_tmp.inter + mov h.MainControlT_tmp_56_tmp.inter h.MainControlT_tmp_56_128.upper_half + and h.MainControlT_tmp_56_tmp.inter h.MainControlT_tmp_55_128.upper_half + movh m.MainControlT_tmp_56 h.MainControlT_tmp_56_tmp.inter + mov m.MainControlT_tmp_57 m.local_metadata___overlay_data_dip5555 + movh h.MainControlT_tmp_57_128.upper_half m.MainControlT_tmp_57 + mov h.MainControlT_tmp_57_128.lower_half m.MainControlT_tmp_57 + movh h.local_metadata___overlay_data_dip_mask5757_128.upper_half m.local_metadata___overlay_data_dip_mask5757 + mov h.local_metadata___overlay_data_dip_mask5757_128.lower_half m.local_metadata___overlay_data_dip_mask5757 + mov h.MainControlT_tmp_57_tmp.inter h.MainControlT_tmp_57_128.lower_half + and h.MainControlT_tmp_57_tmp.inter h.local_metadata___overlay_data_dip_mask5757_128.lower_half + mov m.MainControlT_tmp_57 h.MainControlT_tmp_57_tmp.inter + mov h.MainControlT_tmp_57_tmp.inter h.MainControlT_tmp_57_128.upper_half + and h.MainControlT_tmp_57_tmp.inter h.local_metadata___overlay_data_dip_mask5757_128.upper_half + movh m.MainControlT_tmp_57 h.MainControlT_tmp_57_tmp.inter + mov h.u0_ipv6.dst_addr m.MainControlT_tmp_56 + movh h.dst_addr_128.upper_half h.u0_ipv6.dst_addr + mov h.dst_addr_128.lower_half h.u0_ipv6.dst_addr + movh h.MainControlT_tmp_57_128.upper_half m.MainControlT_tmp_57 + mov h.MainControlT_tmp_57_128.lower_half m.MainControlT_tmp_57 + mov h.dst_addr_tmp.inter h.dst_addr_128.lower_half + or h.dst_addr_tmp.inter h.MainControlT_tmp_57_128.lower_half + mov h.u0_ipv6.dst_addr h.dst_addr_tmp.inter + mov h.dst_addr_tmp.inter h.dst_addr_128.upper_half + or h.dst_addr_tmp.inter h.MainControlT_tmp_57_128.upper_half + movh h.u0_ipv6.dst_addr h.dst_addr_tmp.inter + movh h.local_metadata___overlay_data_sip_mask5656_128.upper_half m.local_metadata___overlay_data_sip_mask5656 + mov h.local_metadata___overlay_data_sip_mask5656_128.lower_half m.local_metadata___overlay_data_sip_mask5656 + mov h.local_metadata___overlay_data_sip_mask5656_tmp.inter 0xFFFFFFFFFFFFFFFF + xor h.local_metadata___overlay_data_sip_mask5656_128.lower_half h.local_metadata___overlay_data_sip_mask5656_tmp.inter + xor h.local_metadata___overlay_data_sip_mask5656_128.upper_half h.local_metadata___overlay_data_sip_mask5656_tmp.inter + mov m.MainControlT_tmp_59 h.local_metadata___overlay_data_sip_mask5656_128.lower_half + movh m.MainControlT_tmp_59 h.local_metadata___overlay_data_sip_mask5656_128.upper_half + mov m.MainControlT_tmp_60 h.u0_ipv4.src_addr + movh h.MainControlT_tmp_60_128.upper_half m.MainControlT_tmp_60 + mov h.MainControlT_tmp_60_128.lower_half m.MainControlT_tmp_60 + movh h.MainControlT_tmp_59_128.upper_half m.MainControlT_tmp_59 + mov h.MainControlT_tmp_59_128.lower_half m.MainControlT_tmp_59 + mov h.MainControlT_tmp_60_tmp.inter h.MainControlT_tmp_60_128.lower_half + and h.MainControlT_tmp_60_tmp.inter h.MainControlT_tmp_59_128.lower_half + mov m.MainControlT_tmp_60 h.MainControlT_tmp_60_tmp.inter + mov h.MainControlT_tmp_60_tmp.inter h.MainControlT_tmp_60_128.upper_half + and h.MainControlT_tmp_60_tmp.inter h.MainControlT_tmp_59_128.upper_half + movh m.MainControlT_tmp_60 h.MainControlT_tmp_60_tmp.inter + mov m.MainControlT_tmp_61 m.local_metadata___overlay_data_sip5454 + movh h.MainControlT_tmp_61_128.upper_half m.MainControlT_tmp_61 + mov h.MainControlT_tmp_61_128.lower_half m.MainControlT_tmp_61 + movh h.local_metadata___overlay_data_sip_mask5656_128.upper_half m.local_metadata___overlay_data_sip_mask5656 + mov h.local_metadata___overlay_data_sip_mask5656_128.lower_half m.local_metadata___overlay_data_sip_mask5656 + mov h.MainControlT_tmp_61_tmp.inter h.MainControlT_tmp_61_128.lower_half + and h.MainControlT_tmp_61_tmp.inter h.local_metadata___overlay_data_sip_mask5656_128.lower_half + mov m.MainControlT_tmp_61 h.MainControlT_tmp_61_tmp.inter + mov h.MainControlT_tmp_61_tmp.inter h.MainControlT_tmp_61_128.upper_half + and h.MainControlT_tmp_61_tmp.inter h.local_metadata___overlay_data_sip_mask5656_128.upper_half + movh m.MainControlT_tmp_61 h.MainControlT_tmp_61_tmp.inter + mov h.u0_ipv6.src_addr m.MainControlT_tmp_60 + movh h.src_addr_128.upper_half h.u0_ipv6.src_addr + mov h.src_addr_128.lower_half h.u0_ipv6.src_addr + movh h.MainControlT_tmp_61_128.upper_half m.MainControlT_tmp_61 + mov h.MainControlT_tmp_61_128.lower_half m.MainControlT_tmp_61 + mov h.src_addr_tmp.inter h.src_addr_128.lower_half + or h.src_addr_tmp.inter h.MainControlT_tmp_61_128.lower_half + mov h.u0_ipv6.src_addr h.src_addr_tmp.inter + mov h.src_addr_tmp.inter h.src_addr_128.upper_half + or h.src_addr_tmp.inter h.MainControlT_tmp_61_128.upper_half + movh h.u0_ipv6.src_addr h.src_addr_tmp.inter + invalidate h.u0_ipv4 + mov h.u0_ethernet.ether_type 0x86DD + LABEL_END_38 : mov m.MainControlT_tmp_0 m.local_metadata___routing_actions4343 + and m.MainControlT_tmp_0 0x4 + jmpneq LABEL_FALSE_35 m.MainControlT_tmp_0 0x0 + jmp LABEL_END_39 + LABEL_FALSE_35 : validate h.u0_ipv4 + mov m.MainControlT_tmp_62 h.u0_ipv4.version_ihl + and m.MainControlT_tmp_62 0xF + mov h.u0_ipv4.version_ihl m.MainControlT_tmp_62 + or h.u0_ipv4.version_ihl 0x40 + mov m.MainControlT_tmp_63 h.u0_ipv4.version_ihl + and m.MainControlT_tmp_63 0xF0 + mov h.u0_ipv4.version_ihl m.MainControlT_tmp_63 + or h.u0_ipv4.version_ihl 0x5 + mov h.u0_ipv4.diffserv 0x0 + mov h.u0_ipv4.total_len h.u0_ipv6.payload_length + add h.u0_ipv4.total_len 0x14 + mov h.u0_ipv4.identification 0x1 + mov m.MainControlT_tmp_64 h.u0_ipv4.flags_frag_offset + and m.MainControlT_tmp_64 0x1FFF + mov h.u0_ipv4.flags_frag_offset m.MainControlT_tmp_64 + or h.u0_ipv4.flags_frag_offset 0x0 + mov m.MainControlT_tmp_65 h.u0_ipv4.flags_frag_offset + and m.MainControlT_tmp_65 0xE000 + mov h.u0_ipv4.flags_frag_offset m.MainControlT_tmp_65 + or h.u0_ipv4.flags_frag_offset 0x0 + mov h.u0_ipv4.protocol h.u0_ipv6.next_header + mov h.u0_ipv4.ttl h.u0_ipv6.hop_limit + mov h.u0_ipv4.hdr_checksum 0x0 + mov m.MainControlT_tmp_66 m.local_metadata___overlay_data_dip5555 + movh h.MainControlT_tmp_66_128.upper_half m.MainControlT_tmp_66 + mov h.MainControlT_tmp_66_128.lower_half m.MainControlT_tmp_66 + mov h.MainControlT_tmp_66_tmp.inter h.MainControlT_tmp_66_128.lower_half + and h.MainControlT_tmp_66_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_66 h.MainControlT_tmp_66_tmp.inter + mov h.MainControlT_tmp_66_tmp.inter h.MainControlT_tmp_66_128.upper_half + and h.MainControlT_tmp_66_tmp.inter 0x0 + movh m.MainControlT_tmp_66 h.MainControlT_tmp_66_tmp.inter + mov m.MainControlT_tmp_67 m.MainControlT_tmp_66 + movh h.MainControlT_tmp_67_128.upper_half m.MainControlT_tmp_67 + mov h.MainControlT_tmp_67_128.lower_half m.MainControlT_tmp_67 + mov h.MainControlT_tmp_67_tmp.inter h.MainControlT_tmp_67_128.lower_half + and h.MainControlT_tmp_67_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_67 h.MainControlT_tmp_67_tmp.inter + mov h.MainControlT_tmp_67_tmp.inter h.MainControlT_tmp_67_128.upper_half + and h.MainControlT_tmp_67_tmp.inter 0x0 + movh m.MainControlT_tmp_67 h.MainControlT_tmp_67_tmp.inter + mov m.MainControlT_tmp_68 m.MainControlT_tmp_67 + movh h.MainControlT_tmp_68_128.upper_half m.MainControlT_tmp_68 + mov h.MainControlT_tmp_68_128.lower_half m.MainControlT_tmp_68 + mov h.MainControlT_tmp_68_tmp.inter h.MainControlT_tmp_68_128.lower_half + and h.MainControlT_tmp_68_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_68 h.MainControlT_tmp_68_tmp.inter + mov h.MainControlT_tmp_68_tmp.inter h.MainControlT_tmp_68_128.upper_half + and h.MainControlT_tmp_68_tmp.inter 0x0 + movh m.MainControlT_tmp_68 h.MainControlT_tmp_68_tmp.inter + mov h.u0_ipv4.dst_addr m.MainControlT_tmp_68 + mov m.MainControlT_tmp_69 m.local_metadata___overlay_data_sip5454 + movh h.MainControlT_tmp_69_128.upper_half m.MainControlT_tmp_69 + mov h.MainControlT_tmp_69_128.lower_half m.MainControlT_tmp_69 + mov h.MainControlT_tmp_69_tmp.inter h.MainControlT_tmp_69_128.lower_half + and h.MainControlT_tmp_69_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_69 h.MainControlT_tmp_69_tmp.inter + mov h.MainControlT_tmp_69_tmp.inter h.MainControlT_tmp_69_128.upper_half + and h.MainControlT_tmp_69_tmp.inter 0x0 + movh m.MainControlT_tmp_69 h.MainControlT_tmp_69_tmp.inter + mov m.MainControlT_tmp_70 m.MainControlT_tmp_69 + movh h.MainControlT_tmp_70_128.upper_half m.MainControlT_tmp_70 + mov h.MainControlT_tmp_70_128.lower_half m.MainControlT_tmp_70 + mov h.MainControlT_tmp_70_tmp.inter h.MainControlT_tmp_70_128.lower_half + and h.MainControlT_tmp_70_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_70 h.MainControlT_tmp_70_tmp.inter + mov h.MainControlT_tmp_70_tmp.inter h.MainControlT_tmp_70_128.upper_half + and h.MainControlT_tmp_70_tmp.inter 0x0 + movh m.MainControlT_tmp_70 h.MainControlT_tmp_70_tmp.inter + mov m.MainControlT_tmp_71 m.MainControlT_tmp_70 + movh h.MainControlT_tmp_71_128.upper_half m.MainControlT_tmp_71 + mov h.MainControlT_tmp_71_128.lower_half m.MainControlT_tmp_71 + mov h.MainControlT_tmp_71_tmp.inter h.MainControlT_tmp_71_128.lower_half + and h.MainControlT_tmp_71_tmp.inter 0xFFFFFFFF + mov m.MainControlT_tmp_71 h.MainControlT_tmp_71_tmp.inter + mov h.MainControlT_tmp_71_tmp.inter h.MainControlT_tmp_71_128.upper_half + and h.MainControlT_tmp_71_tmp.inter 0x0 + movh m.MainControlT_tmp_71 h.MainControlT_tmp_71_tmp.inter + mov h.u0_ipv4.src_addr m.MainControlT_tmp_71 + invalidate h.u0_ipv6 + mov h.u0_ethernet.ether_type 0x800 + LABEL_END_39 : mov m.MainControlT_tmp_1 m.local_metadata___routing_actions4343 + and m.MainControlT_tmp_1 0x1 + jmpneq LABEL_FALSE_36 m.MainControlT_tmp_1 0x0 + jmp LABEL_END_40 + LABEL_FALSE_36 : jmpneq LABEL_FALSE_37 m.local_metadata___encap_data_dash_encapsulation5151 0x1 + jmpneq LABEL_FALSE_38 m.local_metadata___tunnel_pointer3939 0x0 + mov h.customer_ethernet.dst_addr m.local_metadata___overlay_data_dmac5353 + mov h.u0_ethernet.dst_addr m.local_metadata___encap_data_underlay_dmac5050 + mov h.u0_ethernet.src_addr m.local_metadata___encap_data_underlay_smac4949 + mov h.u0_ethernet.ether_type 0x800 + mov m.MainControlT_customer_ip_len_0 0x0 + jmpnv LABEL_END_43 h.customer_ipv4 + mov m.MainControlT_customer_ip_len_0 h.customer_ipv4.total_len + LABEL_END_43 : jmpnv LABEL_END_44 h.customer_ipv6 + mov m.MainControlT_tmp_23 m.MainControlT_customer_ip_len_0 + add m.MainControlT_tmp_23 0x28 + mov m.MainControlT_customer_ip_len_0 m.MainControlT_tmp_23 + add m.MainControlT_customer_ip_len_0 h.customer_ipv6.payload_length + LABEL_END_44 : mov h.u0_ipv4.total_len 0x32 + add h.u0_ipv4.total_len m.MainControlT_customer_ip_len_0 + mov m.MainControlT_tmp_24 h.u0_ipv4.version_ihl + and m.MainControlT_tmp_24 0xF + mov h.u0_ipv4.version_ihl m.MainControlT_tmp_24 + or h.u0_ipv4.version_ihl 0x40 + mov m.MainControlT_tmp_25 h.u0_ipv4.version_ihl + and m.MainControlT_tmp_25 0xF0 + mov h.u0_ipv4.version_ihl m.MainControlT_tmp_25 + or h.u0_ipv4.version_ihl 0x5 + mov h.u0_ipv4.diffserv 0x0 + mov h.u0_ipv4.identification 0x1 + mov m.MainControlT_tmp_26 h.u0_ipv4.flags_frag_offset + and m.MainControlT_tmp_26 0x1FFF + mov h.u0_ipv4.flags_frag_offset m.MainControlT_tmp_26 + or h.u0_ipv4.flags_frag_offset 0x0 + mov m.MainControlT_tmp_27 h.u0_ipv4.flags_frag_offset + and m.MainControlT_tmp_27 0xE000 + mov h.u0_ipv4.flags_frag_offset m.MainControlT_tmp_27 + or h.u0_ipv4.flags_frag_offset 0x0 + mov h.u0_ipv4.ttl 0x40 + mov h.u0_ipv4.protocol 0x11 + mov h.u0_ipv4.dst_addr m.local_metadata___encap_data_underlay_dip4848 + mov h.u0_ipv4.src_addr m.local_metadata___encap_data_underlay_sip4747 + mov h.u0_ipv4.hdr_checksum 0x0 + mov h.u0_udp.src_port 0x0 + mov h.u0_udp.dst_port 0x12B5 + mov h.u0_udp.length 0x1E + add h.u0_udp.length m.MainControlT_customer_ip_len_0 + mov h.u0_udp.checksum 0x0 + mov h.u0_vxlan.reserved 0x0 + mov h.u0_vxlan.reserved_2 0x0 + mov h.u0_vxlan.flags 0x0 + mov h.u0_vxlan.vni m.local_metadata___encap_data_vni4545 + jmp LABEL_END_41 + LABEL_FALSE_38 : jmpneq LABEL_END_41 m.local_metadata___tunnel_pointer3939 0x1 + mov h.u0_ethernet.dst_addr m.local_metadata___overlay_data_dmac5353 + mov h.u1_ethernet.dst_addr m.local_metadata___encap_data_underlay_dmac5050 + mov h.u1_ethernet.src_addr m.local_metadata___encap_data_underlay_smac4949 + mov h.u1_ethernet.ether_type 0x800 + mov m.MainControlT_u0_ip_len_0 0x0 + jmpnv LABEL_END_46 h.u0_ipv4 + mov m.MainControlT_u0_ip_len_0 h.u0_ipv4.total_len + LABEL_END_46 : jmpnv LABEL_END_47 h.u0_ipv6 + mov m.MainControlT_tmp_38 m.MainControlT_u0_ip_len_0 + add m.MainControlT_tmp_38 0x28 + mov m.MainControlT_u0_ip_len_0 m.MainControlT_tmp_38 + add m.MainControlT_u0_ip_len_0 h.u0_ipv6.payload_length + LABEL_END_47 : mov h.u1_ipv4.total_len 0x32 + add h.u1_ipv4.total_len m.MainControlT_u0_ip_len_0 + mov m.MainControlT_tmp_39 h.u1_ipv4.version_ihl + and m.MainControlT_tmp_39 0xF + mov h.u1_ipv4.version_ihl m.MainControlT_tmp_39 + or h.u1_ipv4.version_ihl 0x40 + mov m.MainControlT_tmp_40 h.u1_ipv4.version_ihl + and m.MainControlT_tmp_40 0xF0 + mov h.u1_ipv4.version_ihl m.MainControlT_tmp_40 + or h.u1_ipv4.version_ihl 0x5 + mov h.u1_ipv4.diffserv 0x0 + mov h.u1_ipv4.identification 0x1 + mov m.MainControlT_tmp_41 h.u1_ipv4.flags_frag_offset + and m.MainControlT_tmp_41 0x1FFF + mov h.u1_ipv4.flags_frag_offset m.MainControlT_tmp_41 + or h.u1_ipv4.flags_frag_offset 0x0 + mov m.MainControlT_tmp_42 h.u1_ipv4.flags_frag_offset + and m.MainControlT_tmp_42 0xE000 + mov h.u1_ipv4.flags_frag_offset m.MainControlT_tmp_42 + or h.u1_ipv4.flags_frag_offset 0x0 + mov h.u1_ipv4.ttl 0x40 + mov h.u1_ipv4.protocol 0x11 + mov h.u1_ipv4.dst_addr m.local_metadata___encap_data_underlay_dip4848 + mov h.u1_ipv4.src_addr m.local_metadata___encap_data_underlay_sip4747 + mov h.u1_ipv4.hdr_checksum 0x0 + mov h.u1_udp.src_port 0x0 + mov h.u1_udp.dst_port 0x12B5 + mov h.u1_udp.length 0x1E + add h.u1_udp.length m.MainControlT_u0_ip_len_0 + mov h.u1_udp.checksum 0x0 + mov h.u1_vxlan.reserved 0x0 + mov h.u1_vxlan.reserved_2 0x0 + mov h.u1_vxlan.flags 0x0 + mov h.u1_vxlan.vni m.local_metadata___encap_data_vni4545 + jmp LABEL_END_41 + LABEL_FALSE_37 : jmpneq LABEL_END_41 m.local_metadata___encap_data_dash_encapsulation5151 0x2 + jmpneq LABEL_FALSE_45 m.local_metadata___tunnel_pointer3939 0x0 + mov h.customer_ethernet.dst_addr m.local_metadata___overlay_data_dmac5353 + mov h.u0_ethernet.dst_addr m.local_metadata___encap_data_underlay_dmac5050 + mov h.u0_ethernet.src_addr m.local_metadata___encap_data_underlay_smac4949 + mov h.u0_ethernet.ether_type 0x800 + mov m.MainControlT_customer_ip_len_1 0x0 + jmpnv LABEL_END_50 h.customer_ipv4 + mov m.MainControlT_customer_ip_len_1 h.customer_ipv4.total_len + LABEL_END_50 : jmpnv LABEL_END_51 h.customer_ipv6 + mov m.MainControlT_tmp_28 m.MainControlT_customer_ip_len_1 + add m.MainControlT_tmp_28 0x28 + mov m.MainControlT_customer_ip_len_1 m.MainControlT_tmp_28 + add m.MainControlT_customer_ip_len_1 h.customer_ipv6.payload_length + LABEL_END_51 : mov h.u0_ipv4.total_len 0x32 + add h.u0_ipv4.total_len m.MainControlT_customer_ip_len_1 + mov m.MainControlT_tmp_29 h.u0_ipv4.version_ihl + and m.MainControlT_tmp_29 0xF + mov h.u0_ipv4.version_ihl m.MainControlT_tmp_29 + or h.u0_ipv4.version_ihl 0x40 + mov m.MainControlT_tmp_30 h.u0_ipv4.version_ihl + and m.MainControlT_tmp_30 0xF0 + mov h.u0_ipv4.version_ihl m.MainControlT_tmp_30 + or h.u0_ipv4.version_ihl 0x5 + mov h.u0_ipv4.diffserv 0x0 + mov h.u0_ipv4.identification 0x1 + mov m.MainControlT_tmp_31 h.u0_ipv4.flags_frag_offset + and m.MainControlT_tmp_31 0x1FFF + mov h.u0_ipv4.flags_frag_offset m.MainControlT_tmp_31 + or h.u0_ipv4.flags_frag_offset 0x0 + mov m.MainControlT_tmp_32 h.u0_ipv4.flags_frag_offset + and m.MainControlT_tmp_32 0xE000 + mov h.u0_ipv4.flags_frag_offset m.MainControlT_tmp_32 + or h.u0_ipv4.flags_frag_offset 0x0 + mov h.u0_ipv4.ttl 0x40 + mov h.u0_ipv4.protocol 0x11 + mov h.u0_ipv4.dst_addr m.local_metadata___encap_data_underlay_dip4848 + mov h.u0_ipv4.src_addr m.local_metadata___encap_data_underlay_sip4747 + mov h.u0_ipv4.hdr_checksum 0x0 + mov h.u0_udp.src_port 0x0 + mov h.u0_udp.dst_port 0x12B5 + mov h.u0_udp.length 0x1E + add h.u0_udp.length m.MainControlT_customer_ip_len_1 + mov h.u0_udp.checksum 0x0 + mov h.u0_vxlan.reserved 0x0 + mov h.u0_vxlan.reserved_2 0x0 + mov h.u0_vxlan.flags 0x0 + mov h.u0_vxlan.vni m.local_metadata___encap_data_vni4545 + jmp LABEL_END_41 + LABEL_FALSE_45 : jmpneq LABEL_END_41 m.local_metadata___tunnel_pointer3939 0x1 + mov h.u0_ethernet.dst_addr m.local_metadata___overlay_data_dmac5353 + mov h.u1_ethernet.dst_addr m.local_metadata___encap_data_underlay_dmac5050 + mov h.u1_ethernet.src_addr m.local_metadata___encap_data_underlay_smac4949 + mov h.u1_ethernet.ether_type 0x800 + mov m.MainControlT_u0_ip_len_1 0x0 + jmpnv LABEL_END_53 h.u0_ipv4 + mov m.MainControlT_u0_ip_len_1 h.u0_ipv4.total_len + LABEL_END_53 : jmpnv LABEL_END_54 h.u0_ipv6 + mov m.MainControlT_tmp_43 m.MainControlT_u0_ip_len_1 + add m.MainControlT_tmp_43 0x28 + mov m.MainControlT_u0_ip_len_1 m.MainControlT_tmp_43 + add m.MainControlT_u0_ip_len_1 h.u0_ipv6.payload_length + LABEL_END_54 : mov h.u1_ipv4.total_len 0x32 + add h.u1_ipv4.total_len m.MainControlT_u0_ip_len_1 + mov m.MainControlT_tmp_44 h.u1_ipv4.version_ihl + and m.MainControlT_tmp_44 0xF + mov h.u1_ipv4.version_ihl m.MainControlT_tmp_44 + or h.u1_ipv4.version_ihl 0x40 + mov m.MainControlT_tmp_45 h.u1_ipv4.version_ihl + and m.MainControlT_tmp_45 0xF0 + mov h.u1_ipv4.version_ihl m.MainControlT_tmp_45 + or h.u1_ipv4.version_ihl 0x5 + mov h.u1_ipv4.diffserv 0x0 + mov h.u1_ipv4.identification 0x1 + mov m.MainControlT_tmp_46 h.u1_ipv4.flags_frag_offset + and m.MainControlT_tmp_46 0x1FFF + mov h.u1_ipv4.flags_frag_offset m.MainControlT_tmp_46 + or h.u1_ipv4.flags_frag_offset 0x0 + mov m.MainControlT_tmp_47 h.u1_ipv4.flags_frag_offset + and m.MainControlT_tmp_47 0xE000 + mov h.u1_ipv4.flags_frag_offset m.MainControlT_tmp_47 + or h.u1_ipv4.flags_frag_offset 0x0 + mov h.u1_ipv4.ttl 0x40 + mov h.u1_ipv4.protocol 0x11 + mov h.u1_ipv4.dst_addr m.local_metadata___encap_data_underlay_dip4848 + mov h.u1_ipv4.src_addr m.local_metadata___encap_data_underlay_sip4747 + mov h.u1_ipv4.hdr_checksum 0x0 + mov h.u1_udp.src_port 0x0 + mov h.u1_udp.dst_port 0x12B5 + mov h.u1_udp.length 0x1E + add h.u1_udp.length m.MainControlT_u0_ip_len_1 + mov h.u1_udp.checksum 0x0 + mov h.u1_vxlan.reserved 0x0 + mov h.u1_vxlan.reserved_2 0x0 + mov h.u1_vxlan.flags 0x0 + mov h.u1_vxlan.vni m.local_metadata___encap_data_vni4545 + LABEL_END_41 : add m.local_metadata___tunnel_pointer3939 0x1 + LABEL_END_40 : mov m.local_metadata___dst_ip_addr1919 h.u0_ipv4.dst_addr + table underlay_underlay_routing + jmpneq LABEL_END_55 m.local_metadata___meter_policy_en3131 0x1 + table metering_update_stage_meter_policy + mov m.dash_ingress_metering_update_stage_meter_rule_u0_ipv4_dst_a5 h.u0_ipv4.dst_addr + table metering_update_stage_meter_rule + LABEL_END_55 : jmpneq LABEL_FALSE_52 m.local_metadata___meter_policy_en3131 0x1 + mov m.local_metadata___meter_class3737 m.local_metadata___policy_meter_class3434 + jmp LABEL_END_56 + LABEL_FALSE_52 : mov m.local_metadata___meter_class3737 m.local_metadata___route_meter_class3535 + LABEL_END_56 : jmpeq LABEL_TRUE_53 m.local_metadata___meter_class3737 0x0 + jmpeq LABEL_TRUE_53 m.local_metadata___mapping_meter_class_override3232 0x1 + jmp LABEL_END_57 + LABEL_TRUE_53 : mov m.local_metadata___meter_class3737 m.local_metadata___mapping_meter_class3636 + LABEL_END_57 : mov m.dash_ingress_metering_update_stage_meter_bucket_local_metad6 m.local_metadata___eni_id44 + mov m.dash_ingress_metering_update_stage_meter_bucket_local_metad7 m.local_metadata___meter_class3737 + table metering_update_stage_meter_bucket + mov m.dash_ingress_metering_update_stage_eni_meter_local_metadata8 m.local_metadata___eni_id44 + mov m.dash_ingress_metering_update_stage_eni_meter_local_metadata9 m.local_metadata___direction00 + mov m.dash_ingress_metering_update_stage_eni_meter_local_metadat10 m.local_metadata___dropped4444 + table metering_update_stage_eni_meter + jmpneq LABEL_END_58 m.local_metadata___dropped4444 0x1 + drop + LABEL_END_58 : emit h.u0_ethernet + emit h.u0_ipv4 + emit h.u0_ipv4options + emit h.u0_ipv6 + emit h.u0_udp + emit h.u0_tcp + emit h.u0_vxlan + emit h.u0_nvgre + emit h.customer_ethernet + emit h.customer_ipv4 + emit h.customer_ipv6 + emit h.customer_tcp + emit h.customer_udp + tx m.pna_main_output_metadata_output_port +} + + diff --git a/testdata/p4_16_samples_outputs/pna-direction-main-parser-err.p4.spec b/testdata/p4_16_samples_outputs/pna-direction-main-parser-err.p4.spec index bf0d916a71d..75697719bcf 100644 --- a/testdata/p4_16_samples_outputs/pna-direction-main-parser-err.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-direction-main-parser-err.p4.spec @@ -28,8 +28,8 @@ struct main_metadata_t { bit<32> pna_main_input_metadata_input_port bit<32> local_metadata_tmpDir bit<32> pna_main_output_metadata_output_port - bit<32> MainParserT_parser_tmp - bit<32> MainParserT_parser_tmp_0 + bit<8> MainParserT_parser_tmp + bit<8> MainParserT_parser_tmp_0 bit<32> MainControlT_tmpDir } metadata instanceof main_metadata_t diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-large-constants-first.p4 b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants-first.p4 new file mode 100644 index 00000000000..35ff8ba7fbd --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants-first.p4 @@ -0,0 +1,149 @@ +#include +#include + +typedef bit<48> EthernetAddress; +typedef bit<32> IPv4Address; +header Ethernet_h { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header IPv4_h { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + IPv4Address srcAddr; + IPv4Address dstAddr; +} + +header IPv6_h { + bit<4> version; + bit<8> trafficClass; + bit<20> flowLabel; + bit<16> payloadLen; + bit<8> nextHdr; + bit<8> hopLimit; + bit<128> srcAddr; + bit<128> dstAddr; +} + +header mpls_h { + bit<20> label; + bit<3> tc; + bit<1> stack; + bit<8> ttl; +} + +struct headers_t { + Ethernet_h ethernet; + mpls_h mpls; + IPv4_h ipv4; + IPv6_h ipv6; +} + +struct main_metadata_t { +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in p, out headers_t headers, inout main_metadata_t meta, in pna_main_parser_input_metadata_t istd) { + state start { + p.extract(headers.ethernet); + transition select(headers.ethernet.etherType) { + 16w0x800: ipv4; + 16w0x86dd: ipv6; + 16w0x8847: mpls; + default: reject; + } + } + state mpls { + p.extract(headers.mpls); + transition ipv4; + } + state ipv4 { + p.extract(headers.ipv4); + transition accept; + } + state ipv6 { + p.extract(headers.ipv6); + transition accept; + } +} + +control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + bit<128> tmp = 128w0x123456789abcdef12345678; + bit<32> tmp1; + action Reject() { + drop_packet(); + } + action ipv6_modify_dstAddr(bit<32> dstAddr) { + headers.ipv6.dstAddr = (bit<128>)dstAddr; + tmp1 = (bit<32>)headers.ipv6.srcAddr; + } + action ipv6_swap_addr() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr; + headers.ipv6.srcAddr = tmp; + } + action set_flowlabel(bit<20> label) { + headers.ipv6.flowLabel = label; + } + action set_traffic_class(bit<8> trafficClass) { + headers.ipv6.trafficClass = trafficClass; + } + action set_traffic_class_flow_label(bit<8> trafficClass, bit<20> label) { + headers.ipv6.trafficClass = trafficClass; + headers.ipv6.flowLabel = label; + headers.ipv6.srcAddr = (bit<128>)tmp1; + } + action set_ipv6_version(bit<4> version) { + headers.ipv6.version = version; + } + action set_next_hdr(bit<8> nextHdr) { + headers.ipv6.nextHdr = nextHdr; + } + action set_hop_limit(bit<8> hopLimit) { + headers.ipv6.hopLimit = hopLimit; + } + table filter_tbl { + key = { + headers.ipv6.srcAddr: exact @name("headers.ipv6.srcAddr"); + } + actions = { + ipv6_modify_dstAddr(); + ipv6_swap_addr(); + set_flowlabel(); + set_traffic_class_flow_label(); + set_ipv6_version(); + set_next_hdr(); + set_hop_limit(); + Reject(); + NoAction(); + } + default_action = NoAction(); + } + apply { + filter_tbl.apply(); + } +} + +control MainDeparserImpl(packet_out packet, in headers_t headers, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + packet.emit(headers.ethernet); + packet.emit(headers.mpls); + packet.emit(headers.ipv6); + packet.emit(headers.ipv4); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-large-constants-frontend.p4 b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants-frontend.p4 new file mode 100644 index 00000000000..841cd479cb8 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants-frontend.p4 @@ -0,0 +1,148 @@ +#include +#include + +typedef bit<48> EthernetAddress; +typedef bit<32> IPv4Address; +header Ethernet_h { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header IPv4_h { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + IPv4Address srcAddr; + IPv4Address dstAddr; +} + +header IPv6_h { + bit<4> version; + bit<8> trafficClass; + bit<20> flowLabel; + bit<16> payloadLen; + bit<8> nextHdr; + bit<8> hopLimit; + bit<128> srcAddr; + bit<128> dstAddr; +} + +header mpls_h { + bit<20> label; + bit<3> tc; + bit<1> stack; + bit<8> ttl; +} + +struct headers_t { + Ethernet_h ethernet; + mpls_h mpls; + IPv4_h ipv4; + IPv6_h ipv6; +} + +struct main_metadata_t { +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in p, out headers_t headers, inout main_metadata_t meta, in pna_main_parser_input_metadata_t istd) { + state start { + p.extract(headers.ethernet); + transition select(headers.ethernet.etherType) { + 16w0x800: ipv4; + 16w0x86dd: ipv6; + 16w0x8847: mpls; + default: reject; + } + } + state mpls { + p.extract(headers.mpls); + transition ipv4; + } + state ipv4 { + p.extract(headers.ipv4); + transition accept; + } + state ipv6 { + p.extract(headers.ipv6); + transition accept; + } +} + +control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + @name("MainControlImpl.tmp") bit<128> tmp_0; + @name("MainControlImpl.tmp1") bit<32> tmp1_0; + @noWarn("unused") @name(".NoAction") action NoAction_1() { + } + @name("MainControlImpl.Reject") action Reject() { + drop_packet(); + } + @name("MainControlImpl.ipv6_modify_dstAddr") action ipv6_modify_dstAddr(@name("dstAddr") bit<32> dstAddr_1) { + headers.ipv6.dstAddr = (bit<128>)dstAddr_1; + } + @name("MainControlImpl.ipv6_swap_addr") action ipv6_swap_addr() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr; + headers.ipv6.srcAddr = tmp_0; + } + @name("MainControlImpl.set_flowlabel") action set_flowlabel(@name("label") bit<20> label_2) { + headers.ipv6.flowLabel = label_2; + } + @name("MainControlImpl.set_traffic_class_flow_label") action set_traffic_class_flow_label(@name("trafficClass") bit<8> trafficClass_1, @name("label") bit<20> label_3) { + headers.ipv6.trafficClass = trafficClass_1; + headers.ipv6.flowLabel = label_3; + headers.ipv6.srcAddr = (bit<128>)tmp1_0; + } + @name("MainControlImpl.set_ipv6_version") action set_ipv6_version(@name("version") bit<4> version_1) { + headers.ipv6.version = version_1; + } + @name("MainControlImpl.set_next_hdr") action set_next_hdr(@name("nextHdr") bit<8> nextHdr_1) { + headers.ipv6.nextHdr = nextHdr_1; + } + @name("MainControlImpl.set_hop_limit") action set_hop_limit(@name("hopLimit") bit<8> hopLimit_1) { + headers.ipv6.hopLimit = hopLimit_1; + } + @name("MainControlImpl.filter_tbl") table filter_tbl_0 { + key = { + headers.ipv6.srcAddr: exact @name("headers.ipv6.srcAddr"); + } + actions = { + ipv6_modify_dstAddr(); + ipv6_swap_addr(); + set_flowlabel(); + set_traffic_class_flow_label(); + set_ipv6_version(); + set_next_hdr(); + set_hop_limit(); + Reject(); + NoAction_1(); + } + default_action = NoAction_1(); + } + apply { + tmp_0 = 128w0x123456789abcdef12345678; + filter_tbl_0.apply(); + } +} + +control MainDeparserImpl(packet_out packet, in headers_t headers, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + packet.emit(headers.ethernet); + packet.emit(headers.mpls); + packet.emit(headers.ipv6); + packet.emit(headers.ipv4); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-large-constants-midend.p4 b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants-midend.p4 new file mode 100644 index 00000000000..8fd29e134e0 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants-midend.p4 @@ -0,0 +1,164 @@ +#include +#include + +header Ethernet_h { + bit<48> dstAddr; + bit<48> srcAddr; + bit<16> etherType; +} + +header IPv4_h { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; +} + +header IPv6_h { + bit<4> version; + bit<8> trafficClass; + bit<20> flowLabel; + bit<16> payloadLen; + bit<8> nextHdr; + bit<8> hopLimit; + bit<128> srcAddr; + bit<128> dstAddr; +} + +header mpls_h { + bit<20> label; + bit<3> tc; + bit<1> stack; + bit<8> ttl; +} + +struct headers_t { + Ethernet_h ethernet; + mpls_h mpls; + IPv4_h ipv4; + IPv6_h ipv6; +} + +struct main_metadata_t { +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in p, out headers_t headers, inout main_metadata_t meta, in pna_main_parser_input_metadata_t istd) { + state start { + p.extract(headers.ethernet); + transition select(headers.ethernet.etherType) { + 16w0x800: ipv4; + 16w0x86dd: ipv6; + 16w0x8847: mpls; + default: reject; + } + } + state mpls { + p.extract(headers.mpls); + transition ipv4; + } + state ipv4 { + p.extract(headers.ipv4); + transition accept; + } + state ipv6 { + p.extract(headers.ipv6); + transition accept; + } +} + +control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + @name("MainControlImpl.tmp") bit<128> tmp_0; + @name("MainControlImpl.tmp1") bit<32> tmp1_0; + @noWarn("unused") @name(".NoAction") action NoAction_1() { + } + @name("MainControlImpl.Reject") action Reject() { + drop_packet(); + } + @name("MainControlImpl.ipv6_modify_dstAddr") action ipv6_modify_dstAddr(@name("dstAddr") bit<32> dstAddr_1) { + headers.ipv6.dstAddr = (bit<128>)dstAddr_1; + } + @name("MainControlImpl.ipv6_swap_addr") action ipv6_swap_addr() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr; + headers.ipv6.srcAddr = tmp_0; + } + @name("MainControlImpl.set_flowlabel") action set_flowlabel(@name("label") bit<20> label_2) { + headers.ipv6.flowLabel = label_2; + } + @name("MainControlImpl.set_traffic_class_flow_label") action set_traffic_class_flow_label(@name("trafficClass") bit<8> trafficClass_1, @name("label") bit<20> label_3) { + headers.ipv6.trafficClass = trafficClass_1; + headers.ipv6.flowLabel = label_3; + headers.ipv6.srcAddr = (bit<128>)tmp1_0; + } + @name("MainControlImpl.set_ipv6_version") action set_ipv6_version(@name("version") bit<4> version_1) { + headers.ipv6.version = version_1; + } + @name("MainControlImpl.set_next_hdr") action set_next_hdr(@name("nextHdr") bit<8> nextHdr_1) { + headers.ipv6.nextHdr = nextHdr_1; + } + @name("MainControlImpl.set_hop_limit") action set_hop_limit(@name("hopLimit") bit<8> hopLimit_1) { + headers.ipv6.hopLimit = hopLimit_1; + } + @name("MainControlImpl.filter_tbl") table filter_tbl_0 { + key = { + headers.ipv6.srcAddr: exact @name("headers.ipv6.srcAddr"); + } + actions = { + ipv6_modify_dstAddr(); + ipv6_swap_addr(); + set_flowlabel(); + set_traffic_class_flow_label(); + set_ipv6_version(); + set_next_hdr(); + set_hop_limit(); + Reject(); + NoAction_1(); + } + default_action = NoAction_1(); + } + @hidden action pnadpdklargeconstants109() { + tmp_0 = 128w0x123456789abcdef12345678; + } + @hidden table tbl_pnadpdklargeconstants109 { + actions = { + pnadpdklargeconstants109(); + } + const default_action = pnadpdklargeconstants109(); + } + apply { + tbl_pnadpdklargeconstants109.apply(); + filter_tbl_0.apply(); + } +} + +control MainDeparserImpl(packet_out packet, in headers_t headers, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + @hidden action pnadpdklargeconstants180() { + packet.emit(headers.ethernet); + packet.emit(headers.mpls); + packet.emit(headers.ipv6); + packet.emit(headers.ipv4); + } + @hidden table tbl_pnadpdklargeconstants180 { + actions = { + pnadpdklargeconstants180(); + } + const default_action = pnadpdklargeconstants180(); + } + apply { + tbl_pnadpdklargeconstants180.apply(); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4 b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4 new file mode 100644 index 00000000000..ab84afdc43c --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4 @@ -0,0 +1,148 @@ +#include +#include + +typedef bit<48> EthernetAddress; +typedef bit<32> IPv4Address; +header Ethernet_h { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header IPv4_h { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + IPv4Address srcAddr; + IPv4Address dstAddr; +} + +header IPv6_h { + bit<4> version; + bit<8> trafficClass; + bit<20> flowLabel; + bit<16> payloadLen; + bit<8> nextHdr; + bit<8> hopLimit; + bit<128> srcAddr; + bit<128> dstAddr; +} + +header mpls_h { + bit<20> label; + bit<3> tc; + bit<1> stack; + bit<8> ttl; +} + +struct headers_t { + Ethernet_h ethernet; + mpls_h mpls; + IPv4_h ipv4; + IPv6_h ipv6; +} + +struct main_metadata_t { +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in p, out headers_t headers, inout main_metadata_t meta, in pna_main_parser_input_metadata_t istd) { + state start { + p.extract(headers.ethernet); + transition select(headers.ethernet.etherType) { + 16w0x800: ipv4; + 0x86dd: ipv6; + 0x8847: mpls; + default: reject; + } + } + state mpls { + p.extract(headers.mpls); + transition ipv4; + } + state ipv4 { + p.extract(headers.ipv4); + transition accept; + } + state ipv6 { + p.extract(headers.ipv6); + transition accept; + } +} + +control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + bit<128> tmp = 128w0x123456789abcdef12345678; + bit<32> tmp1; + action Reject() { + drop_packet(); + } + action ipv6_modify_dstAddr(bit<32> dstAddr) { + headers.ipv6.dstAddr = (bit<128>)dstAddr; + tmp1 = (bit<32>)headers.ipv6.srcAddr; + } + action ipv6_swap_addr() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr; + headers.ipv6.srcAddr = tmp; + } + action set_flowlabel(bit<20> label) { + headers.ipv6.flowLabel = label; + } + action set_traffic_class(bit<8> trafficClass) { + headers.ipv6.trafficClass = trafficClass; + } + action set_traffic_class_flow_label(bit<8> trafficClass, bit<20> label) { + headers.ipv6.trafficClass = trafficClass; + headers.ipv6.flowLabel = label; + headers.ipv6.srcAddr = (bit<128>)tmp1; + } + action set_ipv6_version(bit<4> version) { + headers.ipv6.version = version; + } + action set_next_hdr(bit<8> nextHdr) { + headers.ipv6.nextHdr = nextHdr; + } + action set_hop_limit(bit<8> hopLimit) { + headers.ipv6.hopLimit = hopLimit; + } + table filter_tbl { + key = { + headers.ipv6.srcAddr: exact; + } + actions = { + ipv6_modify_dstAddr; + ipv6_swap_addr; + set_flowlabel; + set_traffic_class_flow_label; + set_ipv6_version; + set_next_hdr; + set_hop_limit; + Reject; + NoAction; + } + } + apply { + filter_tbl.apply(); + } +} + +control MainDeparserImpl(packet_out packet, in headers_t headers, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + packet.emit(headers.ethernet); + packet.emit(headers.mpls); + packet.emit(headers.ipv6); + packet.emit(headers.ipv4); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4-error b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4-error new file mode 100644 index 00000000000..5bb90e28208 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4-error @@ -0,0 +1,3 @@ +pna-dpdk-large-constants.p4(136): [--Wwarn=uninitialized_use] warning: tmp1 may be uninitialized + headers.ipv6.srcAddr = (bit<128>)tmp1; + ^^^^ diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4-stderr b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4-stderr new file mode 100644 index 00000000000..5bb90e28208 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4-stderr @@ -0,0 +1,3 @@ +pna-dpdk-large-constants.p4(136): [--Wwarn=uninitialized_use] warning: tmp1 may be uninitialized + headers.ipv6.srcAddr = (bit<128>)tmp1; + ^^^^ diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4.bfrt.json b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4.bfrt.json new file mode 100644 index 00000000000..03ee286a952 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4.bfrt.json @@ -0,0 +1,187 @@ +{ + "schema_version" : "1.0.0", + "tables" : [ + { + "name" : "pipe.MainControlImpl.filter_tbl", + "id" : 34917681, + "table_type" : "MatchAction_Direct", + "size" : 1024, + "annotations" : [], + "depends_on" : [], + "has_const_default_action" : false, + "key" : [ + { + "id" : 1, + "name" : "headers.ipv6.srcAddr", + "repeated" : false, + "annotations" : [], + "mandatory" : false, + "match_type" : "Exact", + "type" : { + "type" : "bytes", + "width" : 128 + } + } + ], + "action_specs" : [ + { + "id" : 29705768, + "name" : "MainControlImpl.ipv6_modify_dstAddr", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "dstAddr", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 32 + } + } + ] + }, + { + "id" : 22459520, + "name" : "MainControlImpl.ipv6_swap_addr", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + }, + { + "id" : 23653337, + "name" : "MainControlImpl.set_flowlabel", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "label", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 20 + } + } + ] + }, + { + "id" : 31572308, + "name" : "MainControlImpl.set_traffic_class_flow_label", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "trafficClass", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 8 + } + }, + { + "id" : 2, + "name" : "label", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 20 + } + } + ] + }, + { + "id" : 28719183, + "name" : "MainControlImpl.set_ipv6_version", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "version", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 4 + } + } + ] + }, + { + "id" : 31932328, + "name" : "MainControlImpl.set_next_hdr", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "nextHdr", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 8 + } + } + ] + }, + { + "id" : 20663179, + "name" : "MainControlImpl.set_hop_limit", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "hopLimit", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 8 + } + } + ] + }, + { + "id" : 29705564, + "name" : "MainControlImpl.Reject", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + }, + { + "id" : 21257015, + "name" : "NoAction", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + } + ], + "data" : [], + "supported_operations" : [], + "attributes" : ["EntryScope"] + } + ], + "learn_filters" : [] +} \ No newline at end of file diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4.spec b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4.spec new file mode 100644 index 00000000000..e7a3f822119 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk-large-constants.p4.spec @@ -0,0 +1,212 @@ + +struct Ethernet_h { + bit<48> dstAddr + bit<48> srcAddr + bit<16> etherType +} + +struct mpls_h { + bit<24> label_tc_stack + bit<8> ttl +} + +struct IPv4_h { + bit<8> version_ihl + bit<8> diffserv + bit<16> totalLen + bit<16> identification + bit<16> flags_fragOffset + bit<8> ttl + bit<8> protocol + bit<16> hdrChecksum + bit<32> srcAddr + bit<32> dstAddr +} + +struct IPv6_h { + bit<32> version_trafficClass_flowLabel + bit<16> payloadLen + bit<8> nextHdr + bit<8> hopLimit + bit<128> srcAddr + bit<128> dstAddr +} + +struct dpdk_pseudo_header_t { + bit<32> pseudo + bit<32> pseudo_0 +} + +struct _p4c_sandbox_header_t { + bit<64> upper_half + bit<64> lower_half +} + +struct ipv6_modify_dstAddr_arg_t { + bit<32> dstAddr +} + +struct set_flowlabel_arg_t { + bit<24> label +} + +struct set_hop_limit_arg_t { + bit<8> hopLimit +} + +struct set_ipv6_version_arg_t { + bit<8> version +} + +struct set_next_hdr_arg_t { + bit<8> nextHdr +} + +struct set_traffic_class_flow_label_arg_t { + bit<8> trafficClass + bit<24> label +} + +header ethernet instanceof Ethernet_h +header mpls instanceof mpls_h +header ipv4 instanceof IPv4_h +header ipv6 instanceof IPv6_h +header dpdk_pseudo_header instanceof dpdk_pseudo_header_t + +struct main_metadata_t { + bit<32> pna_main_input_metadata_input_port + bit<32> pna_main_output_metadata_output_port + bit<32> MainControlT_tmp + bit<32> MainControlT_tmp_1 + bit<32> MainControlT_tmp_2 + bit<32> MainControlT_tmp_4 + bit<32> MainControlT_tmp_5 + bit<32> MainControlT_tmp_6 + bit<32> MainControlT_tmp_8 + bit<32> MainControlT_tmp_9 + bit<32> MainControlT_tmp_11 + bit<32> MainControlT_tmp_12 + bit<128> MainControlT_tmp_13 + bit<32> MainControlT_tmp1 +} +metadata instanceof main_metadata_t + +header MainControlT_tmp_13_128 instanceof _p4c_sandbox_header_t +regarray direction size 0x100 initval 0 +action NoAction args none { + return +} + +action Reject args none { + drop + return +} + +action ipv6_modify_dstAddr args instanceof ipv6_modify_dstAddr_arg_t { + mov h.dpdk_pseudo_header.pseudo t.dstAddr + mov h.ipv6.dstAddr h.dpdk_pseudo_header.pseudo + return +} + +action ipv6_swap_addr args none { + mov h.ipv6.dstAddr h.ipv6.srcAddr + mov h.ipv6.srcAddr m.MainControlT_tmp_13 + return +} + +action set_flowlabel args instanceof set_flowlabel_arg_t { + mov m.MainControlT_tmp h.ipv6.version_trafficClass_flowLabel + and m.MainControlT_tmp 0xFFF00000 + mov m.MainControlT_tmp_1 t.label + and m.MainControlT_tmp_1 0xFFFFF + mov h.ipv6.version_trafficClass_flowLabel m.MainControlT_tmp + or h.ipv6.version_trafficClass_flowLabel m.MainControlT_tmp_1 + return +} + +action set_traffic_class_flow_label args instanceof set_traffic_class_flow_label_arg_t { + mov m.MainControlT_tmp_2 h.ipv6.version_trafficClass_flowLabel + and m.MainControlT_tmp_2 0xF00FFFFF + mov m.MainControlT_tmp_4 t.trafficClass + shl m.MainControlT_tmp_4 0x14 + mov m.MainControlT_tmp_5 m.MainControlT_tmp_4 + and m.MainControlT_tmp_5 0xFF00000 + mov h.ipv6.version_trafficClass_flowLabel m.MainControlT_tmp_2 + or h.ipv6.version_trafficClass_flowLabel m.MainControlT_tmp_5 + mov m.MainControlT_tmp_6 h.ipv6.version_trafficClass_flowLabel + and m.MainControlT_tmp_6 0xFFF00000 + mov m.MainControlT_tmp_8 t.label + and m.MainControlT_tmp_8 0xFFFFF + mov h.ipv6.version_trafficClass_flowLabel m.MainControlT_tmp_6 + or h.ipv6.version_trafficClass_flowLabel m.MainControlT_tmp_8 + mov h.dpdk_pseudo_header.pseudo_0 m.MainControlT_tmp1 + mov h.ipv6.srcAddr h.dpdk_pseudo_header.pseudo_0 + return +} + +action set_ipv6_version args instanceof set_ipv6_version_arg_t { + mov m.MainControlT_tmp_9 h.ipv6.version_trafficClass_flowLabel + and m.MainControlT_tmp_9 0xFFFFFFF + mov m.MainControlT_tmp_11 t.version + shl m.MainControlT_tmp_11 0x1C + mov m.MainControlT_tmp_12 m.MainControlT_tmp_11 + and m.MainControlT_tmp_12 0xF0000000 + mov h.ipv6.version_trafficClass_flowLabel m.MainControlT_tmp_9 + or h.ipv6.version_trafficClass_flowLabel m.MainControlT_tmp_12 + return +} + +action set_next_hdr args instanceof set_next_hdr_arg_t { + mov h.ipv6.nextHdr t.nextHdr + return +} + +action set_hop_limit args instanceof set_hop_limit_arg_t { + mov h.ipv6.hopLimit t.hopLimit + return +} + +table filter_tbl { + key { + h.ipv6.srcAddr exact + } + actions { + ipv6_modify_dstAddr + ipv6_swap_addr + set_flowlabel + set_traffic_class_flow_label + set_ipv6_version + set_next_hdr + set_hop_limit + Reject + NoAction + } + default_action NoAction args none + size 0x10000 +} + + +apply { + rx m.pna_main_input_metadata_input_port + extract h.ethernet + jmpeq MAINPARSERIMPL_IPV4 h.ethernet.etherType 0x800 + jmpeq MAINPARSERIMPL_IPV6 h.ethernet.etherType 0x86DD + jmpeq MAINPARSERIMPL_MPLS h.ethernet.etherType 0x8847 + jmp MAINPARSERIMPL_ACCEPT + MAINPARSERIMPL_MPLS : extract h.mpls + MAINPARSERIMPL_IPV4 : extract h.ipv4 + jmp MAINPARSERIMPL_ACCEPT + MAINPARSERIMPL_IPV6 : extract h.ipv6 + MAINPARSERIMPL_ACCEPT : mov h.MainControlT_tmp_13_128.upper_half 0x1234567 + mov h.MainControlT_tmp_13_128.lower_half 0x89ABCDEF12345678 + mov m.MainControlT_tmp_13 h.MainControlT_tmp_13_128.lower_half + movh m.MainControlT_tmp_13 h.MainControlT_tmp_13_128.upper_half + table filter_tbl + emit h.ethernet + emit h.mpls + emit h.ipv6 + emit h.ipv4 + tx m.pna_main_output_metadata_output_port +} + + diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-parser-state-err.p4.spec b/testdata/p4_16_samples_outputs/pna-dpdk-parser-state-err.p4.spec index 937903e206b..d1a170bb2c8 100644 --- a/testdata/p4_16_samples_outputs/pna-dpdk-parser-state-err.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-dpdk-parser-state-err.p4.spec @@ -50,17 +50,17 @@ struct next_hop_arg_t { struct main_metadata_t { bit<32> pna_main_input_metadata_input_port - bit<32> local_metadata_rng_result1 + bit<8> local_metadata_rng_result1 bit<16> local_metadata_min1 bit<16> local_metadata_max1 bit<8> local_metadata_timeout bit<32> pna_main_output_metadata_output_port - bit<32> MainParserT_parser_tmp + bit<8> MainParserT_parser_tmp bit<32> MainControlT_tmp bit<32> MainControlT_tmp_0 - bit<32> MainControlT_tmp_1 - bit<32> MainControlT_tmp_2 - bit<32> MainControlT_tmp_3 + bit<8> MainControlT_tmp_1 + bit<8> MainControlT_tmp_2 + bit<8> MainControlT_tmp_3 bit<32> learnArg } metadata instanceof main_metadata_t diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-parser-wrong-arith.p4.spec b/testdata/p4_16_samples_outputs/pna-dpdk-parser-wrong-arith.p4.spec index eb0bbabacdc..dbcda58d9a7 100644 --- a/testdata/p4_16_samples_outputs/pna-dpdk-parser-wrong-arith.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-dpdk-parser-wrong-arith.p4.spec @@ -21,11 +21,11 @@ struct ipv4_t { struct user_metadata_t { bit<32> pna_main_input_metadata_input_port - bit<32> local_metadata_ipv4_hdr_truncated + bit<8> local_metadata_ipv4_hdr_truncated bit<32> pna_main_output_metadata_output_port bit<8> MainParserT_parser_tmp bit<8> MainParserT_parser_tmp_0 - bit<32> MainParserT_parser_tmp_1 + bit<8> MainParserT_parser_tmp_1 bit<8> MainControlT_tmp bit<8> MainControlT_tmp_1 bit<8> MainControlT_tmp_2 @@ -34,7 +34,7 @@ struct user_metadata_t { bit<48> MainControlT_tmp_6 bit<48> MainControlT_tmp_8 bit<8> MainControlT_tmp_9 - bit<32> MainControlT_tmp_10 + bit<8> MainControlT_tmp_10 bit<8> tmpMask } metadata instanceof user_metadata_t diff --git a/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-first.p4 b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-first.p4 new file mode 100644 index 00000000000..6ff0a0ff933 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-first.p4 @@ -0,0 +1,79 @@ +#include +#include + +typedef bit<48> EthernetAddress; +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header custom_t { + bit<1> padding; + bit<1> f1; + bit<2> f2; + bit<4> f4; + bit<8> f8; + bit<16> f16; + bit<32> f32; + bit<64> f64; + bit<128> f128; +} + +struct main_metadata_t { +} + +struct headers_t { + ethernet_t ethernet; + custom_t custom; +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x8ff: parse_custom; + default: accept; + } + } + state parse_custom { + pkt.extract(hdr.custom); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t user_meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + action a1(bit<73> x) { + hdr.custom.f128 = (bit<128>)x; + } + table t1 { + key = { + hdr.ethernet.dstAddr: exact @name("hdr.ethernet.dstAddr"); + } + actions = { + @tableonly a1(); + @defaultonly NoAction(); + } + size = 512; + const default_action = NoAction(); + } + apply { + if (hdr.custom.isValid()) { + t1.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.custom); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; diff --git a/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-frontend.p4 b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-frontend.p4 new file mode 100644 index 00000000000..e652fa8af3f --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-frontend.p4 @@ -0,0 +1,81 @@ +#include +#include + +typedef bit<48> EthernetAddress; +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header custom_t { + bit<1> padding; + bit<1> f1; + bit<2> f2; + bit<4> f4; + bit<8> f8; + bit<16> f16; + bit<32> f32; + bit<64> f64; + bit<128> f128; +} + +struct main_metadata_t { +} + +struct headers_t { + ethernet_t ethernet; + custom_t custom; +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x8ff: parse_custom; + default: accept; + } + } + state parse_custom { + pkt.extract(hdr.custom); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t user_meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + @noWarn("unused") @name(".NoAction") action NoAction_1() { + } + @name("MainControlImpl.a1") action a1(@name("x") bit<73> x) { + hdr.custom.f128 = (bit<128>)x; + } + @name("MainControlImpl.t1") table t1_0 { + key = { + hdr.ethernet.dstAddr: exact @name("hdr.ethernet.dstAddr"); + } + actions = { + @tableonly a1(); + @defaultonly NoAction_1(); + } + size = 512; + const default_action = NoAction_1(); + } + apply { + if (hdr.custom.isValid()) { + t1_0.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.custom); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; diff --git a/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-midend.p4 b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-midend.p4 new file mode 100644 index 00000000000..1315a8b3a51 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size-midend.p4 @@ -0,0 +1,89 @@ +#include +#include + +header ethernet_t { + bit<48> dstAddr; + bit<48> srcAddr; + bit<16> etherType; +} + +header custom_t { + bit<1> padding; + bit<1> f1; + bit<2> f2; + bit<4> f4; + bit<8> f8; + bit<16> f16; + bit<32> f32; + bit<64> f64; + bit<128> f128; +} + +struct main_metadata_t { +} + +struct headers_t { + ethernet_t ethernet; + custom_t custom; +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x8ff: parse_custom; + default: accept; + } + } + state parse_custom { + pkt.extract(hdr.custom); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t user_meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + @noWarn("unused") @name(".NoAction") action NoAction_1() { + } + @name("MainControlImpl.a1") action a1(@name("x") bit<73> x) { + hdr.custom.f128 = (bit<128>)x; + } + @name("MainControlImpl.t1") table t1_0 { + key = { + hdr.ethernet.dstAddr: exact @name("hdr.ethernet.dstAddr"); + } + actions = { + @tableonly a1(); + @defaultonly NoAction_1(); + } + size = 512; + const default_action = NoAction_1(); + } + apply { + if (hdr.custom.isValid()) { + t1_0.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + @hidden action pnadpdk_128bit_odd_size112() { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.custom); + } + @hidden table tbl_pnadpdk_128bit_odd_size112 { + actions = { + pnadpdk_128bit_odd_size112(); + } + const default_action = pnadpdk_128bit_odd_size112(); + } + apply { + tbl_pnadpdk_128bit_odd_size112.apply(); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; diff --git a/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4 b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4 new file mode 100644 index 00000000000..788fc88bcc1 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4 @@ -0,0 +1,79 @@ +#include +#include + +typedef bit<48> EthernetAddress; +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header custom_t { + bit<1> padding; + bit<1> f1; + bit<2> f2; + bit<4> f4; + bit<8> f8; + bit<16> f16; + bit<32> f32; + bit<64> f64; + bit<128> f128; +} + +struct main_metadata_t { +} + +struct headers_t { + ethernet_t ethernet; + custom_t custom; +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 0x8ff: parse_custom; + default: accept; + } + } + state parse_custom { + pkt.extract(hdr.custom); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t user_meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + action a1(bit<73> x) { + hdr.custom.f128 = (bit<128>)x; + } + table t1 { + key = { + hdr.ethernet.dstAddr: exact; + } + actions = { + @tableonly a1; + @defaultonly NoAction; + } + size = 512; + const default_action = NoAction(); + } + apply { + if (hdr.custom.isValid()) { + t1.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.custom); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; diff --git a/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4-error b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4-error new file mode 100644 index 00000000000..e69de29bb2d diff --git a/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4-stderr b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4-stderr new file mode 100644 index 00000000000..e69de29bb2d diff --git a/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4.bfrt.json b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4.bfrt.json new file mode 100644 index 00000000000..27dc64102ed --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4.bfrt.json @@ -0,0 +1,69 @@ +{ + "schema_version" : "1.0.0", + "tables" : [ + { + "name" : "pipe.MainControlImpl.t1", + "id" : 35439756, + "table_type" : "MatchAction_Direct", + "size" : 512, + "annotations" : [], + "depends_on" : [], + "has_const_default_action" : true, + "key" : [ + { + "id" : 1, + "name" : "hdr.ethernet.dstAddr", + "repeated" : false, + "annotations" : [], + "mandatory" : false, + "match_type" : "Exact", + "type" : { + "type" : "bytes", + "width" : 48 + } + } + ], + "action_specs" : [ + { + "id" : 21288828, + "name" : "MainControlImpl.a1", + "action_scope" : "TableOnly", + "annotations" : [ + { + "name" : "@tableonly" + } + ], + "data" : [ + { + "id" : 1, + "name" : "x", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 73 + } + } + ] + }, + { + "id" : 21257015, + "name" : "NoAction", + "action_scope" : "DefaultOnly", + "annotations" : [ + { + "name" : "@defaultonly" + } + ], + "data" : [] + } + ], + "data" : [], + "supported_operations" : [], + "attributes" : ["EntryScope"] + } + ], + "learn_filters" : [] +} \ No newline at end of file diff --git a/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4.spec b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4.spec new file mode 100644 index 00000000000..6c416826998 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-dpdk_128bit_odd_size.p4.spec @@ -0,0 +1,66 @@ + +struct ethernet_t { + bit<48> dstAddr + bit<48> srcAddr + bit<16> etherType +} + +struct custom_t { + bit<8> padding_f1_f2_f4 + bit<8> f8 + bit<16> f16 + bit<32> f32 + bit<64> f64 + bit<128> f128 +} + +struct a1_arg_t { + bit<80> x +} + +struct main_metadata_t { + bit<32> pna_main_input_metadata_input_port + bit<32> pna_main_output_metadata_output_port +} +metadata instanceof main_metadata_t + +header ethernet instanceof ethernet_t +header custom instanceof custom_t + +regarray direction size 0x100 initval 0 +action NoAction args none { + return +} + +action a1 args instanceof a1_arg_t { + mov h.custom.f128 t.x + return +} + +table t1 { + key { + h.ethernet.dstAddr exact + } + actions { + a1 @tableonly + NoAction @defaultonly + } + default_action NoAction args none const + size 0x200 +} + + +apply { + rx m.pna_main_input_metadata_input_port + extract h.ethernet + jmpeq MAINPARSERIMPL_PARSE_CUSTOM h.ethernet.etherType 0x8FF + jmp MAINPARSERIMPL_ACCEPT + MAINPARSERIMPL_PARSE_CUSTOM : extract h.custom + MAINPARSERIMPL_ACCEPT : jmpnv LABEL_END h.custom + table t1 + LABEL_END : emit h.ethernet + emit h.custom + tx m.pna_main_output_metadata_output_port +} + + diff --git a/testdata/p4_16_samples_outputs/pna-example-ipsec.p4.spec b/testdata/p4_16_samples_outputs/pna-example-ipsec.p4.spec index 73b171492a0..12c0ac42efb 100644 --- a/testdata/p4_16_samples_outputs/pna-example-ipsec.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-ipsec.p4.spec @@ -62,7 +62,7 @@ struct metadata_t { bit<32> MainControlImpl_inbound_table_esp_spi bit<8> MainParserT_parser_from_ipsec bit<32> MainParserT_parser_status - bit<32> MainParserT_parser_tmp_0 + bit<8> MainParserT_parser_tmp_0 bit<32> MainControlT_status bit<32> MainControlT_status_0 bit<8> MainControlT_tmp diff --git a/testdata/p4_16_samples_outputs/pna-example-pass-1.p4.spec b/testdata/p4_16_samples_outputs/pna-example-pass-1.p4.spec index c2e7552874b..d4ed439eb7a 100644 --- a/testdata/p4_16_samples_outputs/pna-example-pass-1.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-pass-1.p4.spec @@ -26,7 +26,7 @@ struct udp_t { } struct main_metadata_t { - bit<32> pna_main_input_metadata_pass + bit<8> pna_main_input_metadata_pass bit<32> pna_main_input_metadata_input_port bit<32> pna_main_output_metadata_output_port } diff --git a/testdata/p4_16_samples_outputs/pna-example-pass-2.p4.spec b/testdata/p4_16_samples_outputs/pna-example-pass-2.p4.spec index 2958c87e507..5ede5a33d09 100644 --- a/testdata/p4_16_samples_outputs/pna-example-pass-2.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-pass-2.p4.spec @@ -24,7 +24,7 @@ struct next_hop_arg_t { struct main_metadata_t { bit<32> pna_main_input_metadata_direction - bit<32> pna_main_input_metadata_pass + bit<8> pna_main_input_metadata_pass bit<32> pna_main_input_metadata_input_port bit<32> pna_main_output_metadata_output_port bit<32> MainControlT_tmp diff --git a/testdata/p4_16_samples_outputs/pna-example-pass-3.p4.spec b/testdata/p4_16_samples_outputs/pna-example-pass-3.p4.spec index cdbac78ca8e..1a33b8d07e4 100644 --- a/testdata/p4_16_samples_outputs/pna-example-pass-3.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-pass-3.p4.spec @@ -26,8 +26,8 @@ struct udp_t { } struct main_metadata_t { - bit<32> pna_pre_input_metadata_pass - bit<32> pna_main_input_metadata_pass + bit<8> pna_pre_input_metadata_pass + bit<8> pna_main_input_metadata_pass bit<32> pna_main_input_metadata_input_port bit<16> local_metadata_port bit<32> pna_main_output_metadata_output_port diff --git a/testdata/p4_16_samples_outputs/pna-example-pass-parser.p4.spec b/testdata/p4_16_samples_outputs/pna-example-pass-parser.p4.spec index 5828e4958e3..45e8c6922ec 100644 --- a/testdata/p4_16_samples_outputs/pna-example-pass-parser.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-pass-parser.p4.spec @@ -27,13 +27,13 @@ struct udp_t { struct main_metadata_t { bit<16> pna_pre_input_metadata_parser_error - bit<32> pna_main_parser_input_metadata_pass - bit<32> pna_main_input_metadata_pass + bit<8> pna_main_parser_input_metadata_pass + bit<8> pna_main_input_metadata_pass bit<32> pna_main_input_metadata_input_port bit<16> local_metadata_port bit<32> pna_main_output_metadata_output_port - bit<32> MainParserT_parser_tmp - bit<32> MainParserT_parser_tmp_0 + bit<8> MainParserT_parser_tmp + bit<8> MainParserT_parser_tmp_0 } metadata instanceof main_metadata_t diff --git a/testdata/p4_16_samples_outputs/pna-example-pass.p4.spec b/testdata/p4_16_samples_outputs/pna-example-pass.p4.spec index d88afc0e370..6d7d3be7b3d 100644 --- a/testdata/p4_16_samples_outputs/pna-example-pass.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-pass.p4.spec @@ -26,7 +26,7 @@ struct udp_t { } struct main_metadata_t { - bit<32> pna_main_input_metadata_pass + bit<8> pna_main_input_metadata_pass bit<32> pna_main_input_metadata_input_port bit<32> pna_main_output_metadata_output_port } diff --git a/testdata/p4_16_samples_outputs/pna-example-recirculate.p4.spec b/testdata/p4_16_samples_outputs/pna-example-recirculate.p4.spec index 679bb640da3..66e5370333e 100644 --- a/testdata/p4_16_samples_outputs/pna-example-recirculate.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-recirculate.p4.spec @@ -26,7 +26,7 @@ struct udp_t { } struct main_metadata_t { - bit<32> pna_main_input_metadata_pass + bit<8> pna_main_input_metadata_pass bit<32> pna_main_input_metadata_input_port bit<32> pna_main_output_metadata_output_port } diff --git a/testdata/p4_16_samples_outputs/pna-example-tunnel.p4.spec b/testdata/p4_16_samples_outputs/pna-example-tunnel.p4.spec index 5692de2709e..0a43114fc7e 100644 --- a/testdata/p4_16_samples_outputs/pna-example-tunnel.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-tunnel.p4.spec @@ -37,14 +37,14 @@ struct local_metadata_t { bit<32> pna_main_input_metadata_input_port bit<32> local_metadata__outer_ipv4_dst0 bit<24> local_metadata__tunnel_id1 - bit<32> local_metadata__tunnel_tun_type3 + bit<8> local_metadata__tunnel_tun_type3 bit<32> pna_main_output_metadata_output_port ;oldname:main_control_tunnel_decap_ipv4_tunnel_term_table_outer_ipv4_src_addr bit<32> main_control_tunnel_decap_ipv4_tunnel_term_table_outer_ipv41 ;oldname:main_control_tunnel_decap_ipv4_tunnel_term_table_outer_ipv4_dst_addr bit<32> main_control_tunnel_decap_ipv4_tunnel_term_table_outer_ipv42 ;oldname:main_control_tunnel_decap_ipv4_tunnel_term_table_local_metadata__tunnel_tun_type3 - bit<32> main_control_tunnel_decap_ipv4_tunnel_term_table_local_meta3 + bit<8> main_control_tunnel_decap_ipv4_tunnel_term_table_local_meta3 } metadata instanceof local_metadata_t diff --git a/testdata/p4_16_samples_outputs/pna-example-varIndex-1.p4.spec b/testdata/p4_16_samples_outputs/pna-example-varIndex-1.p4.spec index 8b912f99c21..94dd58aecf1 100644 --- a/testdata/p4_16_samples_outputs/pna-example-varIndex-1.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-varIndex-1.p4.spec @@ -18,14 +18,14 @@ header vlan_tag_1 instanceof vlan_tag_h struct main_metadata_t { bit<16> pna_pre_input_metadata_parser_error bit<32> pna_main_input_metadata_input_port - bit<32> local_metadata_depth + bit<8> local_metadata_depth bit<32> pna_main_output_metadata_output_port - bit<32> MainControlT_tmp - bit<32> MainControlT_tmp_0 - bit<32> MainControlT_tmp_1 - bit<32> MainControlT_tmp_2 - bit<32> MainControlT_tmp_3 - bit<32> MainControlT_tmp_4 + bit<8> MainControlT_tmp + bit<8> MainControlT_tmp_0 + bit<8> MainControlT_tmp_1 + bit<8> MainControlT_tmp_2 + bit<8> MainControlT_tmp_3 + bit<8> MainControlT_tmp_4 bit<16> MainControlT_tmp_5 bit<16> MainControlT_tmp_6 bit<16> MainControlT_tmp_7 @@ -42,8 +42,8 @@ struct main_metadata_t { bit<16> MainControlT_tmp_24 bit<16> MainControlT_tmp_25 bit<16> MainControlT_tmp_26 - bit<32> MainControlT_hsVar - bit<32> MainControlT_key + bit<16> MainControlT_hsVar + bit<16> MainControlT_key } metadata instanceof main_metadata_t diff --git a/testdata/p4_16_samples_outputs/pna-example-varIndex-2.p4.spec b/testdata/p4_16_samples_outputs/pna-example-varIndex-2.p4.spec index 13ed13cde3e..23806518528 100644 --- a/testdata/p4_16_samples_outputs/pna-example-varIndex-2.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-varIndex-2.p4.spec @@ -18,14 +18,14 @@ header vlan_tag_1 instanceof vlan_tag_h struct main_metadata_t { bit<16> pna_pre_input_metadata_parser_error bit<32> pna_main_input_metadata_input_port - bit<32> local_metadata_depth + bit<8> local_metadata_depth bit<32> pna_main_output_metadata_output_port bit<16> MainControlT_tmp bit<16> MainControlT_tmp_0 - bit<32> MainControlT_tmp_1 + bit<16> MainControlT_tmp_1 bit<16> MainControlT_tmp_2 bit<16> MainControlT_tmp_3 - bit<32> MainControlT_tmp_4 + bit<16> MainControlT_tmp_4 bit<16> MainControlT_tmp_5 bit<16> MainControlT_tmp_6 bit<16> MainControlT_tmp_7 @@ -38,7 +38,7 @@ struct main_metadata_t { bit<16> MainControlT_tmp_18 bit<16> MainControlT_tmp_19 bit<16> MainControlT_tmp_20 - bit<32> MainControlT_key + bit<16> MainControlT_key } metadata instanceof main_metadata_t diff --git a/testdata/p4_16_samples_outputs/pna-example-varIndex.p4.spec b/testdata/p4_16_samples_outputs/pna-example-varIndex.p4.spec index c68f350821e..7b593fa6aac 100644 --- a/testdata/p4_16_samples_outputs/pna-example-varIndex.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-varIndex.p4.spec @@ -18,14 +18,14 @@ header vlan_tag_1 instanceof vlan_tag_h struct main_metadata_t { bit<16> pna_pre_input_metadata_parser_error bit<32> pna_main_input_metadata_input_port - bit<32> local_metadata_depth + bit<8> local_metadata_depth bit<16> local_metadata_ethType bit<32> pna_main_output_metadata_output_port - bit<32> MainControlT_tmp - bit<32> MainControlT_tmp_0 - bit<32> MainControlT_tmp_1 - bit<32> MainControlT_tmp_2 - bit<32> MainControlT_tmp_3 + bit<8> MainControlT_tmp + bit<8> MainControlT_tmp_0 + bit<8> MainControlT_tmp_1 + bit<8> MainControlT_tmp_2 + bit<8> MainControlT_tmp_3 bit<16> MainControlT_tmp_4 bit<16> MainControlT_tmp_5 bit<16> MainControlT_tmp_6 @@ -49,7 +49,7 @@ struct main_metadata_t { bit<16> MainControlT_tmp_34 bit<16> MainControlT_tmp_35 bit<16> MainControlT_hsVar - bit<32> MainControlT_key + bit<16> MainControlT_key } metadata instanceof main_metadata_t diff --git a/testdata/p4_16_samples_outputs/pna-ipv6-actions-first.p4 b/testdata/p4_16_samples_outputs/pna-ipv6-actions-first.p4 index 5759e7b8d10..7aaecc0cf98 100644 --- a/testdata/p4_16_samples_outputs/pna-ipv6-actions-first.p4 +++ b/testdata/p4_16_samples_outputs/pna-ipv6-actions-first.p4 @@ -97,9 +97,25 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in action ipv6_addr_and() { headers.ipv6.dstAddr = tmp & headers.ipv6.srcAddr; } + action ipv6_addr_and2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr & 128w0x123456789abcdef12345678; + } + action ipv6_addr_or2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr | 128w0x123456789abcdef; + } action ipv6_addr_xor() { headers.ipv6.dstAddr = headers.ipv6.dstAddr ^ tmp; } + action ipv6_addr_xor2(bit<128> arg) { + headers.ipv6.dstAddr = arg; + } + action ipv6_modify_dstAddr2(bit<32> dstAddr) { + headers.ipv6.dstAddr = (bit<128>)dstAddr; + } + action ipv6_swap_addr2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr; + headers.ipv6.srcAddr = 128w0x123456789abcdef0aabbccddeeff0011; + } action ipv6_addr_comp1() { headers.ipv6.dstAddr = (headers.ipv6.dstAddr == headers.ipv6.srcAddr ? headers.ipv6.dstAddr : headers.ipv6.srcAddr); } @@ -142,8 +158,13 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in ipv6_swap_addr(); set_flowlabel(); ipv6_addr_or(); + ipv6_addr_or2(); ipv6_addr_xor(); + ipv6_addr_xor2(); ipv6_addr_and(); + ipv6_addr_and2(); + ipv6_modify_dstAddr2(); + ipv6_swap_addr2(); ipv6_addr_comp1(); ipv6_addr_comp2(); ipv6_addr_cmpl(); diff --git a/testdata/p4_16_samples_outputs/pna-ipv6-actions-frontend.p4 b/testdata/p4_16_samples_outputs/pna-ipv6-actions-frontend.p4 index 98e4273b622..ac0b0030855 100644 --- a/testdata/p4_16_samples_outputs/pna-ipv6-actions-frontend.p4 +++ b/testdata/p4_16_samples_outputs/pna-ipv6-actions-frontend.p4 @@ -91,8 +91,8 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in @name("MainControlImpl.Reject") action Reject() { drop_packet(); } - @name("MainControlImpl.ipv6_modify_dstAddr") action ipv6_modify_dstAddr(@name("dstAddr") bit<32> dstAddr_1) { - headers.ipv6.dstAddr = (bit<128>)dstAddr_1; + @name("MainControlImpl.ipv6_modify_dstAddr") action ipv6_modify_dstAddr(@name("dstAddr") bit<32> dstAddr_2) { + headers.ipv6.dstAddr = (bit<128>)dstAddr_2; } @name("MainControlImpl.ipv6_addr_or") action ipv6_addr_or() { headers.ipv6.dstAddr = headers.ipv6.dstAddr | headers.ipv6.srcAddr; @@ -100,9 +100,25 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in @name("MainControlImpl.ipv6_addr_and") action ipv6_addr_and() { headers.ipv6.dstAddr = tmp & headers.ipv6.srcAddr; } + @name("MainControlImpl.ipv6_addr_and2") action ipv6_addr_and2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr & 128w0x123456789abcdef12345678; + } + @name("MainControlImpl.ipv6_addr_or2") action ipv6_addr_or2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr | 128w0x123456789abcdef; + } @name("MainControlImpl.ipv6_addr_xor") action ipv6_addr_xor() { headers.ipv6.dstAddr = headers.ipv6.dstAddr ^ tmp; } + @name("MainControlImpl.ipv6_addr_xor2") action ipv6_addr_xor2(@name("arg") bit<128> arg) { + headers.ipv6.dstAddr = arg; + } + @name("MainControlImpl.ipv6_modify_dstAddr2") action ipv6_modify_dstAddr2(@name("dstAddr") bit<32> dstAddr_3) { + headers.ipv6.dstAddr = (bit<128>)dstAddr_3; + } + @name("MainControlImpl.ipv6_swap_addr2") action ipv6_swap_addr2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr; + headers.ipv6.srcAddr = 128w0x123456789abcdef0aabbccddeeff0011; + } @name("MainControlImpl.ipv6_addr_comp1") action ipv6_addr_comp1() { if (headers.ipv6.dstAddr == headers.ipv6.srcAddr) { tmp_0 = headers.ipv6.dstAddr; @@ -152,8 +168,13 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in ipv6_swap_addr(); set_flowlabel(); ipv6_addr_or(); + ipv6_addr_or2(); ipv6_addr_xor(); + ipv6_addr_xor2(); ipv6_addr_and(); + ipv6_addr_and2(); + ipv6_modify_dstAddr2(); + ipv6_swap_addr2(); ipv6_addr_comp1(); ipv6_addr_comp2(); ipv6_addr_cmpl(); diff --git a/testdata/p4_16_samples_outputs/pna-ipv6-actions-midend.p4 b/testdata/p4_16_samples_outputs/pna-ipv6-actions-midend.p4 index f70a8b1c203..cb676115545 100644 --- a/testdata/p4_16_samples_outputs/pna-ipv6-actions-midend.p4 +++ b/testdata/p4_16_samples_outputs/pna-ipv6-actions-midend.p4 @@ -89,8 +89,8 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in @name("MainControlImpl.Reject") action Reject() { drop_packet(); } - @name("MainControlImpl.ipv6_modify_dstAddr") action ipv6_modify_dstAddr(@name("dstAddr") bit<32> dstAddr_1) { - headers.ipv6.dstAddr = (bit<128>)dstAddr_1; + @name("MainControlImpl.ipv6_modify_dstAddr") action ipv6_modify_dstAddr(@name("dstAddr") bit<32> dstAddr_2) { + headers.ipv6.dstAddr = (bit<128>)dstAddr_2; } @name("MainControlImpl.ipv6_addr_or") action ipv6_addr_or() { headers.ipv6.dstAddr = headers.ipv6.dstAddr | headers.ipv6.srcAddr; @@ -98,9 +98,25 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in @name("MainControlImpl.ipv6_addr_and") action ipv6_addr_and() { headers.ipv6.dstAddr = tmp & headers.ipv6.srcAddr; } + @name("MainControlImpl.ipv6_addr_and2") action ipv6_addr_and2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr & 128w0x123456789abcdef12345678; + } + @name("MainControlImpl.ipv6_addr_or2") action ipv6_addr_or2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr | 128w0x123456789abcdef; + } @name("MainControlImpl.ipv6_addr_xor") action ipv6_addr_xor() { headers.ipv6.dstAddr = headers.ipv6.dstAddr ^ tmp; } + @name("MainControlImpl.ipv6_addr_xor2") action ipv6_addr_xor2(@name("arg") bit<128> arg) { + headers.ipv6.dstAddr = arg; + } + @name("MainControlImpl.ipv6_modify_dstAddr2") action ipv6_modify_dstAddr2(@name("dstAddr") bit<32> dstAddr_3) { + headers.ipv6.dstAddr = (bit<128>)dstAddr_3; + } + @name("MainControlImpl.ipv6_swap_addr2") action ipv6_swap_addr2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr; + headers.ipv6.srcAddr = 128w0x123456789abcdef0aabbccddeeff0011; + } @name("MainControlImpl.ipv6_addr_comp1") action ipv6_addr_comp1() { if (headers.ipv6.dstAddr == headers.ipv6.srcAddr) { tmp_0 = headers.ipv6.dstAddr; @@ -150,8 +166,13 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in ipv6_swap_addr(); set_flowlabel(); ipv6_addr_or(); + ipv6_addr_or2(); ipv6_addr_xor(); + ipv6_addr_xor2(); ipv6_addr_and(); + ipv6_addr_and2(); + ipv6_modify_dstAddr2(); + ipv6_swap_addr2(); ipv6_addr_comp1(); ipv6_addr_comp2(); ipv6_addr_cmpl(); @@ -180,20 +201,20 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in } control MainDeparserImpl(packet_out packet, in headers_t headers, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { - @hidden action pnaipv6actions210() { + @hidden action pnaipv6actions233() { packet.emit(headers.ethernet); packet.emit(headers.mpls); packet.emit(headers.ipv6); packet.emit(headers.ipv4); } - @hidden table tbl_pnaipv6actions210 { + @hidden table tbl_pnaipv6actions233 { actions = { - pnaipv6actions210(); + pnaipv6actions233(); } - const default_action = pnaipv6actions210(); + const default_action = pnaipv6actions233(); } apply { - tbl_pnaipv6actions210.apply(); + tbl_pnaipv6actions233.apply(); } } diff --git a/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4 b/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4 index 6223a734943..40bd434f828 100644 --- a/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4 +++ b/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4 @@ -97,9 +97,25 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in action ipv6_addr_and() { headers.ipv6.dstAddr = tmp & headers.ipv6.srcAddr; } + action ipv6_addr_and2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr & 128w0x123456789abcdef12345678; + } + action ipv6_addr_or2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr | 128w0x123456789abcdef; + } action ipv6_addr_xor() { headers.ipv6.dstAddr = headers.ipv6.dstAddr ^ tmp; } + action ipv6_addr_xor2(bit<128> arg) { + headers.ipv6.dstAddr = arg; + } + action ipv6_modify_dstAddr2(bit<32> dstAddr) { + headers.ipv6.dstAddr = (bit<128>)dstAddr; + } + action ipv6_swap_addr2() { + headers.ipv6.dstAddr = headers.ipv6.srcAddr; + headers.ipv6.srcAddr = 128w0x123456789abcdef0aabbccddeeff0011; + } action ipv6_addr_comp1() { headers.ipv6.dstAddr = (headers.ipv6.dstAddr == headers.ipv6.srcAddr ? headers.ipv6.dstAddr : headers.ipv6.srcAddr); } @@ -142,8 +158,13 @@ control MainControlImpl(inout headers_t headers, inout main_metadata_t meta, in ipv6_swap_addr; set_flowlabel; ipv6_addr_or; + ipv6_addr_or2; ipv6_addr_xor; + ipv6_addr_xor2; ipv6_addr_and; + ipv6_addr_and2; + ipv6_modify_dstAddr2; + ipv6_swap_addr2; ipv6_addr_comp1; ipv6_addr_comp2; ipv6_addr_cmpl; diff --git a/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4-error b/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4-error index abe0c3c1fe8..3aa4c5505cd 100644 --- a/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4-error +++ b/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4-error @@ -1,3 +1,3 @@ -pna-ipv6-actions.p4(160): [--Wwarn=uninitialized_use] warning: tmp1 may be uninitialized +pna-ipv6-actions.p4(178): [--Wwarn=uninitialized_use] warning: tmp1 may be uninitialized headers.ipv6.srcAddr = (bit<128>)tmp1; ^^^^ diff --git a/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4-stderr b/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4-stderr index abe0c3c1fe8..3aa4c5505cd 100644 --- a/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4-stderr +++ b/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4-stderr @@ -1,3 +1,3 @@ -pna-ipv6-actions.p4(160): [--Wwarn=uninitialized_use] warning: tmp1 may be uninitialized +pna-ipv6-actions.p4(178): [--Wwarn=uninitialized_use] warning: tmp1 may be uninitialized headers.ipv6.srcAddr = (bit<128>)tmp1; ^^^^ diff --git a/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4.bfrt.json b/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4.bfrt.json index 17da9ba7eb8..7b384fa9b72 100644 --- a/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4.bfrt.json +++ b/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4.bfrt.json @@ -78,6 +78,13 @@ "annotations" : [], "data" : [] }, + { + "id" : 19435700, + "name" : "MainControlImpl.ipv6_addr_or2", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + }, { "id" : 26319412, "name" : "MainControlImpl.ipv6_addr_xor", @@ -85,6 +92,26 @@ "annotations" : [], "data" : [] }, + { + "id" : 32253890, + "name" : "MainControlImpl.ipv6_addr_xor2", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "arg", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 128 + } + } + ] + }, { "id" : 22390528, "name" : "MainControlImpl.ipv6_addr_and", @@ -92,6 +119,40 @@ "annotations" : [], "data" : [] }, + { + "id" : 19138111, + "name" : "MainControlImpl.ipv6_addr_and2", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + }, + { + "id" : 26143176, + "name" : "MainControlImpl.ipv6_modify_dstAddr2", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "dstAddr", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 32 + } + } + ] + }, + { + "id" : 25482724, + "name" : "MainControlImpl.ipv6_swap_addr2", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + }, { "id" : 17555934, "name" : "MainControlImpl.ipv6_addr_comp1", diff --git a/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4.spec b/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4.spec index d89025734ed..85920feadae 100644 --- a/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-ipv6-actions.p4.spec @@ -35,11 +35,12 @@ struct IPv6_h { struct dpdk_pseudo_header_t { bit<32> pseudo bit<32> pseudo_0 - bit<64> pseudo_1 + bit<32> pseudo_1 + bit<64> pseudo_2 } struct _p4c_tmp128_t { - bit<64> tmp + bit<64> inter } struct _p4c_sandbox_header_t { @@ -47,12 +48,20 @@ struct _p4c_sandbox_header_t { bit<64> lower_half } +struct ipv6_addr_xor2_arg_t { + bit<128> arg +} + +struct ipv6_modify_dstAddr2_arg_t { + bit<32> dstAddr +} + struct ipv6_modify_dstAddr_arg_t { bit<32> dstAddr } struct set_flowlabel_arg_t { - bit<32> label + bit<24> label } struct set_hop_limit_arg_t { @@ -60,7 +69,7 @@ struct set_hop_limit_arg_t { } struct set_ipv6_version_arg_t { - bit<32> version + bit<8> version } struct set_next_hdr_arg_t { @@ -69,7 +78,7 @@ struct set_next_hdr_arg_t { struct set_traffic_class_flow_label_arg_t { bit<8> trafficClass - bit<32> label + bit<24> label } header ethernet instanceof Ethernet_h @@ -98,11 +107,11 @@ struct main_metadata_t { } metadata instanceof main_metadata_t -header dstAddr_128 instanceof header _p4c_sandbox_header_t -header dstAddr_tmp instanceof header _p4c_tmp128_t -header srcAddr_128 instanceof header _p4c_sandbox_header_t -header MainControlT_tmp_13_128 instanceof header _p4c_sandbox_header_t -header srcAddr_tmp instanceof header _p4c_tmp128_t +header dstAddr_128 instanceof _p4c_sandbox_header_t +header dstAddr_tmp instanceof _p4c_tmp128_t +header srcAddr_128 instanceof _p4c_sandbox_header_t +header MainControlT_tmp_13_128 instanceof _p4c_sandbox_header_t +header srcAddr_tmp instanceof _p4c_tmp128_t regarray direction size 0x100 initval 0 action NoAction args none { return @@ -148,6 +157,32 @@ action ipv6_addr_and args none { return } +action ipv6_addr_and2 args none { + mov h.ipv6.dstAddr h.ipv6.srcAddr + movh h.dstAddr_128.upper_half h.ipv6.dstAddr + mov h.dstAddr_128.lower_half h.ipv6.dstAddr + mov h.dstAddr_tmp.inter h.dstAddr_128.lower_half + and h.dstAddr_tmp.inter 0x89ABCDEF12345678 + mov h.ipv6.dstAddr h.dstAddr_tmp.inter + mov h.dstAddr_tmp.inter h.dstAddr_128.upper_half + and h.dstAddr_tmp.inter 0x1234567 + movh h.ipv6.dstAddr h.dstAddr_tmp.inter + return +} + +action ipv6_addr_or2 args none { + mov h.ipv6.dstAddr h.ipv6.srcAddr + movh h.dstAddr_128.upper_half h.ipv6.dstAddr + mov h.dstAddr_128.lower_half h.ipv6.dstAddr + mov h.dstAddr_tmp.inter h.dstAddr_128.lower_half + or h.dstAddr_tmp.inter 0x123456789ABCDEF + mov h.ipv6.dstAddr h.dstAddr_tmp.inter + mov h.dstAddr_tmp.inter h.dstAddr_128.upper_half + or h.dstAddr_tmp.inter 0x0 + movh h.ipv6.dstAddr h.dstAddr_tmp.inter + return +} + action ipv6_addr_xor args none { movh h.dstAddr_128.upper_half h.ipv6.dstAddr mov h.dstAddr_128.lower_half h.ipv6.dstAddr @@ -162,6 +197,26 @@ action ipv6_addr_xor args none { return } +action ipv6_addr_xor2 args instanceof ipv6_addr_xor2_arg_t { + mov h.ipv6.dstAddr t.arg + return +} + +action ipv6_modify_dstAddr2 args instanceof ipv6_modify_dstAddr2_arg_t { + mov h.dpdk_pseudo_header.pseudo_0 t.dstAddr + mov h.ipv6.dstAddr h.dpdk_pseudo_header.pseudo_0 + return +} + +action ipv6_swap_addr2 args none { + mov h.ipv6.dstAddr h.ipv6.srcAddr + mov h.srcAddr_128.upper_half 0x123456789ABCDEF0 + mov h.srcAddr_128.lower_half 0xAABBCCDDEEFF0011 + mov h.ipv6.srcAddr h.srcAddr_128.lower_half + movh h.ipv6.srcAddr h.srcAddr_128.upper_half + return +} + action ipv6_addr_comp1 args none { movh h.dstAddr_128.upper_half h.ipv6.dstAddr mov h.dstAddr_128.lower_half h.ipv6.dstAddr @@ -236,8 +291,8 @@ action set_traffic_class_flow_label args instanceof set_traffic_class_flow_label and m.MainControlT_tmp_8 0xFFFFF mov h.ipv6.version_trafficClass_flowLabel m.MainControlT_tmp_6 or h.ipv6.version_trafficClass_flowLabel m.MainControlT_tmp_8 - mov h.dpdk_pseudo_header.pseudo_0 m.MainControlT_tmp1 - mov h.ipv6.srcAddr h.dpdk_pseudo_header.pseudo_0 + mov h.dpdk_pseudo_header.pseudo_1 m.MainControlT_tmp1 + mov h.ipv6.srcAddr h.dpdk_pseudo_header.pseudo_1 return } @@ -272,8 +327,13 @@ table filter_tbl { ipv6_swap_addr set_flowlabel ipv6_addr_or + ipv6_addr_or2 ipv6_addr_xor + ipv6_addr_xor2 ipv6_addr_and + ipv6_addr_and2 + ipv6_modify_dstAddr2 + ipv6_swap_addr2 ipv6_addr_comp1 ipv6_addr_comp2 ipv6_addr_cmpl @@ -300,8 +360,8 @@ apply { MAINPARSERIMPL_IPV4 : extract h.ipv4 jmp MAINPARSERIMPL_ACCEPT MAINPARSERIMPL_IPV6 : extract h.ipv6 - MAINPARSERIMPL_ACCEPT : mov h.dpdk_pseudo_header.pseudo_1 0x76 - mov m.MainControlT_tmp_13 h.dpdk_pseudo_header.pseudo_1 + MAINPARSERIMPL_ACCEPT : mov h.dpdk_pseudo_header.pseudo_2 0x76 + mov m.MainControlT_tmp_13 h.dpdk_pseudo_header.pseudo_2 table filter_tbl emit h.ethernet emit h.mpls diff --git a/testdata/p4_16_samples_outputs/pna-mux-dismantle.p4.spec b/testdata/p4_16_samples_outputs/pna-mux-dismantle.p4.spec index acb49a44094..75794325ad2 100644 --- a/testdata/p4_16_samples_outputs/pna-mux-dismantle.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-mux-dismantle.p4.spec @@ -50,17 +50,17 @@ struct next_hop_arg_t { struct main_metadata_t { bit<32> pna_main_input_metadata_input_port - bit<32> local_metadata_rng_result1 - bit<32> local_metadata_val1 - bit<32> local_metadata_val2 + bit<8> local_metadata_rng_result1 + bit<8> local_metadata_val1 + bit<8> local_metadata_val2 bit<8> local_metadata_timeout bit<32> pna_main_output_metadata_output_port bit<32> MainControlT_tmp bit<32> MainControlT_tmp_0 - bit<32> MainControlT_tmp_1 - bit<32> MainControlT_tmp_2 - bit<32> MainControlT_tmp_3 - bit<32> MainControlT_tmp_4 + bit<8> MainControlT_tmp_1 + bit<8> MainControlT_tmp_2 + bit<8> MainControlT_tmp_3 + bit<8> MainControlT_tmp_4 bit<32> learnArg } metadata instanceof main_metadata_t diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-128bitCast.p4.spec b/testdata/p4_16_samples_outputs/psa-dpdk-128bitCast.p4.spec index e8b597e4eec..8dd55c28554 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-128bitCast.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-dpdk-128bitCast.p4.spec @@ -10,7 +10,7 @@ struct dpdk_pseudo_header_t { } struct _p4c_tmp128_t { - bit<64> tmp + bit<64> inter } struct _p4c_sandbox_header_t { @@ -53,12 +53,12 @@ struct user_meta_data_t { } metadata instanceof user_meta_data_t -header Ingress_tmp_128 instanceof header _p4c_sandbox_header_t -header Ingress_tmp_tmp instanceof header _p4c_tmp128_t -header Ingress_tmp_0_128 instanceof header _p4c_sandbox_header_t -header Ingress_tmp_0_tmp instanceof header _p4c_tmp128_t -header Ingress_tmp_1_128 instanceof header _p4c_sandbox_header_t -header Ingress_tmp_1_tmp instanceof header _p4c_tmp128_t +header Ingress_tmp_128 instanceof _p4c_sandbox_header_t +header Ingress_tmp_tmp instanceof _p4c_tmp128_t +header Ingress_tmp_0_128 instanceof _p4c_sandbox_header_t +header Ingress_tmp_0_tmp instanceof _p4c_tmp128_t +header Ingress_tmp_1_128 instanceof _p4c_sandbox_header_t +header Ingress_tmp_1_tmp instanceof _p4c_tmp128_t action NoAction args none { return } @@ -71,7 +71,7 @@ action macswp args none { and h.Ingress_tmp_tmp.inter 0xFFFFFFFFFFFFFFFF mov m.Ingress_tmp h.Ingress_tmp_tmp.inter mov h.Ingress_tmp_tmp.inter h.Ingress_tmp_128.upper_half - and h.Ingress_tmp_tmp.inter 0xFFFFFFFFFFFFFFFF + and h.Ingress_tmp_tmp.inter 0x0 movh m.Ingress_tmp h.Ingress_tmp_tmp.inter mov m.Ingress_tmp_0 m.Ingress_tmp movh h.Ingress_tmp_0_128.upper_half m.Ingress_tmp_0 @@ -80,7 +80,7 @@ action macswp args none { and h.Ingress_tmp_0_tmp.inter 0xFFFFFFFFFFFFFFFF mov m.Ingress_tmp_0 h.Ingress_tmp_0_tmp.inter mov h.Ingress_tmp_0_tmp.inter h.Ingress_tmp_0_128.upper_half - and h.Ingress_tmp_0_tmp.inter 0xFFFFFFFFFFFFFFFF + and h.Ingress_tmp_0_tmp.inter 0x0 movh m.Ingress_tmp_0 h.Ingress_tmp_0_tmp.inter mov m.Ingress_tmp_1 m.Ingress_tmp_0 movh h.Ingress_tmp_1_128.upper_half m.Ingress_tmp_1 @@ -89,7 +89,7 @@ action macswp args none { and h.Ingress_tmp_1_tmp.inter 0xFFFFFFFFFFFFFFFF mov m.Ingress_tmp_1 h.Ingress_tmp_1_tmp.inter mov h.Ingress_tmp_1_tmp.inter h.Ingress_tmp_1_128.upper_half - and h.Ingress_tmp_1_tmp.inter 0xFFFFFFFFFFFFFFFF + and h.Ingress_tmp_1_tmp.inter 0x0 movh m.Ingress_tmp_1 h.Ingress_tmp_1_tmp.inter mov h.dpdk_pseudo_header.pseudo m.Ingress_tmp_1 jmpneq LABEL_END h.dpdk_pseudo_header.pseudo 0x2 diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-checksum-arg-header.p4.spec b/testdata/p4_16_samples_outputs/psa-dpdk-checksum-arg-header.p4.spec index dcdb4ddfb99..ded999c607a 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-checksum-arg-header.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-dpdk-checksum-arg-header.p4.spec @@ -113,7 +113,7 @@ struct local_metadata_t { bit<8> Ingress_tmp_1 bit<16> Ingress_tmp_2 bit<16> Ingress_tmp_3 - bit<32> Ingress_tmp_4 + bit<8> Ingress_tmp_4 bit<32> Ingress_tmp_5 bit<32> Ingress_tmp_6 } diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.spec b/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.spec index d4fe1b1ebc4..40608ca8961 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.spec @@ -28,7 +28,7 @@ struct psa_egress_deparser_input_metadata_t { } struct a_with_control_params_arg_t { - bit<32> x + bit<16> x } header h instanceof hdr diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1.p4.spec index b84ab6fee07..48997b5036d 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1.p4.spec @@ -44,7 +44,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { @@ -59,7 +59,7 @@ struct metadata_t { bit<8> IngressParser_parser_tmp_3 bit<8> IngressParser_parser_tmp_4 bit<8> IngressParser_parser_tmp_5 - bit<32> IngressParser_parser_tmp_6 + bit<8> IngressParser_parser_tmp_6 bit<16> Ingress_tmp bit<16> Ingress_tmp_0 bit<8> Ingress_tmp_2 @@ -75,7 +75,7 @@ struct metadata_t { bit<8> Ingress_tmp_14 bit<8> Ingress_tmp_15 bit<8> Ingress_tmp_16 - bit<32> Ingress_tmp_18 + bit<8> Ingress_tmp_18 bit<16> Ingress_tmp_20 bit<32> Ingress_color_out bit<32> Ingress_color_in diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2.p4.spec index 0e9f42221f4..28dc76dd9e4 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2.p4.spec @@ -44,7 +44,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { @@ -55,7 +55,7 @@ struct metadata_t { bit<8> IngressParser_parser_tmp bit<8> IngressParser_parser_tmp_0 bit<8> IngressParser_parser_tmp_1 - bit<32> IngressParser_parser_tmp_2 + bit<8> IngressParser_parser_tmp_2 bit<16> Ingress_tmp bit<16> Ingress_tmp_0 bit<8> Ingress_tmp_2 @@ -71,7 +71,7 @@ struct metadata_t { bit<8> Ingress_tmp_14 bit<8> Ingress_tmp_15 bit<8> Ingress_tmp_16 - bit<32> Ingress_tmp_18 + bit<8> Ingress_tmp_18 bit<16> Ingress_tmp_20 bit<32> Ingress_color_out bit<32> Ingress_color_in diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3.p4.spec index d98dc7d8d0c..a46ce940881 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3.p4.spec @@ -44,7 +44,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { @@ -53,12 +53,12 @@ struct metadata_t { bit<32> psa_ingress_output_metadata_egress_port bit<32> local_metadata_port_out bit<48> ingress_tbl_ethernet_srcAddr - bit<32> ingress_tbl_key - bit<32> ingress_tbl_key_0 + bit<8> ingress_tbl_key + bit<8> ingress_tbl_key_0 bit<8> IngressParser_parser_tmp bit<8> IngressParser_parser_tmp_0 bit<8> IngressParser_parser_tmp_1 - bit<32> IngressParser_parser_tmp_2 + bit<8> IngressParser_parser_tmp_2 bit<16> Ingress_tmp bit<16> Ingress_tmp_0 bit<8> Ingress_tmp_2 @@ -74,7 +74,7 @@ struct metadata_t { bit<8> Ingress_tmp_14 bit<8> Ingress_tmp_15 bit<8> Ingress_tmp_16 - bit<32> Ingress_tmp_18 + bit<8> Ingress_tmp_18 bit<16> Ingress_tmp_20 bit<16> Ingress_tmp_21 bit<16> Ingress_tmp_22 diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5.p4.spec index 0eaa069c293..bd65e8e1725 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5.p4.spec @@ -44,7 +44,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { @@ -55,7 +55,7 @@ struct metadata_t { bit<8> IngressParser_parser_tmp bit<8> IngressParser_parser_tmp_0 bit<8> IngressParser_parser_tmp_1 - bit<32> IngressParser_parser_tmp_2 + bit<8> IngressParser_parser_tmp_2 bit<16> Ingress_tmp bit<16> Ingress_tmp_0 bit<8> Ingress_tmp_2 @@ -71,7 +71,7 @@ struct metadata_t { bit<8> Ingress_tmp_14 bit<8> Ingress_tmp_15 bit<8> Ingress_tmp_16 - bit<32> Ingress_tmp_18 + bit<8> Ingress_tmp_18 bit<16> Ingress_tmp_20 bit<32> Ingress_color_out bit<32> Ingress_color_in diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6.p4.spec index d4a774308be..c218cfd465b 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6.p4.spec @@ -45,7 +45,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { @@ -54,14 +54,14 @@ struct metadata_t { bit<8> psa_ingress_output_metadata_drop bit<32> psa_ingress_output_metadata_egress_port bit<32> local_metadata_port_out - bit<32> local_metadata_temp + bit<8> local_metadata_temp bit<8> IngressParser_parser_tmp bit<8> IngressParser_parser_tmp_0 bit<8> IngressParser_parser_tmp_2 bit<8> IngressParser_parser_tmp_3 bit<8> IngressParser_parser_tmp_4 bit<8> IngressParser_parser_tmp_5 - bit<32> IngressParser_parser_tmp_6 + bit<8> IngressParser_parser_tmp_6 bit<8> Ingress_tmp bit<8> Ingress_tmp_0 bit<8> Ingress_tmp_1 @@ -78,7 +78,7 @@ struct metadata_t { bit<8> Ingress_tmp_14 bit<8> Ingress_tmp_15 bit<8> Ingress_tmp_16 - bit<32> Ingress_tmp_18 + bit<8> Ingress_tmp_18 bit<16> Ingress_tmp_20 bit<32> Ingress_color_out bit<32> Ingress_color_in diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7.p4.spec index 857232f971c..075f8036819 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7.p4.spec @@ -46,7 +46,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { @@ -55,14 +55,14 @@ struct metadata_t { bit<8> psa_ingress_output_metadata_drop bit<32> psa_ingress_output_metadata_egress_port bit<32> local_metadata_port_out - bit<32> local_metadata_temp + bit<8> local_metadata_temp bit<8> IngressParser_parser_tmp bit<8> IngressParser_parser_tmp_0 bit<8> IngressParser_parser_tmp_2 bit<8> IngressParser_parser_tmp_3 bit<8> IngressParser_parser_tmp_4 bit<8> IngressParser_parser_tmp_5 - bit<32> IngressParser_parser_tmp_6 + bit<8> IngressParser_parser_tmp_6 bit<8> Ingress_tmp bit<8> Ingress_tmp_0 bit<8> Ingress_tmp_1 @@ -83,7 +83,7 @@ struct metadata_t { bit<8> Ingress_tmp_18 bit<8> Ingress_tmp_19 bit<8> Ingress_tmp_20 - bit<32> Ingress_tmp_22 + bit<8> Ingress_tmp_22 bit<16> Ingress_tmp_24 bit<32> Ingress_color_out bit<32> Ingress_color_in diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8.p4.spec index 526f278a262..c4007013a44 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8.p4.spec @@ -47,7 +47,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { @@ -56,14 +56,14 @@ struct metadata_t { bit<8> psa_ingress_output_metadata_drop bit<32> psa_ingress_output_metadata_egress_port bit<32> local_metadata_port_out - bit<32> local_metadata_temp + bit<8> local_metadata_temp bit<8> IngressParser_parser_tmp bit<8> IngressParser_parser_tmp_0 bit<8> IngressParser_parser_tmp_2 bit<8> IngressParser_parser_tmp_3 bit<8> IngressParser_parser_tmp_4 bit<8> IngressParser_parser_tmp_5 - bit<32> IngressParser_parser_tmp_6 + bit<8> IngressParser_parser_tmp_6 bit<8> Ingress_tmp bit<8> Ingress_tmp_0 bit<8> Ingress_tmp_1 @@ -80,7 +80,7 @@ struct metadata_t { bit<8> Ingress_tmp_14 bit<8> Ingress_tmp_15 bit<8> Ingress_tmp_16 - bit<32> Ingress_tmp_18 + bit<8> Ingress_tmp_18 bit<16> Ingress_tmp_20 bit<32> Ingress_color_out bit<32> Ingress_color_in diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9.p4.spec index 4ceaa2c3b9f..0a5ac718ace 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9.p4.spec @@ -44,7 +44,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { @@ -54,11 +54,11 @@ struct metadata_t { bit<32> local_metadata_port_out bit<48> ingress_tbl_ethernet_srcAddr bit<16> ingress_tbl_ipv4_hdrChecksum - bit<32> ingress_tbl_key + bit<8> ingress_tbl_key bit<8> IngressParser_parser_tmp bit<8> IngressParser_parser_tmp_0 bit<8> IngressParser_parser_tmp_1 - bit<32> IngressParser_parser_tmp_2 + bit<8> IngressParser_parser_tmp_2 bit<16> Ingress_tmp bit<16> Ingress_tmp_0 bit<8> Ingress_tmp_2 @@ -74,7 +74,7 @@ struct metadata_t { bit<8> Ingress_tmp_14 bit<8> Ingress_tmp_15 bit<8> Ingress_tmp_16 - bit<32> Ingress_tmp_18 + bit<8> Ingress_tmp_18 bit<16> Ingress_tmp_20 bit<8> Ingress_tmp_21 bit<8> Ingress_tmp_22 diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-externs.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-externs.p4.spec index 7f7e5728423..e2af03a0fbf 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-externs.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-externs.p4.spec @@ -44,7 +44,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter.p4.spec index 10160445853..a28b2c07a73 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter.p4.spec @@ -40,7 +40,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1.p4.spec b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1.p4.spec index 972802d2db8..4a91e781809 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1.p4.spec @@ -40,7 +40,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_1_arg_t { - bit<32> index + bit<16> index } struct metadata_t { diff --git a/testdata/p4_16_samples_outputs/psa-example-parser-checksum.p4.spec b/testdata/p4_16_samples_outputs/psa-example-parser-checksum.p4.spec index b5e93211fd0..5f03ce96087 100644 --- a/testdata/p4_16_samples_outputs/psa-example-parser-checksum.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-example-parser-checksum.p4.spec @@ -98,13 +98,13 @@ struct metadata { bit<16> IngressParser_parser_tmp_11 bit<16> IngressParser_parser_tmp_12 bit<8> IngressParser_parser_tmp_13 - bit<32> IngressParser_parser_tmp_14 - bit<32> IngressParser_parser_tmp_15 + bit<8> IngressParser_parser_tmp_14 + bit<8> IngressParser_parser_tmp_15 bit<8> IngressParser_parser_tmp_16 bit<16> IngressParser_parser_tmp_17 bit<16> IngressParser_parser_tmp_18 - bit<32> IngressParser_parser_tmp_19 - bit<32> IngressParser_parser_tmp_20 + bit<8> IngressParser_parser_tmp_19 + bit<16> IngressParser_parser_tmp_20 bit<8> IngressParser_parser_tmp_21 bit<8> IngressParser_parser_tmp_22 bit<32> IngressParser_parser_tmp_23 diff --git a/testdata/p4_16_samples_outputs/psa-register1.p4.spec b/testdata/p4_16_samples_outputs/psa-register1.p4.spec index a6e20b2effb..1b4dbe34610 100644 --- a/testdata/p4_16_samples_outputs/psa-register1.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-register1.p4.spec @@ -27,7 +27,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_register_arg_t { - bit<32> idx + bit<16> idx } struct EMPTY { diff --git a/testdata/p4_16_samples_outputs/psa-register2.p4.spec b/testdata/p4_16_samples_outputs/psa-register2.p4.spec index 301217d3874..a2c03c60403 100644 --- a/testdata/p4_16_samples_outputs/psa-register2.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-register2.p4.spec @@ -27,7 +27,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_register_arg_t { - bit<32> idx + bit<16> idx } struct user_meta_t { diff --git a/testdata/p4_16_samples_outputs/psa-register3.p4.spec b/testdata/p4_16_samples_outputs/psa-register3.p4.spec index c6d6e7b76e2..a12e3216595 100644 --- a/testdata/p4_16_samples_outputs/psa-register3.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-register3.p4.spec @@ -27,7 +27,7 @@ struct psa_egress_deparser_input_metadata_t { } struct execute_register_arg_t { - bit<32> idx + bit<16> idx } struct user_meta_t { diff --git a/testdata/p4_16_samples_outputs/psa-subtract-inst1.p4.spec b/testdata/p4_16_samples_outputs/psa-subtract-inst1.p4.spec index ebfe3527513..b77839960e2 100644 --- a/testdata/p4_16_samples_outputs/psa-subtract-inst1.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-subtract-inst1.p4.spec @@ -41,19 +41,19 @@ struct user_meta_data_t { bit<32> psa_ingress_input_metadata_ingress_port bit<8> psa_ingress_output_metadata_drop bit<32> psa_ingress_output_metadata_egress_port - bit<32> local_metadata_depth1 - bit<32> local_metadata_depth2 - bit<32> local_metadata_depth3 - bit<32> local_metadata_depth4 - bit<32> local_metadata_depth5 - bit<32> local_metadata_depth6 - bit<32> local_metadata_depth7 - bit<64> Ingress_tmp - bit<32> Ingress_var1 - bit<32> Ingress_var2 - bit<64> Ingress_var3 - bit<64> Ingress_var4 - bit<64> Ingress_var5 + bit<8> local_metadata_depth1 + bit<8> local_metadata_depth2 + bit<8> local_metadata_depth3 + bit<8> local_metadata_depth4 + bit<8> local_metadata_depth5 + bit<8> local_metadata_depth6 + bit<8> local_metadata_depth7 + bit<40> Ingress_tmp + bit<8> Ingress_var1 + bit<8> Ingress_var2 + bit<40> Ingress_var3 + bit<40> Ingress_var4 + bit<40> Ingress_var5 } metadata instanceof user_meta_data_t diff --git a/testdata/p4_16_samples_outputs/psa-variable-index.p4.spec b/testdata/p4_16_samples_outputs/psa-variable-index.p4.spec index be8e062e908..78349f2bd98 100644 --- a/testdata/p4_16_samples_outputs/psa-variable-index.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-variable-index.p4.spec @@ -35,7 +35,7 @@ struct EMPTY_M { bit<16> psa_ingress_input_metadata_parser_error bit<8> psa_ingress_output_metadata_drop bit<32> psa_ingress_output_metadata_egress_port - bit<32> local_metadata_depth + bit<8> local_metadata_depth bit<16> local_metadata_ret bit<16> Ingress_tmp bit<16> Ingress_tmp_0 @@ -46,8 +46,8 @@ struct EMPTY_M { bit<16> Ingress_tmp_7 bit<16> Ingress_tmp_8 bit<16> Ingress_hsVar - bit<32> Ingress_hsVar_0 - bit<32> Ingress_vid + bit<16> Ingress_hsVar_0 + bit<16> Ingress_vid } metadata instanceof EMPTY_M diff --git a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-first.p4 b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-first.p4 index 710cf2c3058..a818c072290 100644 --- a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-first.p4 @@ -62,9 +62,9 @@ control ingress(inout Header_t h, inout Meta_t m, inout standard_metadata_t stan } default_action = a(); const entries = { - 16w0x1111 &&& 16w0xf : a_with_control_params(9w1)@priority(3); + 16w0x1111 &&& 16w0xf : a_with_control_params(9w1)@priority(3) ; 16w0x1181 : a_with_control_params(9w2); - 16w0x1181 &&& 16w0xf00f : a_with_control_params(9w3)@priority(1); + 16w0x1181 &&& 16w0xf00f : a_with_control_params(9w3)@priority(1) ; } } apply { diff --git a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-frontend.p4 index 4d6be6d19f4..474c45cb3d6 100644 --- a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-frontend.p4 @@ -62,9 +62,9 @@ control ingress(inout Header_t h, inout Meta_t m, inout standard_metadata_t stan } default_action = a(); const entries = { - 16w0x1111 &&& 16w0xf : a_with_control_params(9w1)@priority(3); + 16w0x1111 &&& 16w0xf : a_with_control_params(9w1)@priority(3) ; 16w0x1181 : a_with_control_params(9w2); - 16w0x1181 &&& 16w0xf00f : a_with_control_params(9w3)@priority(1); + 16w0x1181 &&& 16w0xf00f : a_with_control_params(9w3)@priority(1) ; } } apply { diff --git a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-midend.p4 index 4d6be6d19f4..474c45cb3d6 100644 --- a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2-midend.p4 @@ -62,9 +62,9 @@ control ingress(inout Header_t h, inout Meta_t m, inout standard_metadata_t stan } default_action = a(); const entries = { - 16w0x1111 &&& 16w0xf : a_with_control_params(9w1)@priority(3); + 16w0x1111 &&& 16w0xf : a_with_control_params(9w1)@priority(3) ; 16w0x1181 : a_with_control_params(9w2); - 16w0x1181 &&& 16w0xf00f : a_with_control_params(9w3)@priority(1); + 16w0x1181 &&& 16w0xf00f : a_with_control_params(9w3)@priority(1) ; } } apply { diff --git a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4 b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4 index afdcb3552e4..bd35fb433cc 100644 --- a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4 @@ -62,9 +62,9 @@ control ingress(inout Header_t h, inout Meta_t m, inout standard_metadata_t stan } default_action = a; const entries = { - 0x1111 &&& 0xf : a_with_control_params(1)@priority(3); + 0x1111 &&& 0xf : a_with_control_params(1)@priority(3) ; 0x1181 : a_with_control_params(2); - 0x1181 &&& 0xf00f : a_with_control_params(3)@priority(1); + 0x1181 &&& 0xf00f : a_with_control_params(3)@priority(1) ; } } apply {