diff --git a/p4rt_app/tests/golden_outputs/p4_constraints_test.expected b/p4rt_app/tests/golden_outputs/p4_constraints_test.expected index 8bec90b8..8762d770 100644 --- a/p4rt_app/tests/golden_outputs/p4_constraints_test.expected +++ b/p4rt_app/tests/golden_outputs/p4_constraints_test.expected @@ -118,9 +118,9 @@ updates { UNKNOWN: Batch failed, individual results: #1: INVALID_ARGUMENT: All entries must satisfy: -In @entry_restriction of table 'egress.acl_egress.acl_egress_table'; at offset line 6, columns 5 to 73: +In @entry_restriction of table 'egress.acl_egress.acl_egress_table'; at offset line 8, columns 5 to 73: | // Only allow IP field matches for IP packets. -6 | ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1); +8 | ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ But your entry does not. diff --git a/sai_p4/fixed/BUILD.bazel b/sai_p4/fixed/BUILD.bazel index 421de8f4..522f6932 100644 --- a/sai_p4/fixed/BUILD.bazel +++ b/sai_p4/fixed/BUILD.bazel @@ -35,8 +35,7 @@ filegroup( "parser.p4", "roles.h", "routing.p4", - "ttl.p4", - "vlan.p4", + "vlan.p4", ], ) diff --git a/sai_p4/fixed/drop_martians.p4 b/sai_p4/fixed/drop_martians.p4 index c7e22b67..9af8c23e 100644 --- a/sai_p4/fixed/drop_martians.p4 +++ b/sai_p4/fixed/drop_martians.p4 @@ -8,11 +8,21 @@ const ipv6_addr_t IPV6_MULTICAST_MASK = const ipv6_addr_t IPV6_MULTICAST_VALUE = 0xff00_0000_0000_0000_0000_0000_0000_0000; +// ::1/128 +const ipv6_addr_t IPV6_LOOPBACK_MASK = + 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff; +const ipv6_addr_t IPV6_LOOPBACK_VALUE = + 0x0000_0000_0000_0000_0000_0000_0000_0001; + const ipv4_addr_t IPV4_MULTICAST_MASK = 0xf0_00_00_00; const ipv4_addr_t IPV4_MULTICAST_VALUE = 0xe0_00_00_00; const ipv4_addr_t IPV4_BROADCAST_VALUE = 0xff_ff_ff_ff; +// 127.0.0.0/8 +const ipv4_addr_t IPV4_LOOPBACK_MASK = 0xff_00_00_00; +const ipv4_addr_t IPV4_LOOPBACK_VALUE = 0x7f_00_00_00; + // I/G bit = 1 means multicast. const ethernet_addr_t MAC_MULTICAST_MASK = 0x01_00_00_00_00_00; const ethernet_addr_t MAC_MULTICAST_VALUE = 0x01_00_00_00_00_00; @@ -21,33 +31,48 @@ const ethernet_addr_t MAC_MULTICAST_VALUE = 0x01_00_00_00_00_00; #define IS_IPV6_MULTICAST(address) \ (address & IPV6_MULTICAST_MASK == IPV6_MULTICAST_VALUE) +#define IS_IPV6_LOOPBACK(address) \ + (address & IPV6_LOOPBACK_MASK == IPV6_LOOPBACK_VALUE) + #define IS_IPV4_MULTICAST_OR_BROADCAST(address) \ ((address & IPV4_MULTICAST_MASK == IPV4_MULTICAST_VALUE) || \ (address == IPV4_BROADCAST_VALUE)) +#define IS_IPV4_LOOPBACK(address) \ + (address & IPV4_LOOPBACK_MASK == IPV4_LOOPBACK_VALUE) + #define IS_MAC_MULTICAST(address) \ (address & MAC_MULTICAST_MASK == MAC_MULTICAST_VALUE) + control drop_martians(in headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { apply { // Drop the packet if: - // - Src or dst IPv6 addresses are in multicast range; or - // - Src or dst IPv4 addresses are in multicast or broadcast range. - // - I/G bit in dst MAC address is set (i.e. a multicast address) + // - Src/Dst IPv6 addresses are in multicast range; or + // - Src/Dst IPv4 addresses are in multicast or broadcast range; or + // - I/G bit in dst MAC address is set (i.e. a multicast address); or + // - Src/Dst IPv4/IPv6 address is a loopback address. // Rationale: // Src IP multicast drop: https://www.rfc-editor.org/rfc/rfc1812#section-5.3.7 // Dst IP multicast drop: multicast is not yet modeled and our switches drop // multicast packets for now. + // Src/Dst IP loopback drop: https://en.wikipedia.org/wiki/Localhost#Packet_processing + // "Packets received on a non-loopback interface with a loopback source + // or destination address must be dropped." // Dst MAC multicast drop: multicast is not yet modeled and our switches // drop multicast packets for now. if ((headers.ipv6.isValid() && (IS_IPV6_MULTICAST(headers.ipv6.src_addr) || - IS_IPV6_MULTICAST(headers.ipv6.dst_addr))) || + IS_IPV6_MULTICAST(headers.ipv6.dst_addr) || + IS_IPV6_LOOPBACK(headers.ipv6.src_addr) || + IS_IPV6_LOOPBACK(headers.ipv6.dst_addr))) || (headers.ipv4.isValid() && (IS_IPV4_MULTICAST_OR_BROADCAST(headers.ipv4.src_addr) || - IS_IPV4_MULTICAST_OR_BROADCAST(headers.ipv4.dst_addr))) || + IS_IPV4_MULTICAST_OR_BROADCAST(headers.ipv4.dst_addr) || + IS_IPV4_LOOPBACK(headers.ipv4.src_addr) || + IS_IPV4_LOOPBACK(headers.ipv4.dst_addr))) || (headers.ethernet.isValid() && IS_MAC_MULTICAST(headers.ethernet.dst_addr))) { mark_to_drop(standard_metadata); diff --git a/sai_p4/fixed/packet_rewrites.p4 b/sai_p4/fixed/packet_rewrites.p4 index 7b8c22f0..a2dccc94 100644 --- a/sai_p4/fixed/packet_rewrites.p4 +++ b/sai_p4/fixed/packet_rewrites.p4 @@ -15,6 +15,22 @@ control packet_rewrites(inout headers_t headers, if (local_metadata.admit_to_l3) { headers.ethernet.src_addr = local_metadata.packet_rewrites.src_mac; headers.ethernet.dst_addr = local_metadata.packet_rewrites.dst_mac; + + if (headers.ipv4.isValid()) { + if (headers.ipv4.ttl <= 1) { + mark_to_drop(standard_metadata); + } else { + headers.ipv4.ttl = headers.ipv4.ttl - 1; + } + } + + if (headers.ipv6.isValid()) { + if (headers.ipv6.hop_limit <= 1) { + mark_to_drop(standard_metadata); + } else { + headers.ipv6.hop_limit = headers.ipv6.hop_limit - 1; + } + } } } } // control packet_rewrites diff --git a/sai_p4/fixed/ttl.p4 b/sai_p4/fixed/ttl.p4 deleted file mode 100644 index 6c80399b..00000000 --- a/sai_p4/fixed/ttl.p4 +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef SAI_TTL_P4_ -#define SAI_TTL_P4_ - -#include -#include "headers.p4" -#include "metadata.p4" - -control ttl(inout headers_t headers, - inout local_metadata_t local_metadata, - inout standard_metadata_t standard_metadata) { - apply { - if (local_metadata.admit_to_l3) { - if (headers.ipv4.isValid()) { - if (headers.ipv4.ttl <= 1) { - mark_to_drop(standard_metadata); - } else { - headers.ipv4.ttl = headers.ipv4.ttl - 1; - } - } - - if (headers.ipv6.isValid()) { - if (headers.ipv6.hop_limit <= 1) { - mark_to_drop(standard_metadata); - } else { - headers.ipv6.hop_limit = headers.ipv6.hop_limit - 1; - } - } - } - } -} // control ttl - -#endif // SAI_TTL_P4_ diff --git a/sai_p4/instantiations/google/.acl_ingress.p4.swp b/sai_p4/instantiations/google/.acl_ingress.p4.swp deleted file mode 100644 index 266f267d..00000000 Binary files a/sai_p4/instantiations/google/.acl_ingress.p4.swp and /dev/null differ diff --git a/sai_p4/instantiations/google/acl_egress.p4 b/sai_p4/instantiations/google/acl_egress.p4 index 2b6ae81f..b01e09ec 100644 --- a/sai_p4/instantiations/google/acl_egress.p4 +++ b/sai_p4/instantiations/google/acl_egress.p4 @@ -34,13 +34,20 @@ control acl_egress(in headers_t headers, @id(ACL_EGRESS_TABLE_ID) @sai_acl(EGRESS) @entry_restriction(" +#ifdef SAI_INSTANTIATION_FABRIC_BORDER_ROUTER // Forbid using ether_type for IP packets (by convention, use is_ip* instead). ether_type != 0x0800 && ether_type != 0x86dd; dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1); +#endif // Only allow IP field matches for IP packets. ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1); +#if defined(SAI_INSTANTIATION_TOR) + dst_ipv6::mask != 0 -> is_ipv6 == 1; +#endif +#ifdef SAI_INSTANTIATION_FABRIC_BORDER_ROUTER // Only allow l4_dst_port matches for TCP/UDP packets. l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17); +#endif // Forbid illegal combinations of IP_TYPE fields. is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0); is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0); @@ -51,12 +58,16 @@ control acl_egress(in headers_t headers, ") table acl_egress_table { key = { +#ifdef SAI_INSTANTIATION_FABRIC_BORDER_ROUTER headers.ethernet.ether_type : ternary @name("ether_type") @id(1) @sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE); +#endif ip_protocol : ternary @name("ip_protocol") @id(2) @sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL); +#ifdef SAI_INSTANTIATION_FABRIC_BORDER_ROUTER local_metadata.l4_dst_port : ternary @name("l4_dst_port") @id(3) @sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT); +#endif (port_id_t)standard_metadata.egress_port: optional @name("out_port") @id(4) @sai_field(SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT); headers.ipv4.isValid() || headers.ipv6.isValid() : optional @name("is_ip") @@ -65,13 +76,22 @@ control acl_egress(in headers_t headers, @sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE/IPV4ANY); headers.ipv6.isValid() : optional @name("is_ipv6") @id(7) @sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE/IPV6ANY); +#ifdef SAI_INSTANTIATION_FABRIC_BORDER_ROUTER // Field for v4 and v6 DSCP bits. dscp : ternary @name("dscp") @id(8) @sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP); +#endif +#if defined(SAI_INSTANTIATION_TOR) + headers.ipv6.dst_addr[127:64] : ternary @name("dst_ipv6") @id(9) + @composite_field( + @sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD3), + @sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD2) + ) @format(IPV6_ADDRESS); +#endif } actions = { @proto_id(1) acl_drop(standard_metadata); -#ifdef SAI_INSTANTIATION_TOR +#if defined(SAI_INSTANTIATION_TOR) @proto_id(2) acl_egress_forward(); #endif @defaultonly NoAction; @@ -85,8 +105,6 @@ control acl_egress(in headers_t headers, @sai_acl(EGRESS) @p4runtime_role(P4RUNTIME_ROLE_SDN_CONTROLLER) @entry_restriction(" - // Forbid using ether_type for IP packets (by convention, use is_ip* instead). - ether_type != 0x0800 && ether_type != 0x86dd; // Only allow IP field matches for IP packets. ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1); // Only allow l4_dst_port matches for TCP/UDP packets. @@ -110,9 +128,6 @@ control acl_egress(in headers_t headers, headers.ipv6.isValid() : optional @id(3) @name("is_ipv6") @sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE/IPV6ANY); - headers.ethernet.ether_type : ternary - @id(4) @name("ether_type") - @sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE); ip_protocol : ternary @id(5) @name("ip_protocol") @sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL); @@ -147,8 +162,7 @@ control acl_egress(in headers_t headers, acl_egress_table.apply(); #elif defined(SAI_INSTANTIATION_TOR) acl_egress_table.apply(); - // TODO: Not enough SAI resources for the second EFP bank. - // acl_egress_dhcp_to_host_table.apply(); + acl_egress_dhcp_to_host_table.apply(); #endif } } // control ACL_EGRESS diff --git a/sai_p4/instantiations/google/acl_ingress.p4 b/sai_p4/instantiations/google/acl_ingress.p4 index e3d3005d..28688c51 100644 --- a/sai_p4/instantiations/google/acl_ingress.p4 +++ b/sai_p4/instantiations/google/acl_ingress.p4 @@ -45,6 +45,15 @@ control acl_ingress(in headers_t headers, // Copy the packet to the CPU, and forward the original packet. @id(ACL_INGRESS_COPY_ACTION_ID) +#if defined(SAI_INSTANTIATION_TOR) + // In ToRs, the acl_ingress_table copy action will not apply a rate limit. + // Rate limits will be applied by acl_ingress_qos_table cancel_copy actions. + @sai_action(SAI_PACKET_ACTION_COPY) + action acl_copy(@sai_action_param(QOS_QUEUE) @id(1) qos_queue_t qos_queue) { + acl_ingress_counter.count(); + marked_to_copy = true; + } +#else @sai_action(SAI_PACKET_ACTION_COPY, SAI_PACKET_COLOR_GREEN) @sai_action(SAI_PACKET_ACTION_FORWARD, SAI_PACKET_COLOR_YELLOW) @sai_action(SAI_PACKET_ACTION_FORWARD, SAI_PACKET_COLOR_RED) @@ -56,34 +65,34 @@ control acl_ingress(in headers_t headers, // TODO: Branch on color and model behavior for all colors. marked_to_copy = true; } +#endif // Copy the packet to the CPU. The original packet is dropped. @id(ACL_INGRESS_TRAP_ACTION_ID) +#if defined(SAI_INSTANTIATION_TOR) + // In ToRs, the acl_ingress_table trap action will not apply a rate limit. + // Rate limits will be applied by acl_ingress_qos_table cancel_copy actions. + @sai_action(SAI_PACKET_ACTION_TRAP) +#else @sai_action(SAI_PACKET_ACTION_TRAP, SAI_PACKET_COLOR_GREEN) @sai_action(SAI_PACKET_ACTION_DROP, SAI_PACKET_COLOR_YELLOW) @sai_action(SAI_PACKET_ACTION_DROP, SAI_PACKET_COLOR_RED) +#endif action acl_trap(@sai_action_param(QOS_QUEUE) @id(1) qos_queue_t qos_queue) { acl_copy(qos_queue); mark_to_drop(standard_metadata); } - // An experimental, metered version of `acl_trap`. - // TODO: Remove this action and meter the existing `acl_trap` - // action. - @id(ACL_INGRESS_EXPERIMENTAL_TRAP_ACTION_ID) - @sai_action(SAI_PACKET_ACTION_TRAP, SAI_PACKET_COLOR_GREEN) - @sai_action(SAI_PACKET_ACTION_DROP, SAI_PACKET_COLOR_YELLOW) - @sai_action(SAI_PACKET_ACTION_DROP, SAI_PACKET_COLOR_RED) - action acl_experimental_trap(@sai_action_param(QOS_QUEUE) @id(1) qos_queue_t qos_queue) { - acl_ingress_meter.read(local_metadata.color); - // TODO: model metering by branching on color. - acl_trap(qos_queue); - } - // Forward the packet normally (i.e., perform no action). This is useful as // the default action, and to specify a meter but not otherwise perform any // action. @id(ACL_INGRESS_FORWARD_ACTION_ID) +#if defined(SAI_INSTANTIATION_TOR) + // ToRs rely on QoS queues to limit forwarded flows. + @sai_action(SAI_PACKET_ACTION_FORWARD) + action acl_forward() { + } +#else @sai_action(SAI_PACKET_ACTION_FORWARD, SAI_PACKET_COLOR_GREEN) @sai_action(SAI_PACKET_ACTION_DROP, SAI_PACKET_COLOR_YELLOW) @sai_action(SAI_PACKET_ACTION_DROP, SAI_PACKET_COLOR_RED) @@ -92,6 +101,7 @@ control acl_ingress(in headers_t headers, // We model the behavior for GREEN packes only here. // TODO: Branch on color and model behavior for all colors. } +#endif // Forward the packet normally (i.e., perform no action). @id(ACL_INGRESS_COUNT_ACTION_ID) @@ -156,6 +166,7 @@ control acl_ingress(in headers_t headers, @p4runtime_role(P4RUNTIME_ROLE_SDN_CONTROLLER) @id(ACL_INGRESS_TABLE_ID) @sai_acl(INGRESS) + @sai_acl_priority(5) @entry_restriction(" // Forbid using ether_type for IP packets (by convention, use is_ip* instead). ether_type != 0x0800 && ether_type != 0x86dd; @@ -171,7 +182,7 @@ control acl_ingress(in headers_t headers, // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets. l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17); l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17); -#ifdef SAI_INSTANTIATION_MIDDLEBLOCK +#if defined(SAI_INSTANTIATION_MIDDLEBLOCK) || defined(SAI_INSTANTIATION_TOR) // Only allow arp_tpa matches for ARP packets. arp_tpa::mask != 0 -> ether_type == 0x0806; #endif @@ -244,7 +255,7 @@ control acl_ingress(in headers_t headers, @sai_udf(base=SAI_UDF_BASE_L3, offset=26, length=2) ) @format(IPV4_ADDRESS); #endif -#ifdef SAI_INSTANTIATION_FABRIC_BORDER_ROUTER +#if defined(SAI_INSTANTIATION_FABRIC_BORDER_ROUTER) || defined(SAI_INSTANTIATION_TOR) local_metadata.ingress_port : optional @name("in_port") @id(17) @sai_field(SAI_ACL_TABLE_ATTR_FIELD_IN_PORT); local_metadata.route_metadata : optional @name("route_metadata") @id(18) @@ -252,23 +263,26 @@ control acl_ingress(in headers_t headers, #endif } actions = { - // TODO: add action to set color to yellow @proto_id(1) acl_copy(); @proto_id(2) acl_trap(); @proto_id(3) acl_forward(); @proto_id(4) acl_mirror(); @proto_id(5) acl_drop(standard_metadata); - @proto_id(99) acl_experimental_trap(); @defaultonly NoAction; } const default_action = NoAction; +#if defined(SAI_INSTANTIATION_MIDDLEBLOCK) || defined(SAI_INSTANTIATION_FABRIC_BORDER_ROUTER) meters = acl_ingress_meter; counters = acl_ingress_counter; +#else + counters = acl_ingress_counter; +#endif size = ACL_INGRESS_TABLE_MINIMUM_GUARANTEED_SIZE; } @id(ACL_INGRESS_QOS_TABLE_ID) @sai_acl(INGRESS) + @sai_acl_priority(10) @p4runtime_role(P4RUNTIME_ROLE_SDN_CONTROLLER) @entry_restriction(" // Forbid using ether_type for IP packets (by convention, use is_ip* instead). @@ -391,13 +405,11 @@ control acl_ingress(in headers_t headers, // Only allow IP field matches for IP packets. dst_ip::mask != 0 -> is_ipv4 == 1; src_ip::mask != 0 -> is_ipv4 == 1; -#if defined(SAI_INSTANTIATION_EXPERIMENTAL_TOR) dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1); ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1); // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets. l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17); l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17); -#endif // Forbid illegal combinations of IP_TYPE fields. is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0); is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0); @@ -486,7 +498,6 @@ control acl_ingress(in headers_t headers, // additional parts of SAI in the future. acl_ingress_table.apply(); acl_ingress_qos_table.apply(); - acl_ingress_security_table.apply(); #endif if (marked_to_copy && !cancel_copy) { diff --git a/sai_p4/instantiations/google/acl_pre_ingress.p4 b/sai_p4/instantiations/google/acl_pre_ingress.p4 index 4a0cd310..681dbc40 100644 --- a/sai_p4/instantiations/google/acl_pre_ingress.p4 +++ b/sai_p4/instantiations/google/acl_pre_ingress.p4 @@ -85,10 +85,8 @@ control acl_pre_ingress(in headers_t headers, @sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE/IPV6ANY); headers.ethernet.src_addr : ternary @name("src_mac") @id(4) @sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC) @format(MAC_ADDRESS); -#ifdef SAI_INSTANTIATION_FABRIC_BORDER_ROUTER headers.ethernet.dst_addr : ternary @name("dst_mac") @id(9) @sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_MAC) @format(MAC_ADDRESS); -#endif headers.ipv4.dst_addr : ternary @name("dst_ip") @id(5) @sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IP) @format(IPV4_ADDRESS); headers.ipv6.dst_addr[127:64] : ternary @name("dst_ipv6") @id(6) @@ -199,7 +197,7 @@ control acl_pre_ingress(in headers_t headers, acl_pre_ingress_table.apply(); #elif defined(SAI_INSTANTIATION_FABRIC_BORDER_ROUTER) acl_pre_ingress_table.apply(); -#elif defined(SAI_INSTANTIATION_TOR) +#elif defined(SAI_INSTANTIATION_TOR) acl_pre_ingress_vlan_table.apply(); acl_pre_ingress_metadata_table.apply(); acl_pre_ingress_table.apply(); diff --git a/sai_p4/instantiations/google/fabric_border_router.p4 b/sai_p4/instantiations/google/fabric_border_router.p4 index e93e3546..574b9d65 100644 --- a/sai_p4/instantiations/google/fabric_border_router.p4 +++ b/sai_p4/instantiations/google/fabric_border_router.p4 @@ -16,13 +16,13 @@ #include "../../fixed/mirroring_encap.p4" #include "../../fixed/mirroring_clone.p4" #include "../../fixed/l3_admit.p4" -#include "../../fixed/ttl.p4" +#include "../../fixed/vlan.p4" +#include "../../fixed/drop_martians.p4" #include "../../fixed/packet_rewrites.p4" #include "acl_egress.p4" #include "acl_ingress.p4" #include "acl_pre_ingress.p4" #include "admit_google_system_mac.p4" -//#include "hashing.p4" #include "ids.h" #include "versions.h" @@ -30,13 +30,17 @@ control ingress(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { apply { - acl_pre_ingress.apply(headers, local_metadata, standard_metadata); - admit_google_system_mac.apply(headers, local_metadata); - l3_admit.apply(headers, local_metadata, standard_metadata); - routing.apply(headers, local_metadata, standard_metadata); - acl_ingress.apply(headers, local_metadata, standard_metadata); - ttl.apply(headers, local_metadata, standard_metadata); - mirroring_clone.apply(headers, local_metadata, standard_metadata); + packet_out_decap.apply(headers, local_metadata, standard_metadata); + if (!local_metadata.bypass_ingress) { + vlan_untag.apply(headers, local_metadata, standard_metadata); + acl_pre_ingress.apply(headers, local_metadata, standard_metadata); + admit_google_system_mac.apply(headers, local_metadata); + l3_admit.apply(headers, local_metadata, standard_metadata); + routing.apply(headers, local_metadata, standard_metadata); + drop_martians.apply(headers, local_metadata, standard_metadata); + acl_ingress.apply(headers, local_metadata, standard_metadata); + mirroring_clone.apply(headers, local_metadata, standard_metadata); + } } } // control ingress diff --git a/sai_p4/instantiations/google/fabric_border_router.p4info.pb.txt b/sai_p4/instantiations/google/fabric_border_router.p4info.pb.txt index 0a99c0cc..fa8285fd 100644 --- a/sai_p4/instantiations/google/fabric_border_router.p4info.pb.txt +++ b/sai_p4/instantiations/google/fabric_border_router.p4info.pb.txt @@ -1,6 +1,6 @@ pkg_info { name: "fabric_border_router.p4" - version: "2.3.0" + version: "1.4.0" arch: "v1model" organization: "Google" } @@ -389,6 +389,7 @@ tables { alias: "acl_ingress_table" annotations: "@p4runtime_role(\"sdn_controller\")" annotations: "@sai_acl(INGRESS)" + annotations: "@sai_acl_priority(5)" annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n ecn::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n\n\n\n\n // Only allow icmp_type matches for ICMP packets\n icmp_type::mask != 0 -> ip_protocol == 1;\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" } match_fields { @@ -551,10 +552,6 @@ tables { id: 16777481 annotations: "@proto_id(5)" } - action_refs { - id: 16777625 - annotations: "@proto_id(99)" - } action_refs { id: 21257015 annotations: "@defaultonly" @@ -683,7 +680,7 @@ tables { alias: "acl_egress_table" annotations: "@p4runtime_role(\"sdn_controller\")" annotations: "@sai_acl(EGRESS)" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" + annotations: "@entry_restriction(\"\n\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n\n\n\n // Only allow l4_dst_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" } match_fields { id: 1 @@ -1015,24 +1012,6 @@ actions { } } } -actions { - preamble { - id: 16777625 - name: "ingress.acl_ingress.acl_experimental_trap" - alias: "acl_experimental_trap" - annotations: "@sai_action(SAI_PACKET_ACTION_TRAP , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" - } - params { - id: 1 - name: "qos_queue" - annotations: "@sai_action_param(QOS_QUEUE)" - type_name { - name: "qos_queue_t" - } - } -} actions { preamble { id: 16777475 diff --git a/sai_p4/instantiations/google/fabric_border_router_with_s2_hash_profile.p4info.pb.txt b/sai_p4/instantiations/google/fabric_border_router_with_s2_hash_profile.p4info.pb.txt deleted file mode 100644 index 3bc143ff..00000000 --- a/sai_p4/instantiations/google/fabric_border_router_with_s2_hash_profile.p4info.pb.txt +++ /dev/null @@ -1,1426 +0,0 @@ -pkg_info { - name: "fabric_border_router_with_s2_hash_profile.p4" - version: "1.3.0" - arch: "v1model" - organization: "Google" -} -tables { - preamble { - id: 33554689 - name: "ingress.acl_pre_ingress.acl_pre_ingress_table" - alias: "acl_pre_ingress_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@sai_acl(PRE_INGRESS)" - annotations: "@entry_restriction(\"\n // Only allow IP field matches for IP packets.\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n // Reserve high priorities for switch-internal use.\n // TODO: Remove once inband workaround is obsolete.\n ::priority < 0x7fffffff;\n \")" - } - match_fields { - id: 1 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 2 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 3 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 4 - name: "src_mac" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC)" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 9 - name: "dst_mac" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_MAC)" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 5 - name: "dst_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 6 - name: "dst_ipv6" - annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD2 ))" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 64 - match_type: TERNARY - } - match_fields { - id: 7 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 8 - name: "in_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IN_PORT)" - match_type: OPTIONAL - type_name { - name: "port_id_t" - } - } - action_refs { - id: 16777472 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767361 - size: 254 -} -tables { - preamble { - id: 33554503 - name: "ingress.l3_admit.l3_admit_table" - alias: "l3_admit_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "dst_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 2 - name: "in_port" - match_type: OPTIONAL - type_name { - name: "port_id_t" - } - } - action_refs { - id: 16777224 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 128 -} -tables { - preamble { - id: 33554496 - name: "ingress.routing.neighbor_table" - alias: "neighbor_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "router_interface_id" - annotations: "@refers_to(router_interface_table , router_interface_id)" - match_type: EXACT - type_name { - name: "router_interface_id_t" - } - } - match_fields { - id: 2 - name: "neighbor_id" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 128 - match_type: EXACT - } - action_refs { - id: 16777217 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 1024 -} -tables { - preamble { - id: 33554497 - name: "ingress.routing.router_interface_table" - alias: "router_interface_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "router_interface_id" - match_type: EXACT - type_name { - name: "router_interface_id_t" - } - } - action_refs { - id: 16777218 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 256 -} -tables { - preamble { - id: 33554512 - name: "ingress.routing.tunnel_table" - alias: "tunnel_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "tunnel_id" - match_type: EXACT - type_name { - name: "tunnel_id_t" - } - } - action_refs { - id: 16777235 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 512 -} -tables { - preamble { - id: 33554498 - name: "ingress.routing.nexthop_table" - alias: "nexthop_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "nexthop_id" - match_type: EXACT - type_name { - name: "nexthop_id_t" - } - } - action_refs { - id: 16777219 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777234 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777236 - annotations: "@proto_id(3)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 1024 -} -tables { - preamble { - id: 33554499 - name: "ingress.routing.wcmp_group_table" - alias: "wcmp_group_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@oneshot" - } - match_fields { - id: 1 - name: "wcmp_group_id" - match_type: EXACT - type_name { - name: "wcmp_group_id_t" - } - } - action_refs { - id: 16777221 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - implementation_id: 299650760 - size: 3968 -} -tables { - preamble { - id: 33554506 - name: "ingress.routing.vrf_table" - alias: "vrf_table" - annotations: "@entry_restriction(\"\n // The VRF ID 0 (or \'\' in P4Runtime) encodes the default VRF, which cannot\n // be read or written via this table, but is always present implicitly.\n // TODO: This constraint should read `vrf_id != \'\'` (since\n // constraints are a control plane (P4Runtime) concept), but\n // p4-constraints does not currently support strings.\n vrf_id != 0;\n \")" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "vrf_id" - match_type: EXACT - type_name { - name: "vrf_id_t" - } - } - action_refs { - id: 24742814 - annotations: "@proto_id(1)" - } - const_default_action_id: 24742814 - size: 64 -} -tables { - preamble { - id: 33554500 - name: "ingress.routing.ipv4_table" - alias: "ipv4_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "vrf_id" - annotations: "@refers_to(vrf_table , vrf_id)" - match_type: EXACT - type_name { - name: "vrf_id_t" - } - } - match_fields { - id: 2 - name: "ipv4_dst" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: LPM - } - action_refs { - id: 16777222 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777221 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777220 - annotations: "@proto_id(3)" - } - action_refs { - id: 16777232 - annotations: "@proto_id(5)" - } - action_refs { - id: 16777233 - annotations: "@proto_id(6)" - } - action_refs { - id: 16777237 - annotations: "@proto_id(7)" - } - const_default_action_id: 16777222 - size: 32768 -} -tables { - preamble { - id: 33554501 - name: "ingress.routing.ipv6_table" - alias: "ipv6_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "vrf_id" - annotations: "@refers_to(vrf_table , vrf_id)" - match_type: EXACT - type_name { - name: "vrf_id_t" - } - } - match_fields { - id: 2 - name: "ipv6_dst" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 128 - match_type: LPM - } - action_refs { - id: 16777222 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777221 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777220 - annotations: "@proto_id(3)" - } - action_refs { - id: 16777232 - annotations: "@proto_id(5)" - } - action_refs { - id: 16777233 - annotations: "@proto_id(6)" - } - action_refs { - id: 16777237 - annotations: "@proto_id(7)" - } - const_default_action_id: 16777222 - size: 4096 -} -tables { - preamble { - id: 33554688 - name: "ingress.acl_ingress.acl_ingress_table" - alias: "acl_ingress_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@sai_acl(INGRESS)" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n ecn::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n\n\n\n\n // Only allow icmp_type matches for ICMP packets\n icmp_type::mask != 0 -> ip_protocol == 1;\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" - } - match_fields { - id: 1 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 2 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 3 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 4 - name: "ether_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 5 - name: "dst_mac" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_MAC)" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 6 - name: "src_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 7 - name: "dst_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 8 - name: "src_ipv6" - annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6_WORD2 ))" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 64 - match_type: TERNARY - } - match_fields { - id: 9 - name: "dst_ipv6" - annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD2 ))" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 64 - match_type: TERNARY - } - match_fields { - id: 10 - name: "ttl" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_TTL)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 11 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 12 - name: "ecn" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ECN)" - bitwidth: 2 - match_type: TERNARY - } - match_fields { - id: 13 - name: "ip_protocol" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 19 - name: "icmp_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 14 - name: "icmpv6_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_TYPE)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 20 - name: "l4_src_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 15 - name: "l4_dst_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 17 - name: "in_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IN_PORT)" - match_type: OPTIONAL - type_name { - name: "port_id_t" - } - } - match_fields { - id: 18 - name: "route_metadata" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META)" - bitwidth: 6 - match_type: OPTIONAL - } - action_refs { - id: 16777473 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777474 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777475 - annotations: "@proto_id(3)" - } - action_refs { - id: 16777476 - annotations: "@proto_id(4)" - } - action_refs { - id: 16777481 - annotations: "@proto_id(5)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767362 - direct_resource_ids: 352321792 - size: 255 -} -tables { - preamble { - id: 33554697 - name: "ingress.acl_ingress.acl_ingress_counting_table" - alias: "acl_ingress_counting_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@sai_acl(INGRESS)" - annotations: "@entry_restriction(\"\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" - } - match_fields { - id: 1 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 2 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 3 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 11 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 18 - name: "route_metadata" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META)" - bitwidth: 6 - match_type: TERNARY - } - action_refs { - id: 16777477 - annotations: "@proto_id(3)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767369 - size: 255 -} -tables { - preamble { - id: 33554502 - name: "ingress.mirroring_clone.mirror_session_table" - alias: "mirror_session_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "mirror_session_id" - match_type: EXACT - type_name { - name: "mirror_session_id_t" - } - } - action_refs { - id: 16777223 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 2 -} -tables { - preamble { - id: 33554504 - name: "ingress.mirroring_clone.mirror_port_to_pre_session_table" - alias: "mirror_port_to_pre_session_table" - annotations: "@p4runtime_role(\"packet_replication_engine_manager\")" - } - match_fields { - id: 1 - name: "mirror_port" - match_type: EXACT - type_name { - name: "port_id_t" - } - } - action_refs { - id: 16777225 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 1024 -} -tables { - preamble { - id: 33554692 - name: "egress.acl_egress.acl_egress_table" - alias: "acl_egress_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@sai_acl(EGRESS)" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" - } - match_fields { - id: 1 - name: "ether_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 2 - name: "ip_protocol" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 3 - name: "l4_dst_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 4 - name: "out_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT)" - match_type: OPTIONAL - type_name { - name: "port_id_t" - } - } - match_fields { - id: 5 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 6 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 7 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 8 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - action_refs { - id: 16777481 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767364 - size: 127 -} -actions { - preamble { - id: 21257015 - name: "NoAction" - alias: "NoAction" - annotations: "@noWarn(\"unused\")" - } -} -actions { - preamble { - id: 16777481 - name: "acl_drop" - alias: "acl_drop" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP)" - } -} -actions { - preamble { - id: 16777472 - name: "ingress.acl_pre_ingress.set_vrf" - alias: "set_vrf" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" - } - params { - id: 1 - name: "vrf_id" - annotations: "@sai_action_param(SAI_ACL_ENTRY_ATTR_ACTION_SET_VRF)" - annotations: "@refers_to(vrf_table , vrf_id)" - type_name { - name: "vrf_id_t" - } - } -} -actions { - preamble { - id: 16777224 - name: "ingress.l3_admit.admit_to_l3" - alias: "admit_to_l3" - } -} -actions { - preamble { - id: 17825802 - name: "ingress.hashing.select_ecmp_hash_algorithm" - alias: "select_ecmp_hash_algorithm" - annotations: "@sai_hash_algorithm(SAI_HASH_ALGORITHM_CRC_32HI)" - annotations: "@sai_hash_seed(0)" - annotations: "@sai_hash_offset(8)" - } -} -actions { - preamble { - id: 16777227 - name: "ingress.hashing.compute_ecmp_hash_ipv4" - alias: "compute_ecmp_hash_ipv4" - annotations: "@sai_ecmp_hash(SAI_SWITCH_ATTR_ECMP_HASH_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" - } -} -actions { - preamble { - id: 16777228 - name: "ingress.hashing.compute_ecmp_hash_ipv6" - alias: "compute_ecmp_hash_ipv6" - annotations: "@sai_ecmp_hash(SAI_SWITCH_ATTR_ECMP_HASH_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL)" - } -} -actions { - preamble { - id: 19711398 - name: "ingress.lag_hashing_config.select_lag_hash_algorithm" - alias: "select_lag_hash_algorithm" - annotations: "@sai_hash_algorithm(SAI_HASH_ALGORITHM_CRC)" - annotations: "@sai_hash_seed(0)" - annotations: "@sai_hash_offset(7)" - } -} -actions { - preamble { - id: 16777229 - name: "ingress.lag_hashing_config.compute_lag_hash_ipv4" - alias: "compute_lag_hash_ipv4" - annotations: "@sai_lag_hash(SAI_SWITCH_ATTR_LAG_HASH_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" - } -} -actions { - preamble { - id: 16777230 - name: "ingress.lag_hashing_config.compute_lag_hash_ipv6" - alias: "compute_lag_hash_ipv6" - annotations: "@sai_lag_hash(SAI_SWITCH_ATTR_LAG_HASH_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL)" - } -} -actions { - preamble { - id: 16777217 - name: "ingress.routing.set_dst_mac" - alias: "set_dst_mac" - } - params { - id: 1 - name: "dst_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } -} -actions { - preamble { - id: 16777218 - name: "ingress.routing.set_port_and_src_mac" - alias: "set_port_and_src_mac" - } - params { - id: 1 - name: "port" - type_name { - name: "port_id_t" - } - } - params { - id: 2 - name: "src_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } -} -actions { - preamble { - id: 16777235 - name: "ingress.routing.mark_for_p2p_tunnel_encap" - alias: "mark_for_p2p_tunnel_encap" - } - params { - id: 1 - name: "encap_src_ip" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 128 - } - params { - id: 2 - name: "encap_dst_ip" - annotations: "@format(IPV6_ADDRESS)" - annotations: "@refers_to(neighbor_table , neighbor_id)" - bitwidth: 128 - } - params { - id: 3 - name: "router_interface_id" - annotations: "@refers_to(neighbor_table , router_interface_id)" - annotations: "@refers_to(router_interface_table , router_interface_id)" - type_name { - name: "router_interface_id_t" - } - } -} -actions { - preamble { - id: 16777236 - name: "ingress.routing.set_ip_nexthop" - alias: "set_ip_nexthop" - } - params { - id: 1 - name: "router_interface_id" - annotations: "@refers_to(router_interface_table , router_interface_id)" - annotations: "@refers_to(neighbor_table , router_interface_id)" - type_name { - name: "router_interface_id_t" - } - } - params { - id: 2 - name: "neighbor_id" - annotations: "@format(IPV6_ADDRESS)" - annotations: "@refers_to(neighbor_table , neighbor_id)" - bitwidth: 128 - } -} -actions { - preamble { - id: 16777219 - name: "ingress.routing.set_nexthop" - alias: "set_nexthop" - annotations: "@deprecated(\"Use set_ip_nexthop instead.\")" - } - params { - id: 1 - name: "router_interface_id" - annotations: "@refers_to(router_interface_table , router_interface_id)" - annotations: "@refers_to(neighbor_table , router_interface_id)" - type_name { - name: "router_interface_id_t" - } - } - params { - id: 2 - name: "neighbor_id" - annotations: "@format(IPV6_ADDRESS)" - annotations: "@refers_to(neighbor_table , neighbor_id)" - bitwidth: 128 - } -} -actions { - preamble { - id: 16777234 - name: "ingress.routing.set_p2p_tunnel_encap_nexthop" - alias: "set_p2p_tunnel_encap_nexthop" - } - params { - id: 1 - name: "tunnel_id" - annotations: "@refers_to(tunnel_table , tunnel_id)" - type_name { - name: "tunnel_id_t" - } - } -} -actions { - preamble { - id: 16777221 - name: "ingress.routing.set_nexthop_id" - alias: "set_nexthop_id" - } - params { - id: 1 - name: "nexthop_id" - annotations: "@refers_to(nexthop_table , nexthop_id)" - type_name { - name: "nexthop_id_t" - } - } -} -actions { - preamble { - id: 16777232 - name: "ingress.routing.set_nexthop_id_and_metadata" - alias: "set_nexthop_id_and_metadata" - } - params { - id: 1 - name: "nexthop_id" - annotations: "@refers_to(nexthop_table , nexthop_id)" - type_name { - name: "nexthop_id_t" - } - } - params { - id: 2 - name: "route_metadata" - bitwidth: 6 - } -} -actions { - preamble { - id: 24742814 - name: "ingress.routing.no_action" - alias: "no_action" - } -} -actions { - preamble { - id: 16777222 - name: "ingress.routing.drop" - alias: "drop" - } -} -actions { - preamble { - id: 16777220 - name: "ingress.routing.set_wcmp_group_id" - alias: "set_wcmp_group_id" - } - params { - id: 1 - name: "wcmp_group_id" - annotations: "@refers_to(wcmp_group_table , wcmp_group_id)" - type_name { - name: "wcmp_group_id_t" - } - } -} -actions { - preamble { - id: 16777233 - name: "ingress.routing.set_wcmp_group_id_and_metadata" - alias: "set_wcmp_group_id_and_metadata" - } - params { - id: 1 - name: "wcmp_group_id" - annotations: "@refers_to(wcmp_group_table , wcmp_group_id)" - type_name { - name: "wcmp_group_id_t" - } - } - params { - id: 2 - name: "route_metadata" - bitwidth: 6 - } -} -actions { - preamble { - id: 16777237 - name: "ingress.routing.set_metadata_and_drop" - alias: "set_metadata_and_drop" - } - params { - id: 1 - name: "route_metadata" - bitwidth: 6 - } -} -actions { - preamble { - id: 16777473 - name: "ingress.acl_ingress.acl_copy" - alias: "acl_copy" - annotations: "@sai_action(SAI_PACKET_ACTION_COPY , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_RED)" - } - params { - id: 1 - name: "qos_queue" - annotations: "@sai_action_param(QOS_QUEUE)" - type_name { - name: "qos_queue_t" - } - } -} -actions { - preamble { - id: 16777474 - name: "ingress.acl_ingress.acl_trap" - alias: "acl_trap" - annotations: "@sai_action(SAI_PACKET_ACTION_TRAP , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" - } - params { - id: 1 - name: "qos_queue" - annotations: "@sai_action_param(QOS_QUEUE)" - type_name { - name: "qos_queue_t" - } - } -} -actions { - preamble { - id: 16777475 - name: "ingress.acl_ingress.acl_forward" - alias: "acl_forward" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" - } -} -actions { - preamble { - id: 16777477 - name: "ingress.acl_ingress.acl_count" - alias: "acl_count" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" - } -} -actions { - preamble { - id: 16777476 - name: "ingress.acl_ingress.acl_mirror" - alias: "acl_mirror" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" - } - params { - id: 1 - name: "mirror_session_id" - annotations: "@refers_to(mirror_session_table , mirror_session_id)" - annotations: "@sai_action_param(SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS)" - type_name { - name: "mirror_session_id_t" - } - } -} -actions { - preamble { - id: 16777223 - name: "ingress.mirroring_clone.mirror_as_ipv4_erspan" - alias: "mirror_as_ipv4_erspan" - } - params { - id: 1 - name: "port" - type_name { - name: "port_id_t" - } - } - params { - id: 2 - name: "src_ip" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - } - params { - id: 3 - name: "dst_ip" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - } - params { - id: 4 - name: "src_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } - params { - id: 5 - name: "dst_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } - params { - id: 6 - name: "ttl" - bitwidth: 8 - } - params { - id: 7 - name: "tos" - bitwidth: 8 - } -} -actions { - preamble { - id: 16777225 - name: "ingress.mirroring_clone.set_pre_session" - alias: "set_pre_session" - } - params { - id: 1 - name: "id" - bitwidth: 32 - } -} -action_profiles { - preamble { - id: 299650760 - name: "ingress.routing.wcmp_group_selector" - alias: "wcmp_group_selector" - } - table_ids: 33554499 - with_selector: true - size: 49152 - max_group_size: 512 -} -direct_counters { - preamble { - id: 318767361 - name: "ingress.acl_pre_ingress.acl_pre_ingress_counter" - alias: "acl_pre_ingress_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554689 -} -direct_counters { - preamble { - id: 318767362 - name: "ingress.acl_ingress.acl_ingress_counter" - alias: "acl_ingress_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554688 -} -direct_counters { - preamble { - id: 318767369 - name: "ingress.acl_ingress.acl_ingress_counting_counter" - alias: "acl_ingress_counting_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554697 -} -direct_counters { - preamble { - id: 318767364 - name: "egress.acl_egress.acl_egress_counter" - alias: "acl_egress_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554692 -} -direct_meters { - preamble { - id: 352321792 - name: "ingress.acl_ingress.acl_ingress_meter" - alias: "acl_ingress_meter" - } - spec { - unit: BYTES - } - direct_table_id: 33554688 -} -controller_packet_metadata { - preamble { - id: 81826293 - name: "packet_in" - alias: "packet_in" - annotations: "@controller_header(\"packet_in\")" - } - metadata { - id: 1 - name: "ingress_port" - type_name { - name: "port_id_t" - } - } - metadata { - id: 2 - name: "target_egress_port" - type_name { - name: "port_id_t" - } - } -} -controller_packet_metadata { - preamble { - id: 76689799 - name: "packet_out" - alias: "packet_out" - annotations: "@controller_header(\"packet_out\")" - } - metadata { - id: 1 - name: "egress_port" - type_name { - name: "port_id_t" - } - } - metadata { - id: 2 - name: "submit_to_ingress" - bitwidth: 1 - } - metadata { - id: 3 - name: "unused_pad" - annotations: "@padding" - bitwidth: 6 - } -} -type_info { - new_types { - key: "mirror_session_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "nexthop_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "port_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "qos_queue_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "router_interface_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "tunnel_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "vrf_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "wcmp_group_id_t" - value { - translated_type { - sdn_string { - } - } - } - } -} diff --git a/sai_p4/instantiations/google/fabric_border_router_with_s3_hash_profile.p4info.pb.txt b/sai_p4/instantiations/google/fabric_border_router_with_s3_hash_profile.p4info.pb.txt deleted file mode 100644 index d0a5c19c..00000000 --- a/sai_p4/instantiations/google/fabric_border_router_with_s3_hash_profile.p4info.pb.txt +++ /dev/null @@ -1,1426 +0,0 @@ -pkg_info { - name: "fabric_border_router_with_s3_hash_profile.p4" - version: "1.3.0" - arch: "v1model" - organization: "Google" -} -tables { - preamble { - id: 33554689 - name: "ingress.acl_pre_ingress.acl_pre_ingress_table" - alias: "acl_pre_ingress_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@sai_acl(PRE_INGRESS)" - annotations: "@entry_restriction(\"\n // Only allow IP field matches for IP packets.\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n // Reserve high priorities for switch-internal use.\n // TODO: Remove once inband workaround is obsolete.\n ::priority < 0x7fffffff;\n \")" - } - match_fields { - id: 1 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 2 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 3 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 4 - name: "src_mac" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC)" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 9 - name: "dst_mac" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_MAC)" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 5 - name: "dst_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 6 - name: "dst_ipv6" - annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD2 ))" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 64 - match_type: TERNARY - } - match_fields { - id: 7 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 8 - name: "in_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IN_PORT)" - match_type: OPTIONAL - type_name { - name: "port_id_t" - } - } - action_refs { - id: 16777472 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767361 - size: 254 -} -tables { - preamble { - id: 33554503 - name: "ingress.l3_admit.l3_admit_table" - alias: "l3_admit_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "dst_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 2 - name: "in_port" - match_type: OPTIONAL - type_name { - name: "port_id_t" - } - } - action_refs { - id: 16777224 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 128 -} -tables { - preamble { - id: 33554496 - name: "ingress.routing.neighbor_table" - alias: "neighbor_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "router_interface_id" - annotations: "@refers_to(router_interface_table , router_interface_id)" - match_type: EXACT - type_name { - name: "router_interface_id_t" - } - } - match_fields { - id: 2 - name: "neighbor_id" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 128 - match_type: EXACT - } - action_refs { - id: 16777217 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 1024 -} -tables { - preamble { - id: 33554497 - name: "ingress.routing.router_interface_table" - alias: "router_interface_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "router_interface_id" - match_type: EXACT - type_name { - name: "router_interface_id_t" - } - } - action_refs { - id: 16777218 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 256 -} -tables { - preamble { - id: 33554512 - name: "ingress.routing.tunnel_table" - alias: "tunnel_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "tunnel_id" - match_type: EXACT - type_name { - name: "tunnel_id_t" - } - } - action_refs { - id: 16777235 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 512 -} -tables { - preamble { - id: 33554498 - name: "ingress.routing.nexthop_table" - alias: "nexthop_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "nexthop_id" - match_type: EXACT - type_name { - name: "nexthop_id_t" - } - } - action_refs { - id: 16777219 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777234 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777236 - annotations: "@proto_id(3)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 1024 -} -tables { - preamble { - id: 33554499 - name: "ingress.routing.wcmp_group_table" - alias: "wcmp_group_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@oneshot" - } - match_fields { - id: 1 - name: "wcmp_group_id" - match_type: EXACT - type_name { - name: "wcmp_group_id_t" - } - } - action_refs { - id: 16777221 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - implementation_id: 299650760 - size: 3968 -} -tables { - preamble { - id: 33554506 - name: "ingress.routing.vrf_table" - alias: "vrf_table" - annotations: "@entry_restriction(\"\n // The VRF ID 0 (or \'\' in P4Runtime) encodes the default VRF, which cannot\n // be read or written via this table, but is always present implicitly.\n // TODO: This constraint should read `vrf_id != \'\'` (since\n // constraints are a control plane (P4Runtime) concept), but\n // p4-constraints does not currently support strings.\n vrf_id != 0;\n \")" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "vrf_id" - match_type: EXACT - type_name { - name: "vrf_id_t" - } - } - action_refs { - id: 24742814 - annotations: "@proto_id(1)" - } - const_default_action_id: 24742814 - size: 64 -} -tables { - preamble { - id: 33554500 - name: "ingress.routing.ipv4_table" - alias: "ipv4_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "vrf_id" - annotations: "@refers_to(vrf_table , vrf_id)" - match_type: EXACT - type_name { - name: "vrf_id_t" - } - } - match_fields { - id: 2 - name: "ipv4_dst" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: LPM - } - action_refs { - id: 16777222 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777221 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777220 - annotations: "@proto_id(3)" - } - action_refs { - id: 16777232 - annotations: "@proto_id(5)" - } - action_refs { - id: 16777233 - annotations: "@proto_id(6)" - } - action_refs { - id: 16777237 - annotations: "@proto_id(7)" - } - const_default_action_id: 16777222 - size: 32768 -} -tables { - preamble { - id: 33554501 - name: "ingress.routing.ipv6_table" - alias: "ipv6_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "vrf_id" - annotations: "@refers_to(vrf_table , vrf_id)" - match_type: EXACT - type_name { - name: "vrf_id_t" - } - } - match_fields { - id: 2 - name: "ipv6_dst" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 128 - match_type: LPM - } - action_refs { - id: 16777222 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777221 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777220 - annotations: "@proto_id(3)" - } - action_refs { - id: 16777232 - annotations: "@proto_id(5)" - } - action_refs { - id: 16777233 - annotations: "@proto_id(6)" - } - action_refs { - id: 16777237 - annotations: "@proto_id(7)" - } - const_default_action_id: 16777222 - size: 4096 -} -tables { - preamble { - id: 33554688 - name: "ingress.acl_ingress.acl_ingress_table" - alias: "acl_ingress_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@sai_acl(INGRESS)" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n ecn::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n\n\n\n\n // Only allow icmp_type matches for ICMP packets\n icmp_type::mask != 0 -> ip_protocol == 1;\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" - } - match_fields { - id: 1 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 2 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 3 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 4 - name: "ether_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 5 - name: "dst_mac" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_MAC)" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 6 - name: "src_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 7 - name: "dst_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 8 - name: "src_ipv6" - annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6_WORD2 ))" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 64 - match_type: TERNARY - } - match_fields { - id: 9 - name: "dst_ipv6" - annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD2 ))" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 64 - match_type: TERNARY - } - match_fields { - id: 10 - name: "ttl" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_TTL)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 11 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 12 - name: "ecn" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ECN)" - bitwidth: 2 - match_type: TERNARY - } - match_fields { - id: 13 - name: "ip_protocol" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 19 - name: "icmp_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 14 - name: "icmpv6_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_TYPE)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 20 - name: "l4_src_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 15 - name: "l4_dst_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 17 - name: "in_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IN_PORT)" - match_type: OPTIONAL - type_name { - name: "port_id_t" - } - } - match_fields { - id: 18 - name: "route_metadata" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META)" - bitwidth: 6 - match_type: OPTIONAL - } - action_refs { - id: 16777473 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777474 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777475 - annotations: "@proto_id(3)" - } - action_refs { - id: 16777476 - annotations: "@proto_id(4)" - } - action_refs { - id: 16777481 - annotations: "@proto_id(5)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767362 - direct_resource_ids: 352321792 - size: 255 -} -tables { - preamble { - id: 33554697 - name: "ingress.acl_ingress.acl_ingress_counting_table" - alias: "acl_ingress_counting_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@sai_acl(INGRESS)" - annotations: "@entry_restriction(\"\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" - } - match_fields { - id: 1 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 2 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 3 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 11 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 18 - name: "route_metadata" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META)" - bitwidth: 6 - match_type: TERNARY - } - action_refs { - id: 16777477 - annotations: "@proto_id(3)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767369 - size: 255 -} -tables { - preamble { - id: 33554502 - name: "ingress.mirroring_clone.mirror_session_table" - alias: "mirror_session_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "mirror_session_id" - match_type: EXACT - type_name { - name: "mirror_session_id_t" - } - } - action_refs { - id: 16777223 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 2 -} -tables { - preamble { - id: 33554504 - name: "ingress.mirroring_clone.mirror_port_to_pre_session_table" - alias: "mirror_port_to_pre_session_table" - annotations: "@p4runtime_role(\"packet_replication_engine_manager\")" - } - match_fields { - id: 1 - name: "mirror_port" - match_type: EXACT - type_name { - name: "port_id_t" - } - } - action_refs { - id: 16777225 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 1024 -} -tables { - preamble { - id: 33554692 - name: "egress.acl_egress.acl_egress_table" - alias: "acl_egress_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@sai_acl(EGRESS)" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" - } - match_fields { - id: 1 - name: "ether_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 2 - name: "ip_protocol" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 3 - name: "l4_dst_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 4 - name: "out_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT)" - match_type: OPTIONAL - type_name { - name: "port_id_t" - } - } - match_fields { - id: 5 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 6 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 7 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 8 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - action_refs { - id: 16777481 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767364 - size: 127 -} -actions { - preamble { - id: 21257015 - name: "NoAction" - alias: "NoAction" - annotations: "@noWarn(\"unused\")" - } -} -actions { - preamble { - id: 16777481 - name: "acl_drop" - alias: "acl_drop" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP)" - } -} -actions { - preamble { - id: 16777472 - name: "ingress.acl_pre_ingress.set_vrf" - alias: "set_vrf" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" - } - params { - id: 1 - name: "vrf_id" - annotations: "@sai_action_param(SAI_ACL_ENTRY_ATTR_ACTION_SET_VRF)" - annotations: "@refers_to(vrf_table , vrf_id)" - type_name { - name: "vrf_id_t" - } - } -} -actions { - preamble { - id: 16777224 - name: "ingress.l3_admit.admit_to_l3" - alias: "admit_to_l3" - } -} -actions { - preamble { - id: 17825802 - name: "ingress.hashing.select_ecmp_hash_algorithm" - alias: "select_ecmp_hash_algorithm" - annotations: "@sai_hash_algorithm(SAI_HASH_ALGORITHM_CRC_32LO)" - annotations: "@sai_hash_seed(0)" - annotations: "@sai_hash_offset(0)" - } -} -actions { - preamble { - id: 16777227 - name: "ingress.hashing.compute_ecmp_hash_ipv4" - alias: "compute_ecmp_hash_ipv4" - annotations: "@sai_ecmp_hash(SAI_SWITCH_ATTR_ECMP_HASH_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" - } -} -actions { - preamble { - id: 16777228 - name: "ingress.hashing.compute_ecmp_hash_ipv6" - alias: "compute_ecmp_hash_ipv6" - annotations: "@sai_ecmp_hash(SAI_SWITCH_ATTR_ECMP_HASH_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL)" - } -} -actions { - preamble { - id: 19711398 - name: "ingress.lag_hashing_config.select_lag_hash_algorithm" - alias: "select_lag_hash_algorithm" - annotations: "@sai_hash_algorithm(SAI_HASH_ALGORITHM_CRC)" - annotations: "@sai_hash_seed(0)" - annotations: "@sai_hash_offset(7)" - } -} -actions { - preamble { - id: 16777229 - name: "ingress.lag_hashing_config.compute_lag_hash_ipv4" - alias: "compute_lag_hash_ipv4" - annotations: "@sai_lag_hash(SAI_SWITCH_ATTR_LAG_HASH_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" - } -} -actions { - preamble { - id: 16777230 - name: "ingress.lag_hashing_config.compute_lag_hash_ipv6" - alias: "compute_lag_hash_ipv6" - annotations: "@sai_lag_hash(SAI_SWITCH_ATTR_LAG_HASH_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL)" - } -} -actions { - preamble { - id: 16777217 - name: "ingress.routing.set_dst_mac" - alias: "set_dst_mac" - } - params { - id: 1 - name: "dst_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } -} -actions { - preamble { - id: 16777218 - name: "ingress.routing.set_port_and_src_mac" - alias: "set_port_and_src_mac" - } - params { - id: 1 - name: "port" - type_name { - name: "port_id_t" - } - } - params { - id: 2 - name: "src_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } -} -actions { - preamble { - id: 16777235 - name: "ingress.routing.mark_for_p2p_tunnel_encap" - alias: "mark_for_p2p_tunnel_encap" - } - params { - id: 1 - name: "encap_src_ip" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 128 - } - params { - id: 2 - name: "encap_dst_ip" - annotations: "@format(IPV6_ADDRESS)" - annotations: "@refers_to(neighbor_table , neighbor_id)" - bitwidth: 128 - } - params { - id: 3 - name: "router_interface_id" - annotations: "@refers_to(neighbor_table , router_interface_id)" - annotations: "@refers_to(router_interface_table , router_interface_id)" - type_name { - name: "router_interface_id_t" - } - } -} -actions { - preamble { - id: 16777236 - name: "ingress.routing.set_ip_nexthop" - alias: "set_ip_nexthop" - } - params { - id: 1 - name: "router_interface_id" - annotations: "@refers_to(router_interface_table , router_interface_id)" - annotations: "@refers_to(neighbor_table , router_interface_id)" - type_name { - name: "router_interface_id_t" - } - } - params { - id: 2 - name: "neighbor_id" - annotations: "@format(IPV6_ADDRESS)" - annotations: "@refers_to(neighbor_table , neighbor_id)" - bitwidth: 128 - } -} -actions { - preamble { - id: 16777219 - name: "ingress.routing.set_nexthop" - alias: "set_nexthop" - annotations: "@deprecated(\"Use set_ip_nexthop instead.\")" - } - params { - id: 1 - name: "router_interface_id" - annotations: "@refers_to(router_interface_table , router_interface_id)" - annotations: "@refers_to(neighbor_table , router_interface_id)" - type_name { - name: "router_interface_id_t" - } - } - params { - id: 2 - name: "neighbor_id" - annotations: "@format(IPV6_ADDRESS)" - annotations: "@refers_to(neighbor_table , neighbor_id)" - bitwidth: 128 - } -} -actions { - preamble { - id: 16777234 - name: "ingress.routing.set_p2p_tunnel_encap_nexthop" - alias: "set_p2p_tunnel_encap_nexthop" - } - params { - id: 1 - name: "tunnel_id" - annotations: "@refers_to(tunnel_table , tunnel_id)" - type_name { - name: "tunnel_id_t" - } - } -} -actions { - preamble { - id: 16777221 - name: "ingress.routing.set_nexthop_id" - alias: "set_nexthop_id" - } - params { - id: 1 - name: "nexthop_id" - annotations: "@refers_to(nexthop_table , nexthop_id)" - type_name { - name: "nexthop_id_t" - } - } -} -actions { - preamble { - id: 16777232 - name: "ingress.routing.set_nexthop_id_and_metadata" - alias: "set_nexthop_id_and_metadata" - } - params { - id: 1 - name: "nexthop_id" - annotations: "@refers_to(nexthop_table , nexthop_id)" - type_name { - name: "nexthop_id_t" - } - } - params { - id: 2 - name: "route_metadata" - bitwidth: 6 - } -} -actions { - preamble { - id: 24742814 - name: "ingress.routing.no_action" - alias: "no_action" - } -} -actions { - preamble { - id: 16777222 - name: "ingress.routing.drop" - alias: "drop" - } -} -actions { - preamble { - id: 16777220 - name: "ingress.routing.set_wcmp_group_id" - alias: "set_wcmp_group_id" - } - params { - id: 1 - name: "wcmp_group_id" - annotations: "@refers_to(wcmp_group_table , wcmp_group_id)" - type_name { - name: "wcmp_group_id_t" - } - } -} -actions { - preamble { - id: 16777233 - name: "ingress.routing.set_wcmp_group_id_and_metadata" - alias: "set_wcmp_group_id_and_metadata" - } - params { - id: 1 - name: "wcmp_group_id" - annotations: "@refers_to(wcmp_group_table , wcmp_group_id)" - type_name { - name: "wcmp_group_id_t" - } - } - params { - id: 2 - name: "route_metadata" - bitwidth: 6 - } -} -actions { - preamble { - id: 16777237 - name: "ingress.routing.set_metadata_and_drop" - alias: "set_metadata_and_drop" - } - params { - id: 1 - name: "route_metadata" - bitwidth: 6 - } -} -actions { - preamble { - id: 16777473 - name: "ingress.acl_ingress.acl_copy" - alias: "acl_copy" - annotations: "@sai_action(SAI_PACKET_ACTION_COPY , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_RED)" - } - params { - id: 1 - name: "qos_queue" - annotations: "@sai_action_param(QOS_QUEUE)" - type_name { - name: "qos_queue_t" - } - } -} -actions { - preamble { - id: 16777474 - name: "ingress.acl_ingress.acl_trap" - alias: "acl_trap" - annotations: "@sai_action(SAI_PACKET_ACTION_TRAP , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" - } - params { - id: 1 - name: "qos_queue" - annotations: "@sai_action_param(QOS_QUEUE)" - type_name { - name: "qos_queue_t" - } - } -} -actions { - preamble { - id: 16777475 - name: "ingress.acl_ingress.acl_forward" - alias: "acl_forward" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" - } -} -actions { - preamble { - id: 16777477 - name: "ingress.acl_ingress.acl_count" - alias: "acl_count" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" - } -} -actions { - preamble { - id: 16777476 - name: "ingress.acl_ingress.acl_mirror" - alias: "acl_mirror" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" - } - params { - id: 1 - name: "mirror_session_id" - annotations: "@refers_to(mirror_session_table , mirror_session_id)" - annotations: "@sai_action_param(SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS)" - type_name { - name: "mirror_session_id_t" - } - } -} -actions { - preamble { - id: 16777223 - name: "ingress.mirroring_clone.mirror_as_ipv4_erspan" - alias: "mirror_as_ipv4_erspan" - } - params { - id: 1 - name: "port" - type_name { - name: "port_id_t" - } - } - params { - id: 2 - name: "src_ip" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - } - params { - id: 3 - name: "dst_ip" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - } - params { - id: 4 - name: "src_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } - params { - id: 5 - name: "dst_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } - params { - id: 6 - name: "ttl" - bitwidth: 8 - } - params { - id: 7 - name: "tos" - bitwidth: 8 - } -} -actions { - preamble { - id: 16777225 - name: "ingress.mirroring_clone.set_pre_session" - alias: "set_pre_session" - } - params { - id: 1 - name: "id" - bitwidth: 32 - } -} -action_profiles { - preamble { - id: 299650760 - name: "ingress.routing.wcmp_group_selector" - alias: "wcmp_group_selector" - } - table_ids: 33554499 - with_selector: true - size: 49152 - max_group_size: 512 -} -direct_counters { - preamble { - id: 318767361 - name: "ingress.acl_pre_ingress.acl_pre_ingress_counter" - alias: "acl_pre_ingress_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554689 -} -direct_counters { - preamble { - id: 318767362 - name: "ingress.acl_ingress.acl_ingress_counter" - alias: "acl_ingress_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554688 -} -direct_counters { - preamble { - id: 318767369 - name: "ingress.acl_ingress.acl_ingress_counting_counter" - alias: "acl_ingress_counting_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554697 -} -direct_counters { - preamble { - id: 318767364 - name: "egress.acl_egress.acl_egress_counter" - alias: "acl_egress_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554692 -} -direct_meters { - preamble { - id: 352321792 - name: "ingress.acl_ingress.acl_ingress_meter" - alias: "acl_ingress_meter" - } - spec { - unit: BYTES - } - direct_table_id: 33554688 -} -controller_packet_metadata { - preamble { - id: 81826293 - name: "packet_in" - alias: "packet_in" - annotations: "@controller_header(\"packet_in\")" - } - metadata { - id: 1 - name: "ingress_port" - type_name { - name: "port_id_t" - } - } - metadata { - id: 2 - name: "target_egress_port" - type_name { - name: "port_id_t" - } - } -} -controller_packet_metadata { - preamble { - id: 76689799 - name: "packet_out" - alias: "packet_out" - annotations: "@controller_header(\"packet_out\")" - } - metadata { - id: 1 - name: "egress_port" - type_name { - name: "port_id_t" - } - } - metadata { - id: 2 - name: "submit_to_ingress" - bitwidth: 1 - } - metadata { - id: 3 - name: "unused_pad" - annotations: "@padding" - bitwidth: 6 - } -} -type_info { - new_types { - key: "mirror_session_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "nexthop_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "port_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "qos_queue_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "router_interface_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "tunnel_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "vrf_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "wcmp_group_id_t" - value { - translated_type { - sdn_string { - } - } - } - } -} diff --git a/sai_p4/instantiations/google/middleblock.p4 b/sai_p4/instantiations/google/middleblock.p4 index 07212e5c..1459b0d5 100644 --- a/sai_p4/instantiations/google/middleblock.p4 +++ b/sai_p4/instantiations/google/middleblock.p4 @@ -16,7 +16,8 @@ #include "../../fixed/mirroring_encap.p4" #include "../../fixed/mirroring_clone.p4" #include "../../fixed/l3_admit.p4" -#include "../../fixed/ttl.p4" +#include "../../fixed/vlan.p4" +#include "../../fixed/drop_martians.p4" #include "../../fixed/packet_rewrites.p4" #include "acl_ingress.p4" #include "acl_pre_ingress.p4" @@ -29,13 +30,17 @@ control ingress(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { apply { - acl_pre_ingress.apply(headers, local_metadata, standard_metadata); - admit_google_system_mac.apply(headers, local_metadata); - l3_admit.apply(headers, local_metadata, standard_metadata); - routing.apply(headers, local_metadata, standard_metadata); - acl_ingress.apply(headers, local_metadata, standard_metadata); - ttl.apply(headers, local_metadata, standard_metadata); - mirroring_clone.apply(headers, local_metadata, standard_metadata); + packet_out_decap.apply(headers, local_metadata, standard_metadata); + if (!local_metadata.bypass_ingress) { + vlan_untag.apply(headers, local_metadata, standard_metadata); + acl_pre_ingress.apply(headers, local_metadata, standard_metadata); + admit_google_system_mac.apply(headers, local_metadata); + l3_admit.apply(headers, local_metadata, standard_metadata); + routing.apply(headers, local_metadata, standard_metadata); + drop_martians.apply(headers, local_metadata, standard_metadata); + acl_ingress.apply(headers, local_metadata, standard_metadata); + mirroring_clone.apply(headers, local_metadata, standard_metadata); + } } } // control ingress diff --git a/sai_p4/instantiations/google/middleblock.p4info.pb.txt b/sai_p4/instantiations/google/middleblock.p4info.pb.txt index 21f6ad4c..20675bbd 100755 --- a/sai_p4/instantiations/google/middleblock.p4info.pb.txt +++ b/sai_p4/instantiations/google/middleblock.p4info.pb.txt @@ -1,6 +1,6 @@ pkg_info { name: "middleblock.p4" - version: "2.3.0" + version: "1.4.0" arch: "v1model" organization: "Google" } @@ -42,6 +42,14 @@ tables { bitwidth: 48 match_type: TERNARY } + match_fields { + id: 9 + name: "dst_mac" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_MAC)" + annotations: "@format(MAC_ADDRESS)" + bitwidth: 48 + match_type: TERNARY + } match_fields { id: 5 name: "dst_ip" @@ -373,6 +381,7 @@ tables { alias: "acl_ingress_table" annotations: "@p4runtime_role(\"sdn_controller\")" annotations: "@sai_acl(INGRESS)" + annotations: "@sai_acl_priority(5)" annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n ecn::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n // Only allow arp_tpa matches for ARP packets.\n arp_tpa::mask != 0 -> ether_type == 0x0806;\n\n\n\n\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" } match_fields { @@ -520,10 +529,6 @@ tables { id: 16777481 annotations: "@proto_id(5)" } - action_refs { - id: 16777625 - annotations: "@proto_id(99)" - } action_refs { id: 21257015 annotations: "@defaultonly" @@ -835,24 +840,6 @@ actions { } } } -actions { - preamble { - id: 16777625 - name: "ingress.acl_ingress.acl_experimental_trap" - alias: "acl_experimental_trap" - annotations: "@sai_action(SAI_PACKET_ACTION_TRAP , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" - } - params { - id: 1 - name: "qos_queue" - annotations: "@sai_action_param(QOS_QUEUE)" - type_name { - name: "qos_queue_t" - } - } -} actions { preamble { id: 16777475 diff --git a/sai_p4/instantiations/google/middleblock_with_s3_ecmp_profile.p4info.pb.txt b/sai_p4/instantiations/google/middleblock_with_s3_ecmp_profile.p4info.pb.txt deleted file mode 100644 index 7bddf363..00000000 --- a/sai_p4/instantiations/google/middleblock_with_s3_ecmp_profile.p4info.pb.txt +++ /dev/null @@ -1,1201 +0,0 @@ -pkg_info { - name: "middleblock_with_s3_ecmp_profile.p4" - version: "1.3.0" - arch: "v1model" - organization: "Google" -} -tables { - preamble { - id: 33554689 - name: "ingress.acl_pre_ingress.acl_pre_ingress_table" - alias: "acl_pre_ingress_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@sai_acl(PRE_INGRESS)" - annotations: "@entry_restriction(\"\n // Only allow IP field matches for IP packets.\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n // Reserve high priorities for switch-internal use.\n // TODO: Remove once inband workaround is obsolete.\n ::priority < 0x7fffffff;\n \")" - } - match_fields { - id: 1 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 2 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 3 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 4 - name: "src_mac" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC)" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 5 - name: "dst_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 6 - name: "dst_ipv6" - annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD2 ))" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 64 - match_type: TERNARY - } - match_fields { - id: 7 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 8 - name: "in_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IN_PORT)" - match_type: OPTIONAL - type_name { - name: "port_id_t" - } - } - action_refs { - id: 16777472 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767361 - size: 254 -} -tables { - preamble { - id: 33554503 - name: "ingress.l3_admit.l3_admit_table" - alias: "l3_admit_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "dst_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 2 - name: "in_port" - match_type: OPTIONAL - type_name { - name: "port_id_t" - } - } - action_refs { - id: 16777224 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 128 -} -tables { - preamble { - id: 33554496 - name: "ingress.routing.neighbor_table" - alias: "neighbor_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "router_interface_id" - annotations: "@refers_to(router_interface_table , router_interface_id)" - match_type: EXACT - type_name { - name: "router_interface_id_t" - } - } - match_fields { - id: 2 - name: "neighbor_id" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 128 - match_type: EXACT - } - action_refs { - id: 16777217 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 1024 -} -tables { - preamble { - id: 33554497 - name: "ingress.routing.router_interface_table" - alias: "router_interface_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "router_interface_id" - match_type: EXACT - type_name { - name: "router_interface_id_t" - } - } - action_refs { - id: 16777218 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 256 -} -tables { - preamble { - id: 33554512 - name: "ingress.routing.tunnel_table" - alias: "tunnel_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "tunnel_id" - match_type: EXACT - type_name { - name: "tunnel_id_t" - } - } - action_refs { - id: 16777235 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 512 -} -tables { - preamble { - id: 33554498 - name: "ingress.routing.nexthop_table" - alias: "nexthop_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "nexthop_id" - match_type: EXACT - type_name { - name: "nexthop_id_t" - } - } - action_refs { - id: 16777219 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777234 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777236 - annotations: "@proto_id(3)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 1024 -} -tables { - preamble { - id: 33554499 - name: "ingress.routing.wcmp_group_table" - alias: "wcmp_group_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@oneshot" - } - match_fields { - id: 1 - name: "wcmp_group_id" - match_type: EXACT - type_name { - name: "wcmp_group_id_t" - } - } - action_refs { - id: 16777221 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - implementation_id: 299650760 - size: 3968 -} -tables { - preamble { - id: 33554506 - name: "ingress.routing.vrf_table" - alias: "vrf_table" - annotations: "@entry_restriction(\"\n // The VRF ID 0 (or \'\' in P4Runtime) encodes the default VRF, which cannot\n // be read or written via this table, but is always present implicitly.\n // TODO: This constraint should read `vrf_id != \'\'` (since\n // constraints are a control plane (P4Runtime) concept), but\n // p4-constraints does not currently support strings.\n vrf_id != 0;\n \")" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "vrf_id" - match_type: EXACT - type_name { - name: "vrf_id_t" - } - } - action_refs { - id: 24742814 - annotations: "@proto_id(1)" - } - const_default_action_id: 24742814 - size: 64 -} -tables { - preamble { - id: 33554500 - name: "ingress.routing.ipv4_table" - alias: "ipv4_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "vrf_id" - annotations: "@refers_to(vrf_table , vrf_id)" - match_type: EXACT - type_name { - name: "vrf_id_t" - } - } - match_fields { - id: 2 - name: "ipv4_dst" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: LPM - } - action_refs { - id: 16777222 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777221 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777220 - annotations: "@proto_id(3)" - } - action_refs { - id: 16777232 - annotations: "@proto_id(5)" - } - action_refs { - id: 16777233 - annotations: "@proto_id(6)" - } - action_refs { - id: 16777237 - annotations: "@proto_id(7)" - } - const_default_action_id: 16777222 - size: 32768 -} -tables { - preamble { - id: 33554501 - name: "ingress.routing.ipv6_table" - alias: "ipv6_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "vrf_id" - annotations: "@refers_to(vrf_table , vrf_id)" - match_type: EXACT - type_name { - name: "vrf_id_t" - } - } - match_fields { - id: 2 - name: "ipv6_dst" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 128 - match_type: LPM - } - action_refs { - id: 16777222 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777221 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777220 - annotations: "@proto_id(3)" - } - action_refs { - id: 16777232 - annotations: "@proto_id(5)" - } - action_refs { - id: 16777233 - annotations: "@proto_id(6)" - } - action_refs { - id: 16777237 - annotations: "@proto_id(7)" - } - const_default_action_id: 16777222 - size: 4096 -} -tables { - preamble { - id: 33554688 - name: "ingress.acl_ingress.acl_ingress_table" - alias: "acl_ingress_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@sai_acl(INGRESS)" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n ecn::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n // Only allow arp_tpa matches for ARP packets.\n arp_tpa::mask != 0 -> ether_type == 0x0806;\n\n\n\n\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" - } - match_fields { - id: 1 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 2 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 3 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 4 - name: "ether_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 5 - name: "dst_mac" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_MAC)" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - match_type: TERNARY - } - match_fields { - id: 6 - name: "src_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 7 - name: "dst_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 8 - name: "src_ipv6" - annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6_WORD2 ))" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 64 - match_type: TERNARY - } - match_fields { - id: 9 - name: "dst_ipv6" - annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD2 ))" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 64 - match_type: TERNARY - } - match_fields { - id: 10 - name: "ttl" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_TTL)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 11 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 12 - name: "ecn" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ECN)" - bitwidth: 2 - match_type: TERNARY - } - match_fields { - id: 13 - name: "ip_protocol" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 14 - name: "icmpv6_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_TYPE)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 20 - name: "l4_src_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 15 - name: "l4_dst_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 16 - name: "arp_tpa" - annotations: "@composite_field(@ sai_udf ( base = SAI_UDF_BASE_L3 , offset = 24 , length = 2 ) , @ sai_udf ( base = SAI_UDF_BASE_L3 , offset = 26 , length = 2 ))" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - action_refs { - id: 16777473 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777474 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777475 - annotations: "@proto_id(3)" - } - action_refs { - id: 16777476 - annotations: "@proto_id(4)" - } - action_refs { - id: 16777481 - annotations: "@proto_id(5)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767362 - direct_resource_ids: 352321792 - size: 255 -} -tables { - preamble { - id: 33554502 - name: "ingress.mirroring_clone.mirror_session_table" - alias: "mirror_session_table" - annotations: "@p4runtime_role(\"sdn_controller\")" - } - match_fields { - id: 1 - name: "mirror_session_id" - match_type: EXACT - type_name { - name: "mirror_session_id_t" - } - } - action_refs { - id: 16777223 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 2 -} -tables { - preamble { - id: 33554504 - name: "ingress.mirroring_clone.mirror_port_to_pre_session_table" - alias: "mirror_port_to_pre_session_table" - annotations: "@p4runtime_role(\"packet_replication_engine_manager\")" - } - match_fields { - id: 1 - name: "mirror_port" - match_type: EXACT - type_name { - name: "port_id_t" - } - } - action_refs { - id: 16777225 - annotations: "@proto_id(1)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - size: 1024 -} -actions { - preamble { - id: 21257015 - name: "NoAction" - alias: "NoAction" - annotations: "@noWarn(\"unused\")" - } -} -actions { - preamble { - id: 16777481 - name: "acl_drop" - alias: "acl_drop" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP)" - } -} -actions { - preamble { - id: 16777472 - name: "ingress.acl_pre_ingress.set_vrf" - alias: "set_vrf" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" - } - params { - id: 1 - name: "vrf_id" - annotations: "@sai_action_param(SAI_ACL_ENTRY_ATTR_ACTION_SET_VRF)" - annotations: "@refers_to(vrf_table , vrf_id)" - type_name { - name: "vrf_id_t" - } - } -} -actions { - preamble { - id: 16777224 - name: "ingress.l3_admit.admit_to_l3" - alias: "admit_to_l3" - } -} -actions { - preamble { - id: 17825802 - name: "ingress.hashing.select_ecmp_hash_algorithm" - alias: "select_ecmp_hash_algorithm" - annotations: "@sai_hash_algorithm(SAI_HASH_ALGORITHM_CRC_CCITT)" - annotations: "@sai_hash_seed(0)" - annotations: "@sai_hash_offset(8)" - } -} -actions { - preamble { - id: 16777227 - name: "ingress.hashing.compute_ecmp_hash_ipv4" - alias: "compute_ecmp_hash_ipv4" - annotations: "@sai_ecmp_hash(SAI_SWITCH_ATTR_ECMP_HASH_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV4)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" - } -} -actions { - preamble { - id: 16777228 - name: "ingress.hashing.compute_ecmp_hash_ipv6" - alias: "compute_ecmp_hash_ipv6" - annotations: "@sai_ecmp_hash(SAI_SWITCH_ATTR_ECMP_HASH_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV6)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" - annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL)" - } -} -actions { - preamble { - id: 16777217 - name: "ingress.routing.set_dst_mac" - alias: "set_dst_mac" - } - params { - id: 1 - name: "dst_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } -} -actions { - preamble { - id: 16777218 - name: "ingress.routing.set_port_and_src_mac" - alias: "set_port_and_src_mac" - } - params { - id: 1 - name: "port" - type_name { - name: "port_id_t" - } - } - params { - id: 2 - name: "src_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } -} -actions { - preamble { - id: 16777235 - name: "ingress.routing.mark_for_p2p_tunnel_encap" - alias: "mark_for_p2p_tunnel_encap" - } - params { - id: 1 - name: "encap_src_ip" - annotations: "@format(IPV6_ADDRESS)" - bitwidth: 128 - } - params { - id: 2 - name: "encap_dst_ip" - annotations: "@format(IPV6_ADDRESS)" - annotations: "@refers_to(neighbor_table , neighbor_id)" - bitwidth: 128 - } - params { - id: 3 - name: "router_interface_id" - annotations: "@refers_to(neighbor_table , router_interface_id)" - annotations: "@refers_to(router_interface_table , router_interface_id)" - type_name { - name: "router_interface_id_t" - } - } -} -actions { - preamble { - id: 16777236 - name: "ingress.routing.set_ip_nexthop" - alias: "set_ip_nexthop" - } - params { - id: 1 - name: "router_interface_id" - annotations: "@refers_to(router_interface_table , router_interface_id)" - annotations: "@refers_to(neighbor_table , router_interface_id)" - type_name { - name: "router_interface_id_t" - } - } - params { - id: 2 - name: "neighbor_id" - annotations: "@format(IPV6_ADDRESS)" - annotations: "@refers_to(neighbor_table , neighbor_id)" - bitwidth: 128 - } -} -actions { - preamble { - id: 16777219 - name: "ingress.routing.set_nexthop" - alias: "set_nexthop" - annotations: "@deprecated(\"Use set_ip_nexthop instead.\")" - } - params { - id: 1 - name: "router_interface_id" - annotations: "@refers_to(router_interface_table , router_interface_id)" - annotations: "@refers_to(neighbor_table , router_interface_id)" - type_name { - name: "router_interface_id_t" - } - } - params { - id: 2 - name: "neighbor_id" - annotations: "@format(IPV6_ADDRESS)" - annotations: "@refers_to(neighbor_table , neighbor_id)" - bitwidth: 128 - } -} -actions { - preamble { - id: 16777234 - name: "ingress.routing.set_p2p_tunnel_encap_nexthop" - alias: "set_p2p_tunnel_encap_nexthop" - } - params { - id: 1 - name: "tunnel_id" - annotations: "@refers_to(tunnel_table , tunnel_id)" - type_name { - name: "tunnel_id_t" - } - } -} -actions { - preamble { - id: 16777221 - name: "ingress.routing.set_nexthop_id" - alias: "set_nexthop_id" - } - params { - id: 1 - name: "nexthop_id" - annotations: "@refers_to(nexthop_table , nexthop_id)" - type_name { - name: "nexthop_id_t" - } - } -} -actions { - preamble { - id: 16777232 - name: "ingress.routing.set_nexthop_id_and_metadata" - alias: "set_nexthop_id_and_metadata" - } - params { - id: 1 - name: "nexthop_id" - annotations: "@refers_to(nexthop_table , nexthop_id)" - type_name { - name: "nexthop_id_t" - } - } - params { - id: 2 - name: "route_metadata" - bitwidth: 6 - } -} -actions { - preamble { - id: 24742814 - name: "ingress.routing.no_action" - alias: "no_action" - } -} -actions { - preamble { - id: 16777222 - name: "ingress.routing.drop" - alias: "drop" - } -} -actions { - preamble { - id: 16777220 - name: "ingress.routing.set_wcmp_group_id" - alias: "set_wcmp_group_id" - } - params { - id: 1 - name: "wcmp_group_id" - annotations: "@refers_to(wcmp_group_table , wcmp_group_id)" - type_name { - name: "wcmp_group_id_t" - } - } -} -actions { - preamble { - id: 16777233 - name: "ingress.routing.set_wcmp_group_id_and_metadata" - alias: "set_wcmp_group_id_and_metadata" - } - params { - id: 1 - name: "wcmp_group_id" - annotations: "@refers_to(wcmp_group_table , wcmp_group_id)" - type_name { - name: "wcmp_group_id_t" - } - } - params { - id: 2 - name: "route_metadata" - bitwidth: 6 - } -} -actions { - preamble { - id: 16777237 - name: "ingress.routing.set_metadata_and_drop" - alias: "set_metadata_and_drop" - } - params { - id: 1 - name: "route_metadata" - bitwidth: 6 - } -} -actions { - preamble { - id: 16777473 - name: "ingress.acl_ingress.acl_copy" - alias: "acl_copy" - annotations: "@sai_action(SAI_PACKET_ACTION_COPY , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_RED)" - } - params { - id: 1 - name: "qos_queue" - annotations: "@sai_action_param(QOS_QUEUE)" - type_name { - name: "qos_queue_t" - } - } -} -actions { - preamble { - id: 16777474 - name: "ingress.acl_ingress.acl_trap" - alias: "acl_trap" - annotations: "@sai_action(SAI_PACKET_ACTION_TRAP , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" - } - params { - id: 1 - name: "qos_queue" - annotations: "@sai_action_param(QOS_QUEUE)" - type_name { - name: "qos_queue_t" - } - } -} -actions { - preamble { - id: 16777475 - name: "ingress.acl_ingress.acl_forward" - alias: "acl_forward" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" - } -} -actions { - preamble { - id: 16777476 - name: "ingress.acl_ingress.acl_mirror" - alias: "acl_mirror" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" - } - params { - id: 1 - name: "mirror_session_id" - annotations: "@refers_to(mirror_session_table , mirror_session_id)" - annotations: "@sai_action_param(SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS)" - type_name { - name: "mirror_session_id_t" - } - } -} -actions { - preamble { - id: 16777223 - name: "ingress.mirroring_clone.mirror_as_ipv4_erspan" - alias: "mirror_as_ipv4_erspan" - } - params { - id: 1 - name: "port" - type_name { - name: "port_id_t" - } - } - params { - id: 2 - name: "src_ip" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - } - params { - id: 3 - name: "dst_ip" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - } - params { - id: 4 - name: "src_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } - params { - id: 5 - name: "dst_mac" - annotations: "@format(MAC_ADDRESS)" - bitwidth: 48 - } - params { - id: 6 - name: "ttl" - bitwidth: 8 - } - params { - id: 7 - name: "tos" - bitwidth: 8 - } -} -actions { - preamble { - id: 16777225 - name: "ingress.mirroring_clone.set_pre_session" - alias: "set_pre_session" - } - params { - id: 1 - name: "id" - bitwidth: 32 - } -} -action_profiles { - preamble { - id: 299650760 - name: "ingress.routing.wcmp_group_selector" - alias: "wcmp_group_selector" - } - table_ids: 33554499 - with_selector: true - size: 49152 - max_group_size: 512 -} -direct_counters { - preamble { - id: 318767361 - name: "ingress.acl_pre_ingress.acl_pre_ingress_counter" - alias: "acl_pre_ingress_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554689 -} -direct_counters { - preamble { - id: 318767362 - name: "ingress.acl_ingress.acl_ingress_counter" - alias: "acl_ingress_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554688 -} -direct_meters { - preamble { - id: 352321792 - name: "ingress.acl_ingress.acl_ingress_meter" - alias: "acl_ingress_meter" - } - spec { - unit: BYTES - } - direct_table_id: 33554688 -} -controller_packet_metadata { - preamble { - id: 81826293 - name: "packet_in" - alias: "packet_in" - annotations: "@controller_header(\"packet_in\")" - } - metadata { - id: 1 - name: "ingress_port" - type_name { - name: "port_id_t" - } - } - metadata { - id: 2 - name: "target_egress_port" - type_name { - name: "port_id_t" - } - } -} -controller_packet_metadata { - preamble { - id: 76689799 - name: "packet_out" - alias: "packet_out" - annotations: "@controller_header(\"packet_out\")" - } - metadata { - id: 1 - name: "egress_port" - type_name { - name: "port_id_t" - } - } - metadata { - id: 2 - name: "submit_to_ingress" - bitwidth: 1 - } - metadata { - id: 3 - name: "unused_pad" - annotations: "@padding" - bitwidth: 6 - } -} -type_info { - new_types { - key: "mirror_session_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "nexthop_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "port_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "qos_queue_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "router_interface_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "tunnel_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "vrf_id_t" - value { - translated_type { - sdn_string { - } - } - } - } - new_types { - key: "wcmp_group_id_t" - value { - translated_type { - sdn_string { - } - } - } - } -} diff --git a/sai_p4/instantiations/google/minimum_guaranteed_sizes.p4 b/sai_p4/instantiations/google/minimum_guaranteed_sizes.p4 index 75edd010..f86d964f 100644 --- a/sai_p4/instantiations/google/minimum_guaranteed_sizes.p4 +++ b/sai_p4/instantiations/google/minimum_guaranteed_sizes.p4 @@ -60,6 +60,9 @@ // Some switches allocate table sizes in powers of 2. Since GPINs (Orchagent) // allocates 1 extra table entry for the loopback IP, we pick the size as // 2^8 - 1 to avoid allocation of 2^9 entries on such switches. + +#define ACL_DEFAULT_PRE_INGRESS_TABLE_MINIMUM_GUARANTEED_SIZE 254 + #define ACL_PRE_INGRESS_TABLE_MINIMUM_GUARANTEED_SIZE 255 #define ACL_INGRESS_COUNTING_TABLE_MINIMUM_GUARANTEED_SIZE 255 diff --git a/sai_p4/instantiations/google/tor.p4 b/sai_p4/instantiations/google/tor.p4 index c46411b0..6ec59361 100644 --- a/sai_p4/instantiations/google/tor.p4 +++ b/sai_p4/instantiations/google/tor.p4 @@ -29,7 +29,6 @@ #include "../../fixed/mirroring_clone.p4" #include "../../fixed/l3_admit.p4" #include "../../fixed/vlan.p4" -#include "../../fixed/ttl.p4" #include "../../fixed/drop_martians.p4" #include "../../fixed/packet_rewrites.p4" #include "acl_egress.p4" @@ -62,7 +61,6 @@ control ingress(inout headers_t headers, // The INGRESS stage can redirect (e.g. drop, punt or copy) packets, apply // rate-limits or modify header data. acl_ingress.apply(headers, local_metadata, standard_metadata); - ttl.apply(headers, local_metadata, standard_metadata); mirroring_clone.apply(headers, local_metadata, standard_metadata); } } diff --git a/sai_p4/instantiations/google/tor.p4info.pb.txt b/sai_p4/instantiations/google/tor.p4info.pb.txt index 1784f11a..8a460041 100644 --- a/sai_p4/instantiations/google/tor.p4info.pb.txt +++ b/sai_p4/instantiations/google/tor.p4info.pb.txt @@ -1,6 +1,6 @@ pkg_info { name: "tor.p4" - version: "2.3.0" + version: "1.4.0" arch: "v1model" organization: "Google" } @@ -42,6 +42,14 @@ tables { bitwidth: 48 match_type: TERNARY } + match_fields { + id: 9 + name: "dst_mac" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_MAC)" + annotations: "@format(MAC_ADDRESS)" + bitwidth: 48 + match_type: TERNARY + } match_fields { id: 5 name: "dst_ip" @@ -473,7 +481,8 @@ tables { alias: "acl_ingress_table" annotations: "@p4runtime_role(\"sdn_controller\")" annotations: "@sai_acl(INGRESS)" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n\n\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n\n\n\n\n // Only allow icmp_type matches for ICMP packets\n icmp_type::mask != 0 -> ip_protocol == 1;\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" + annotations: "@sai_acl_priority(5)" + annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n\n\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n // Only allow arp_tpa matches for ARP packets.\n arp_tpa::mask != 0 -> ether_type == 0x0806;\n\n\n // Only allow icmp_type matches for ICMP packets\n icmp_type::mask != 0 -> ip_protocol == 1;\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" } match_fields { id: 1 @@ -593,6 +602,22 @@ tables { bitwidth: 32 match_type: TERNARY } + match_fields { + id: 17 + name: "in_port" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IN_PORT)" + match_type: OPTIONAL + type_name { + name: "port_id_t" + } + } + match_fields { + id: 18 + name: "route_metadata" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META)" + bitwidth: 6 + match_type: OPTIONAL + } action_refs { id: 16777473 annotations: "@proto_id(1)" @@ -613,10 +638,6 @@ tables { id: 16777481 annotations: "@proto_id(5)" } - action_refs { - id: 16777625 - annotations: "@proto_id(99)" - } action_refs { id: 21257015 annotations: "@defaultonly" @@ -624,7 +645,6 @@ tables { } const_default_action_id: 21257015 direct_resource_ids: 318767362 - direct_resource_ids: 352321792 size: 256 } tables { @@ -633,6 +653,7 @@ tables { name: "ingress.acl_ingress.acl_ingress_qos_table" alias: "acl_ingress_qos_table" annotations: "@sai_acl(INGRESS)" + annotations: "@sai_acl_priority(10)" annotations: "@p4runtime_role(\"sdn_controller\")" annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n // Only allow icmp_type matches for ICMP packets\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Only allow arp_tpa matches for ARP packets.\n arp_tpa::mask != 0 -> ether_type == 0x0806;\n \")" } @@ -750,122 +771,6 @@ tables { direct_resource_ids: 352321794 size: 256 } -tables { - preamble { - id: 33554698 - name: "ingress.acl_ingress.acl_ingress_security_table" - alias: "acl_ingress_security_table" - annotations: "@sai_acl(INGRESS)" - annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n src_ip::mask != 0 -> is_ipv4 == 1;\n\n\n\n\n\n\n\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" - } - match_fields { - id: 1 - name: "is_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 2 - name: "is_ipv4" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 3 - name: "is_ipv6" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" - bitwidth: 1 - match_type: OPTIONAL - } - match_fields { - id: 4 - name: "ether_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 5 - name: "src_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 6 - name: "dst_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 9 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 10 - name: "ip_protocol" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)" - bitwidth: 8 - match_type: TERNARY - } - match_fields { - id: 11 - name: "l4_src_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 12 - name: "l4_dst_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 13 - name: "route_metadata" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 14 - name: "acl_metadata" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_USER_META)" - bitwidth: 8 - match_type: TERNARY - } - action_refs { - id: 16777475 - annotations: "@proto_id(1)" - } - action_refs { - id: 16777481 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777487 - annotations: "@proto_id(3)" - } - action_refs { - id: 21257015 - annotations: "@defaultonly" - scope: DEFAULT_ONLY - } - const_default_action_id: 21257015 - direct_resource_ids: 318767370 - size: 256 -} tables { preamble { id: 33554502 @@ -927,14 +832,7 @@ tables { alias: "acl_egress_table" annotations: "@p4runtime_role(\"sdn_controller\")" annotations: "@sai_acl(EGRESS)" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" - } - match_fields { - id: 1 - name: "ether_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE)" - bitwidth: 16 - match_type: TERNARY + annotations: "@entry_restriction(\"\n\n\n\n\n\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n\n\n\n\n\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" } match_fields { id: 2 @@ -943,13 +841,6 @@ tables { bitwidth: 8 match_type: TERNARY } - match_fields { - id: 3 - name: "l4_dst_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT)" - bitwidth: 16 - match_type: TERNARY - } match_fields { id: 4 name: "out_port" @@ -981,10 +872,11 @@ tables { match_type: OPTIONAL } match_fields { - id: 8 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 + id: 9 + name: "dst_ipv6" + annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD2 ))" + annotations: "@format(IPV6_ADDRESS)" + bitwidth: 64 match_type: TERNARY } action_refs { @@ -1004,6 +896,72 @@ tables { direct_resource_ids: 318767364 size: 127 } +tables { + preamble { + id: 33554696 + name: "egress.acl_egress.acl_egress_dhcp_to_host_table" + alias: "acl_egress_dhcp_to_host_table" + annotations: "@sai_acl(EGRESS)" + annotations: "@p4runtime_role(\"sdn_controller\")" + annotations: "@entry_restriction(\"\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" + } + match_fields { + id: 1 + name: "is_ip" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" + bitwidth: 1 + match_type: OPTIONAL + } + match_fields { + id: 2 + name: "is_ipv4" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" + bitwidth: 1 + match_type: OPTIONAL + } + match_fields { + id: 3 + name: "is_ipv6" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" + bitwidth: 1 + match_type: OPTIONAL + } + match_fields { + id: 5 + name: "ip_protocol" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)" + bitwidth: 8 + match_type: TERNARY + } + match_fields { + id: 6 + name: "l4_dst_port" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT)" + bitwidth: 16 + match_type: TERNARY + } + match_fields { + id: 7 + name: "out_port" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT)" + match_type: OPTIONAL + type_name { + name: "port_id_t" + } + } + action_refs { + id: 16777481 + annotations: "@proto_id(1)" + } + action_refs { + id: 21257015 + annotations: "@defaultonly" + scope: DEFAULT_ONLY + } + const_default_action_id: 21257015 + direct_resource_ids: 318767368 + size: 127 +} actions { preamble { id: 21257015 @@ -1248,9 +1206,7 @@ actions { id: 16777473 name: "ingress.acl_ingress.acl_copy" alias: "acl_copy" - annotations: "@sai_action(SAI_PACKET_ACTION_COPY , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_RED)" + annotations: "@sai_action(SAI_PACKET_ACTION_COPY)" } params { id: 1 @@ -1266,27 +1222,7 @@ actions { id: 16777474 name: "ingress.acl_ingress.acl_trap" alias: "acl_trap" - annotations: "@sai_action(SAI_PACKET_ACTION_TRAP , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" - } - params { - id: 1 - name: "qos_queue" - annotations: "@sai_action_param(QOS_QUEUE)" - type_name { - name: "qos_queue_t" - } - } -} -actions { - preamble { - id: 16777625 - name: "ingress.acl_ingress.acl_experimental_trap" - alias: "acl_experimental_trap" - annotations: "@sai_action(SAI_PACKET_ACTION_TRAP , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" + annotations: "@sai_action(SAI_PACKET_ACTION_TRAP)" } params { id: 1 @@ -1302,9 +1238,7 @@ actions { id: 16777475 name: "ingress.acl_ingress.acl_forward" alias: "acl_forward" - annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" + annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" } } actions { @@ -1358,14 +1292,6 @@ actions { } } } -actions { - preamble { - id: 16777487 - name: "ingress.acl_ingress.acl_deny" - alias: "acl_deny" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP)" - } -} actions { preamble { id: 16777223 @@ -1500,17 +1426,6 @@ direct_counters { } direct_table_id: 33554695 } -direct_counters { - preamble { - id: 318767370 - name: "ingress.acl_ingress.acl_ingress_security_counter" - alias: "acl_ingress_security_counter" - } - spec { - unit: BOTH - } - direct_table_id: 33554698 -} direct_counters { preamble { id: 318767364 @@ -1522,16 +1437,16 @@ direct_counters { } direct_table_id: 33554692 } -direct_meters { +direct_counters { preamble { - id: 352321792 - name: "ingress.acl_ingress.acl_ingress_meter" - alias: "acl_ingress_meter" + id: 318767368 + name: "egress.acl_egress.acl_egress_dhcp_to_host_counter" + alias: "acl_egress_dhcp_to_host_counter" } spec { - unit: BYTES + unit: BOTH } - direct_table_id: 33554688 + direct_table_id: 33554696 } direct_meters { preamble { diff --git a/sai_p4/instantiations/google/unioned_p4info.pb.txt b/sai_p4/instantiations/google/unioned_p4info.pb.txt index 8a39728f..b2f1a07e 100644 --- a/sai_p4/instantiations/google/unioned_p4info.pb.txt +++ b/sai_p4/instantiations/google/unioned_p4info.pb.txt @@ -1,6 +1,6 @@ pkg_info { name: "Union of fabric_border_router.p4, middleblock.p4, tor.p4, wbb.p4" - version: "2.3.0" + version: "1.4.0" arch: "v1model" organization: "Google" } @@ -389,9 +389,10 @@ tables { alias: "acl_ingress_table" annotations: "@p4runtime_role(\"sdn_controller\")" annotations: "@sai_acl(INGRESS)" + annotations: "@sai_acl_priority(5)" annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n ecn::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n\n\n\n\n // Only allow icmp_type matches for ICMP packets\n icmp_type::mask != 0 -> ip_protocol == 1;\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n ecn::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n // Only allow arp_tpa matches for ARP packets.\n arp_tpa::mask != 0 -> ether_type == 0x0806;\n\n\n\n\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n\n\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n\n\n\n\n // Only allow icmp_type matches for ICMP packets\n icmp_type::mask != 0 -> ip_protocol == 1;\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" + annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n\n\n\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n l4_src_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n // Only allow arp_tpa matches for ARP packets.\n arp_tpa::mask != 0 -> ether_type == 0x0806;\n\n\n // Only allow icmp_type matches for ICMP packets\n icmp_type::mask != 0 -> ip_protocol == 1;\n\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" } match_fields { id: 1 @@ -561,10 +562,6 @@ tables { id: 16777481 annotations: "@proto_id(5)" } - action_refs { - id: 16777625 - annotations: "@proto_id(99)" - } action_refs { id: 21257015 annotations: "@defaultonly" @@ -693,7 +690,8 @@ tables { alias: "acl_egress_table" annotations: "@p4runtime_role(\"sdn_controller\")" annotations: "@sai_acl(EGRESS)" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" + annotations: "@entry_restriction(\"\n\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n dscp::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n\n\n\n // Only allow l4_dst_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" + annotations: "@entry_restriction(\"\n\n\n\n\n\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n\n dst_ipv6::mask != 0 -> is_ipv6 == 1;\n\n\n\n\n\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" } match_fields { id: 1 @@ -753,6 +751,14 @@ tables { bitwidth: 6 match_type: TERNARY } + match_fields { + id: 9 + name: "dst_ipv6" + annotations: "@composite_field(@ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD3 ) , @ sai_field ( SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD2 ))" + annotations: "@format(IPV6_ADDRESS)" + bitwidth: 64 + match_type: TERNARY + } action_refs { id: 16777481 annotations: "@proto_id(1)" @@ -876,6 +882,7 @@ tables { name: "ingress.acl_ingress.acl_ingress_qos_table" alias: "acl_ingress_qos_table" annotations: "@sai_acl(INGRESS)" + annotations: "@sai_acl_priority(10)" annotations: "@p4runtime_role(\"sdn_controller\")" annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n ttl::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port and l4_src_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n // Only allow icmp_type matches for ICMP packets\n icmpv6_type::mask != 0 -> ip_protocol == 58;\n // Only allow arp_tpa matches for ARP packets.\n arp_tpa::mask != 0 -> ether_type == 0x0806;\n \")" } @@ -995,12 +1002,12 @@ tables { } tables { preamble { - id: 33554698 - name: "ingress.acl_ingress.acl_ingress_security_table" - alias: "acl_ingress_security_table" - annotations: "@sai_acl(INGRESS)" + id: 33554696 + name: "egress.acl_egress.acl_egress_dhcp_to_host_table" + alias: "acl_egress_dhcp_to_host_table" + annotations: "@sai_acl(EGRESS)" annotations: "@p4runtime_role(\"sdn_controller\")" - annotations: "@entry_restriction(\"\n // Forbid using ether_type for IP packets (by convention, use is_ip* instead).\n ether_type != 0x0800 && ether_type != 0x86dd;\n // Only allow IP field matches for IP packets.\n dst_ip::mask != 0 -> is_ipv4 == 1;\n src_ip::mask != 0 -> is_ipv4 == 1;\n\n\n\n\n\n\n\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" + annotations: "@entry_restriction(\"\n // Only allow IP field matches for IP packets.\n ip_protocol::mask != 0 -> (is_ip == 1 || is_ipv4 == 1 || is_ipv6 == 1);\n // Only allow l4_dst_port matches for TCP/UDP packets.\n l4_dst_port::mask != 0 -> (ip_protocol == 6 || ip_protocol == 17);\n // Forbid illegal combinations of IP_TYPE fields.\n is_ip::mask != 0 -> (is_ipv4::mask == 0 && is_ipv6::mask == 0);\n is_ipv4::mask != 0 -> (is_ip::mask == 0 && is_ipv6::mask == 0);\n is_ipv6::mask != 0 -> (is_ip::mask == 0 && is_ipv4::mask == 0);\n // Forbid unsupported combinations of IP_TYPE fields.\n is_ipv4::mask != 0 -> (is_ipv4 == 1);\n is_ipv6::mask != 0 -> (is_ipv6 == 1);\n \")" } match_fields { id: 1 @@ -1023,82 +1030,32 @@ tables { bitwidth: 1 match_type: OPTIONAL } - match_fields { - id: 4 - name: "ether_type" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE)" - bitwidth: 16 - match_type: TERNARY - } match_fields { id: 5 - name: "src_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 6 - name: "dst_ip" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IP)" - annotations: "@format(IPV4_ADDRESS)" - bitwidth: 32 - match_type: TERNARY - } - match_fields { - id: 9 - name: "dscp" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 10 name: "ip_protocol" annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)" bitwidth: 8 match_type: TERNARY } match_fields { - id: 11 - name: "l4_src_port" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT)" - bitwidth: 16 - match_type: TERNARY - } - match_fields { - id: 12 + id: 6 name: "l4_dst_port" annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT)" bitwidth: 16 match_type: TERNARY } match_fields { - id: 13 - name: "route_metadata" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META)" - bitwidth: 6 - match_type: TERNARY - } - match_fields { - id: 14 - name: "acl_metadata" - annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_USER_META)" - bitwidth: 8 - match_type: TERNARY - } - action_refs { - id: 16777475 - annotations: "@proto_id(1)" + id: 7 + name: "out_port" + annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT)" + match_type: OPTIONAL + type_name { + name: "port_id_t" + } } action_refs { id: 16777481 - annotations: "@proto_id(2)" - } - action_refs { - id: 16777487 - annotations: "@proto_id(3)" + annotations: "@proto_id(1)" } action_refs { id: 21257015 @@ -1106,8 +1063,8 @@ tables { scope: DEFAULT_ONLY } const_default_action_id: 21257015 - direct_resource_ids: 318767370 - size: 256 + direct_resource_ids: 318767368 + size: 127 } tables { preamble { @@ -1402,6 +1359,7 @@ actions { annotations: "@sai_action(SAI_PACKET_ACTION_COPY , SAI_PACKET_COLOR_GREEN)" annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_YELLOW)" annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_RED)" + annotations: "@sai_action(SAI_PACKET_ACTION_COPY)" } params { id: 1 @@ -1420,24 +1378,7 @@ actions { annotations: "@sai_action(SAI_PACKET_ACTION_TRAP , SAI_PACKET_COLOR_GREEN)" annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" - } - params { - id: 1 - name: "qos_queue" - annotations: "@sai_action_param(QOS_QUEUE)" - type_name { - name: "qos_queue_t" - } - } -} -actions { - preamble { - id: 16777625 - name: "ingress.acl_ingress.acl_experimental_trap" - alias: "acl_experimental_trap" - annotations: "@sai_action(SAI_PACKET_ACTION_TRAP , SAI_PACKET_COLOR_GREEN)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" + annotations: "@sai_action(SAI_PACKET_ACTION_TRAP)" } params { id: 1 @@ -1456,6 +1397,7 @@ actions { annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD , SAI_PACKET_COLOR_GREEN)" annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_YELLOW)" annotations: "@sai_action(SAI_PACKET_ACTION_DROP , SAI_PACKET_COLOR_RED)" + annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" } } actions { @@ -1605,14 +1547,6 @@ actions { } } } -actions { - preamble { - id: 16777487 - name: "ingress.acl_ingress.acl_deny" - alias: "acl_deny" - annotations: "@sai_action(SAI_PACKET_ACTION_DROP)" - } -} actions { preamble { id: 16777485 @@ -1727,14 +1661,14 @@ direct_counters { } direct_counters { preamble { - id: 318767370 - name: "ingress.acl_ingress.acl_ingress_security_counter" - alias: "acl_ingress_security_counter" + id: 318767368 + name: "egress.acl_egress.acl_egress_dhcp_to_host_counter" + alias: "acl_egress_dhcp_to_host_counter" } spec { unit: BOTH } - direct_table_id: 33554698 + direct_table_id: 33554696 } direct_counters { preamble { diff --git a/sai_p4/instantiations/google/versions.h b/sai_p4/instantiations/google/versions.h index 0673dc5c..8e37f2b0 100644 --- a/sai_p4/instantiations/google/versions.h +++ b/sai_p4/instantiations/google/versions.h @@ -23,51 +23,15 @@ // packets are provisioned in 1.4.0. #define SAI_P4_PKGINFO_VERSION_HAS_DEDICATED_CONTROLLER_CPU_QUEUES "1.4.0" -// Indicates that P4 program no longer contains -// mirror_port_to_pre_session_table. -// Removing a table is a breaking change and should have required a major -// version bump. We didn't because the next two major versions have been -// reserved and we can not skip major versions from the current version. -// This is ok since our infra doesn't care about semantic versioning's -// semantics. -#define SAI_P4_PKGINFO_VERSION_HAS_NO_MIRROR_PORT_TO_PRE_SESSION_TABLE "1.4.1" - -// Indicates that the switch supports read requests for multicast group entries. -#define SAI_P4_PKGINFO_VERSION_SUPPORTS_PACKET_REPLICATION_ENGINE_READS "1.5.0" - -// Indicates the program has ingress cloning support that allows cloning + -// punting the same packet. -#define SAI_P4_PKGINFO_VERSION_HAS_INGRESS_CLONING_SUPPORT "1.6.0" - -// Indicates the switch supports multiple WCMP members with the same Nexthop. -#define SAI_P4_PKGINFO_VERSION_HAS_DUPLICATE_WCMP_MEMBER_SUPPORT "1.6.1" - -// Indicates that switch respects ingress ACL resource guarantees. -#define SAI_P4_PKGINFO_VERSION_FIXED_INGRESS_ACL_RESOURCE "1.6.2" - // Indicates that the program does not support the `set_nexthop` action. #define SAI_P4_PKGINFO_VERSION_HAS_NO_SET_NEXTHOP_SUPPORT "2.0.0" -// Indicates the switch supports P4Info ReconcileAndCommit for most cases. -#define SAI_P4_PKGINFO_VERSION_SUPPORTS_RECONCILE "2.1.0" - -// Indicates the switch supports multicast group entry metadata. -#define SAI_P4_PKGINFO_VERSION_SUPPORTS_MULTICAST_METADATA "2.2.0" - -// Indicates the switch supports the `acl_egress_l2_table` (if of the right -// instantiation). -#define SAI_P4_PKGINFO_VERSION_SUPPORTS_ACL_EGRESS_L2_TABLE "2.3.0" - // Indicates that the program supports ternary rather than optional route // metadata in the acl_ingress_table. #define SAI_P4_PKGINFO_VERSION_USES_TERNARY_ROUTE_METADATA "3.0.0" -// Indicates the switch executes batched updates in order, aborting every update -// after the first failed one. -#define SAI_P4_PKGINFO_VERSION_USES_FAIL_ON_FIRST "3.1.0" - // Macro that always points to the latest SAI P4 version. #define SAI_P4_PKGINFO_VERSION_LATEST \ - SAI_P4_PKGINFO_VERSION_SUPPORTS_ACL_EGRESS_L2_TABLE + SAI_P4_PKGINFO_VERSION_HAS_DEDICATED_CONTROLLER_CPU_QUEUES #endif // GOOGLE_SAI_VERSIONS_H_ diff --git a/sai_p4/instantiations/google/wbb.p4info.pb.txt b/sai_p4/instantiations/google/wbb.p4info.pb.txt index 4eba45b8..900bc044 100644 --- a/sai_p4/instantiations/google/wbb.p4info.pb.txt +++ b/sai_p4/instantiations/google/wbb.p4info.pb.txt @@ -1,6 +1,6 @@ pkg_info { name: "wbb.p4" - version: "2.3.0" + version: "1.4.0" arch: "v1model" organization: "Google" }