diff --git a/backends/dpdk/dpdkAsmOpt.h b/backends/dpdk/dpdkAsmOpt.h index 80a7c4daca..c9789b580f 100644 --- a/backends/dpdk/dpdkAsmOpt.h +++ b/backends/dpdk/dpdkAsmOpt.h @@ -234,7 +234,7 @@ class ShortenTokenLength : public Transform { } const IR::Node* preorder(IR::DpdkHeaderType *h) override { - h->name = shortenString(h->name, 30); + h->name = shortenString(h->name); IR::IndexedVector changedFields; for (auto field : h->fields) { IR::StructField *f = new IR::StructField(field->name, field->type); @@ -280,15 +280,25 @@ class ShortenTokenLength : public Transform { return s; } - const IR::Node* preorder(IR::DpdkLearnStatement *ls) override{ + const IR::Node* preorder(IR::DpdkLearnStatement *ls) override { ls->action = shortenString(ls->action); return ls; } - const IR::Node* preorder(IR::DpdkApplyStatement *as) override{ + const IR::Node* preorder(IR::DpdkApplyStatement *as) override { as->table = shortenString(as->table); return as; } + + const IR::Node* preorder(IR::DpdkJmpStatement *j) override { + j->label = shortenString(j->label); + return j; + } + + const IR::Node* preorder(IR::DpdkLabelStatement *ls) override { + ls->label = shortenString(ls->label); + return ls; + } }; /// This pass collect use def info by analysing all possible diff --git a/testdata/p4_16_samples/pna-too-big-label-name-dpdk.p4 b/testdata/p4_16_samples/pna-too-big-label-name-dpdk.p4 new file mode 100644 index 0000000000..85a970f1db --- /dev/null +++ b/testdata/p4_16_samples/pna-too-big-label-name-dpdk.p4 @@ -0,0 +1,171 @@ +/* +Copyright 2022 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +#include +#include "pna.p4" + + +typedef bit<48> EthernetAddress; + +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header ipv4_dddddddddddddddddddddddddddddddddddddddddd_t { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; +} + +struct empty_metadata_t { +} + +////////////////////////////////////////////////////////////////////// +// Struct types for holding user-defined collections of headers and +// metadata in the P4 developer's program. +// +// Note: The names of these struct types are completely up to the P4 +// developer, as are their member fields, with the only restriction +// being that the structs intended to contain headers should only +// contain members whose types are header, header stack, or +// header_union. +////////////////////////////////////////////////////////////////////// +struct main_metadata_t { + // empty for this skeleton +} + +// User-defined struct containing all of those headers parsed in the +// main parser. +struct headers_t { + ethernet_t ethernet; + ipv4_dddddddddddddddddddddddddddddddddddddddddd_t ipv4; + ethernet_t ethernet1; +} + +void copy_header_ethernet(inout ethernet_t hdr, in ethernet_t outer_hdr) { + hdr.dstAddr = outer_hdr.dstAddr; + hdr.srcAddr = outer_hdr.srcAddr; + hdr.etherType = outer_hdr.etherType; +} + +control PreControlImpl( + in headers_t hdr, + inout main_metadata_t meta, + in pna_pre_input_metadata_t istd, + inout pna_pre_output_metadata_t ostd) +{ + + apply { + } + +} + +parser MainParserImpl( + packet_in pkt, + out headers_t hdr, + inout main_metadata_t main_meta, + in pna_main_parser_input_metadata_t istd) +{ + + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 0x0800: parse_ipv4_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd; + default: accept; + } + } + state parse_ipv4_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd { + pkt.extract(hdr.ipv4); + transition accept; + } +} + +control MainControlImpl( + inout headers_t hdr, // from main parser + inout main_metadata_t user_meta, // from main parser, to "next block" + in pna_main_input_metadata_t istd, + inout pna_main_output_metadata_t ostd) +{ + bit<32> tmpDir; + ethernet_t eth; + action next_hop(PortId_t vport) { + eth = hdr.ethernet; + hdr.ethernet1 = eth; + send_to_port(vport); + } + + action default_route_drop() { + drop_packet(); + copy_header_ethernet(hdr.ethernet, hdr.ethernet1); + } + table ipv4_da_lpm { + key = { + tmpDir :lpm @name ("ipv4_addr"); + + } + actions = { + next_hop; + default_route_drop; + } + const default_action = default_route_drop; + } + apply { + + if (PNA_Direction_t.NET_TO_HOST == istd.direction) { + tmpDir = hdr.ipv4.srcAddr; + } else { + tmpDir = hdr.ipv4.dstAddr; + } + if (hdr.ipv4.isValid()) { + ipv4_da_lpm.apply(); + } + } +} + +control MainDeparserImpl( + packet_out pkt, + in headers_t hdr, // from main control + in main_metadata_t user_meta, // from main control + in pna_main_output_metadata_t ostd) +{ + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.ipv4); + } +} + +// BEGIN:Package_Instantiation_Example +PNA_NIC( + MainParserImpl(), + PreControlImpl(), + MainControlImpl(), + MainDeparserImpl() + // Hoping to make this optional parameter later, but not supported + // by p4c yet. + //, PreParserImpl() + ) main; +// END:Package_Instantiation_Example + diff --git a/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk-first.p4 b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk-first.p4 new file mode 100644 index 0000000000..d14433baf3 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk-first.p4 @@ -0,0 +1,104 @@ +#include +#include + +typedef bit<48> EthernetAddress; +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header ipv4_dddddddddddddddddddddddddddddddddddddddddd_t { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; +} + +struct empty_metadata_t { +} + +struct main_metadata_t { +} + +struct headers_t { + ethernet_t ethernet; + ipv4_dddddddddddddddddddddddddddddddddddddddddd_t ipv4; + ethernet_t ethernet1; +} + +void copy_header_ethernet(inout ethernet_t hdr, in ethernet_t outer_hdr) { + hdr.dstAddr = outer_hdr.dstAddr; + hdr.srcAddr = outer_hdr.srcAddr; + hdr.etherType = outer_hdr.etherType; +} +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x800: parse_ipv4_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd; + default: accept; + } + } + state parse_ipv4_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd { + pkt.extract(hdr.ipv4); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t user_meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + bit<32> tmpDir; + ethernet_t eth; + action next_hop(PortId_t vport) { + eth = hdr.ethernet; + hdr.ethernet1 = eth; + send_to_port(vport); + } + action default_route_drop() { + drop_packet(); + copy_header_ethernet(hdr.ethernet, hdr.ethernet1); + } + table ipv4_da_lpm { + key = { + tmpDir: lpm @name("ipv4_addr") ; + } + actions = { + next_hop(); + default_route_drop(); + } + const default_action = default_route_drop(); + } + apply { + if (PNA_Direction_t.NET_TO_HOST == istd.direction) { + tmpDir = hdr.ipv4.srcAddr; + } else { + tmpDir = hdr.ipv4.dstAddr; + } + if (hdr.ipv4.isValid()) { + ipv4_da_lpm.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.ipv4); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk-frontend.p4 b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk-frontend.p4 new file mode 100644 index 0000000000..ede67718a2 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk-frontend.p4 @@ -0,0 +1,107 @@ +#include +#include + +typedef bit<48> EthernetAddress; +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header ipv4_dddddddddddddddddddddddddddddddddddddddddd_t { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; +} + +struct empty_metadata_t { +} + +struct main_metadata_t { +} + +struct headers_t { + ethernet_t ethernet; + ipv4_dddddddddddddddddddddddddddddddddddddddddd_t ipv4; + ethernet_t ethernet1; +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x800: parse_ipv4_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd; + default: accept; + } + } + state parse_ipv4_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd { + pkt.extract(hdr.ipv4); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t user_meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + @name("MainControlImpl.tmpDir") bit<32> tmpDir_0; + @name("MainControlImpl.eth") ethernet_t eth_0; + @name("MainControlImpl.hdr_0") ethernet_t hdr_1; + @name("MainControlImpl.outer_hdr_0") ethernet_t outer_hdr; + @name("MainControlImpl.next_hop") action next_hop(@name("vport") PortId_t vport) { + eth_0 = hdr.ethernet; + hdr.ethernet1 = eth_0; + send_to_port(vport); + } + @name("MainControlImpl.default_route_drop") action default_route_drop() { + drop_packet(); + hdr_1 = hdr.ethernet; + outer_hdr = hdr.ethernet1; + hdr_1.dstAddr = outer_hdr.dstAddr; + hdr_1.srcAddr = outer_hdr.srcAddr; + hdr_1.etherType = outer_hdr.etherType; + hdr.ethernet = hdr_1; + } + @name("MainControlImpl.ipv4_da_lpm") table ipv4_da_lpm_0 { + key = { + tmpDir_0: lpm @name("ipv4_addr") ; + } + actions = { + next_hop(); + default_route_drop(); + } + const default_action = default_route_drop(); + } + apply { + eth_0.setInvalid(); + if (PNA_Direction_t.NET_TO_HOST == istd.direction) { + tmpDir_0 = hdr.ipv4.srcAddr; + } else { + tmpDir_0 = hdr.ipv4.dstAddr; + } + if (hdr.ipv4.isValid()) { + ipv4_da_lpm_0.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.ipv4); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk-midend.p4 b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk-midend.p4 new file mode 100644 index 0000000000..c88b54acc0 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk-midend.p4 @@ -0,0 +1,143 @@ +#include +#include + +typedef bit<48> EthernetAddress; +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header ipv4_dddddddddddddddddddddddddddddddddddddddddd_t { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; +} + +struct empty_metadata_t { +} + +struct main_metadata_t { +} + +struct headers_t { + ethernet_t ethernet; + ipv4_dddddddddddddddddddddddddddddddddddddddddd_t ipv4; + ethernet_t ethernet1; +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x800: parse_ipv4_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd; + default: accept; + } + } + state parse_ipv4_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd { + pkt.extract(hdr.ipv4); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t user_meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + @name("MainControlImpl.tmpDir") bit<32> tmpDir_0; + @name("MainControlImpl.eth") ethernet_t eth_0; + @name("MainControlImpl.hdr_0") ethernet_t hdr_1; + @name("MainControlImpl.outer_hdr_0") ethernet_t outer_hdr; + @name("MainControlImpl.next_hop") action next_hop(@name("vport") PortId_t vport) { + eth_0 = hdr.ethernet; + hdr.ethernet1 = hdr.ethernet; + send_to_port(vport); + } + @name("MainControlImpl.default_route_drop") action default_route_drop() { + drop_packet(); + hdr_1 = hdr.ethernet; + outer_hdr = hdr.ethernet1; + hdr_1.dstAddr = outer_hdr.dstAddr; + hdr_1.srcAddr = outer_hdr.srcAddr; + hdr_1.etherType = outer_hdr.etherType; + hdr.ethernet = hdr_1; + } + @name("MainControlImpl.ipv4_da_lpm") table ipv4_da_lpm_0 { + key = { + tmpDir_0: lpm @name("ipv4_addr") ; + } + actions = { + next_hop(); + default_route_drop(); + } + const default_action = default_route_drop(); + } + @hidden action pnatoobiglabelnamedpdk138() { + tmpDir_0 = hdr.ipv4.srcAddr; + } + @hidden action pnatoobiglabelnamedpdk140() { + tmpDir_0 = hdr.ipv4.dstAddr; + } + @hidden action pnatoobiglabelnamedpdk113() { + eth_0.setInvalid(); + } + @hidden table tbl_pnatoobiglabelnamedpdk113 { + actions = { + pnatoobiglabelnamedpdk113(); + } + const default_action = pnatoobiglabelnamedpdk113(); + } + @hidden table tbl_pnatoobiglabelnamedpdk138 { + actions = { + pnatoobiglabelnamedpdk138(); + } + const default_action = pnatoobiglabelnamedpdk138(); + } + @hidden table tbl_pnatoobiglabelnamedpdk140 { + actions = { + pnatoobiglabelnamedpdk140(); + } + const default_action = pnatoobiglabelnamedpdk140(); + } + apply { + tbl_pnatoobiglabelnamedpdk113.apply(); + if (PNA_Direction_t.NET_TO_HOST == istd.direction) { + tbl_pnatoobiglabelnamedpdk138.apply(); + } else { + tbl_pnatoobiglabelnamedpdk140.apply(); + } + if (hdr.ipv4.isValid()) { + ipv4_da_lpm_0.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + @hidden action pnatoobiglabelnamedpdk155() { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.ipv4); + } + @hidden table tbl_pnatoobiglabelnamedpdk155 { + actions = { + pnatoobiglabelnamedpdk155(); + } + const default_action = pnatoobiglabelnamedpdk155(); + } + apply { + tbl_pnatoobiglabelnamedpdk155.apply(); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4 b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4 new file mode 100644 index 0000000000..4545ac9710 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4 @@ -0,0 +1,104 @@ +#include +#include + +typedef bit<48> EthernetAddress; +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header ipv4_dddddddddddddddddddddddddddddddddddddddddd_t { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; +} + +struct empty_metadata_t { +} + +struct main_metadata_t { +} + +struct headers_t { + ethernet_t ethernet; + ipv4_dddddddddddddddddddddddddddddddddddddddddd_t ipv4; + ethernet_t ethernet1; +} + +void copy_header_ethernet(inout ethernet_t hdr, in ethernet_t outer_hdr) { + hdr.dstAddr = outer_hdr.dstAddr; + hdr.srcAddr = outer_hdr.srcAddr; + hdr.etherType = outer_hdr.etherType; +} +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 0x800: parse_ipv4_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd; + default: accept; + } + } + state parse_ipv4_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd { + pkt.extract(hdr.ipv4); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t user_meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + bit<32> tmpDir; + ethernet_t eth; + action next_hop(PortId_t vport) { + eth = hdr.ethernet; + hdr.ethernet1 = eth; + send_to_port(vport); + } + action default_route_drop() { + drop_packet(); + copy_header_ethernet(hdr.ethernet, hdr.ethernet1); + } + table ipv4_da_lpm { + key = { + tmpDir: lpm @name("ipv4_addr") ; + } + actions = { + next_hop; + default_route_drop; + } + const default_action = default_route_drop; + } + apply { + if (PNA_Direction_t.NET_TO_HOST == istd.direction) { + tmpDir = hdr.ipv4.srcAddr; + } else { + tmpDir = hdr.ipv4.dstAddr; + } + if (hdr.ipv4.isValid()) { + ipv4_da_lpm.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.ipv4); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4-error b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4-error new file mode 100644 index 0000000000..e69de29bb2 diff --git a/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4-stderr b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4-stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4.bfrt.json b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4.bfrt.json new file mode 100644 index 0000000000..13b95e4a64 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4.bfrt.json @@ -0,0 +1,61 @@ +{ + "schema_version" : "1.0.0", + "tables" : [ + { + "name" : "pipe.MainControlImpl.ipv4_da_lpm", + "id" : 40097106, + "table_type" : "MatchAction_Direct", + "size" : 1024, + "annotations" : [], + "depends_on" : [], + "has_const_default_action" : true, + "key" : [ + { + "id" : 1, + "name" : "ipv4_addr", + "repeated" : false, + "annotations" : [], + "mandatory" : false, + "match_type" : "LPM", + "type" : { + "type" : "bytes", + "width" : 32 + } + } + ], + "action_specs" : [ + { + "id" : 25584005, + "name" : "MainControlImpl.next_hop", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "vport", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 32 + } + } + ] + }, + { + "id" : 19071441, + "name" : "MainControlImpl.default_route_drop", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + } + ], + "data" : [], + "supported_operations" : [], + "attributes" : ["EntryScope"] + } + ], + "learn_filters" : [] +} \ No newline at end of file diff --git a/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4.spec b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4.spec new file mode 100644 index 0000000000..aca55844f2 --- /dev/null +++ b/testdata/p4_16_samples_outputs/pna-too-big-label-name-dpdk.p4.spec @@ -0,0 +1,90 @@ + +struct ethernet_t { + bit<48> dstAddr + bit<48> srcAddr + bit<16> etherType +} + +struct ipv4_dddddddddddddddddddddddddddddddddddddddddd_t { + bit<8> version_ihl + bit<8> diffserv + bit<16> totalLen + bit<16> identification + bit<16> flags_fragOffset + bit<8> ttl + bit<8> protocol + bit<16> hdrChecksum + bit<32> srcAddr + bit<32> dstAddr +} + +struct next_hop_arg_t { + bit<32> vport +} + +struct main_metadata_t { + bit<32> pna_main_input_metadata_direction + bit<32> pna_main_input_metadata_input_port + bit<32> pna_main_output_metadata_output_port + bit<32> MainControlT_tmpDir +} +metadata instanceof main_metadata_t + +header ethernet instanceof ethernet_t +header ipv4 instanceof ipv4_dddddddddddddddddddddddddddddddddddddddddd_t +header ethernet1 instanceof ethernet_t + +regarray direction size 0x100 initval 0 + +action next_hop args instanceof next_hop_arg_t { + jmpnv LABEL_FALSE_1 h.ethernet + validate h.ethernet1 + jmp LABEL_END_1 + LABEL_FALSE_1 : invalidate h.ethernet1 + LABEL_END_1 : mov h.ethernet1.dstAddr h.ethernet.dstAddr + mov h.ethernet1.srcAddr h.ethernet.srcAddr + mov h.ethernet1.etherType h.ethernet.etherType + mov m.pna_main_output_metadata_output_port t.vport + return +} + +action default_route_drop args none { + drop + mov h.ethernet.dstAddr h.ethernet1.dstAddr + mov h.ethernet.srcAddr h.ethernet1.srcAddr + mov h.ethernet.etherType h.ethernet1.etherType + return +} + +table ipv4_da_lpm { + key { + m.MainControlT_tmpDir lpm + } + actions { + next_hop + default_route_drop + } + default_action default_route_drop args none const + size 0x10000 +} + + +apply { + rx m.pna_main_input_metadata_input_port + extract h.ethernet + jmpeq MAINPARSERIMPL_PARSE_IPV4_DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0 h.ethernet.etherType 0x800 + jmp MAINPARSERIMPL_ACCEPT + MAINPARSERIMPL_PARSE_IPV4_DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0 : extract h.ipv4 + MAINPARSERIMPL_ACCEPT : regrd m.pna_main_input_metadata_direction direction m.pna_main_input_metadata_input_port + jmpneq LABEL_FALSE 0x0 m.pna_main_input_metadata_direction + mov m.MainControlT_tmpDir h.ipv4.srcAddr + jmp LABEL_END + LABEL_FALSE : mov m.MainControlT_tmpDir h.ipv4.dstAddr + LABEL_END : jmpnv LABEL_END_0 h.ipv4 + table ipv4_da_lpm + LABEL_END_0 : emit h.ethernet + emit h.ipv4 + tx m.pna_main_output_metadata_output_port +} + +