From bfef774114cddb35f6c24f7f56927aae8e2b32fe Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Wed, 16 Aug 2023 16:13:21 -0400 Subject: [PATCH] Continuing the implementation of initial entries support in p4c (#4080) * Continuing the implementation of initial entries support in p4c These changes update the contents of P4Info and table entries files as generated by p4c, to match what has been agreed upon by the P4 API work group in this pull request https://github.com/p4lang/p4runtime/pull/432 * Comment-only change to poke CI. * Update p4runtime commit SHA * Update p4runtime commit SHA for Bazel builds * Correctly handle case when table->getEntries() is null * Update a few more expected output files, and make linter happy * Update bazel/p4c_deps.bzl Co-authored-by: Radostin Stoyanov --------- Co-authored-by: Radostin Stoyanov --- CMakeLists.txt | 2 +- bazel/p4c_deps.bzl | 4 ++-- control-plane/p4RuntimeSerializer.cpp | 20 ++++++++++++++++--- .../table-entries-lpm-2.p4.entries.txt | 5 +++++ .../table-entries-lpm-2.p4.p4info.txt | 1 + ...ble-entries-optional-2-bmv2.p4.entries.txt | 3 +++ ...able-entries-optional-2-bmv2.p4.p4info.txt | 1 + .../action-two-params.p4.entries.txt | 1 + .../action-two-params.p4.p4info.txt | 1 + .../bvec-hdr-bmv2.p4.entries.txt | 2 ++ .../bvec-hdr-bmv2.p4.p4info.txt | 1 + .../checksum-l4-bmv2.p4.entries.txt | 2 ++ .../checksum-l4-bmv2.p4.p4info.txt | 2 ++ .../crc32-bmv2.p4.entries.txt | 6 ++++++ .../crc32-bmv2.p4.p4info.txt | 1 + .../init-entries-bmv2.p4.entries.txt | 16 +++++++++++++++ .../init-entries-bmv2.p4.p4info.txt | 9 +++++++++ .../issue1107.p4.entries.txt | 2 ++ .../issue1107.p4.p4info.txt | 1 + .../issue1478-bmv2.p4.entries.txt | 1 + .../issue1478-bmv2.p4.p4info.txt | 1 + .../issue1834-bmv2.p4.entries.txt | 1 + .../issue1834-bmv2.p4.p4info.txt | 1 + .../issue2904.p4.entries.txt | 3 +++ .../issue2904.p4.p4info.txt | 1 + .../issue3550.p4.entries.txt | 6 ++++++ .../issue3550.p4.p4info.txt | 2 ++ ...table-entries-exact-ternary.p4.entries.txt | 4 ++++ ...-table-entries-exact-ternary.p4.p4info.txt | 1 + .../saturated-bmv2.p4.entries.txt | 4 ++++ .../saturated-bmv2.p4.p4info.txt | 1 + .../table-entries-exact-bmv2.p4.entries.txt | 2 ++ .../table-entries-exact-bmv2.p4.p4info.txt | 1 + ...-entries-exact-ternary-bmv2.p4.entries.txt | 4 ++++ ...e-entries-exact-ternary-bmv2.p4.p4info.txt | 1 + .../table-entries-lpm-bmv2.p4.entries.txt | 3 +++ .../table-entries-lpm-bmv2.p4.p4info.txt | 1 + ...table-entries-optional-bmv2.p4.entries.txt | 4 ++++ .../table-entries-optional-bmv2.p4.p4info.txt | 1 + ...table-entries-priority-bmv2.p4.entries.txt | 3 +++ .../table-entries-priority-bmv2.p4.p4info.txt | 1 + .../table-entries-range-bmv2.p4.entries.txt | 4 ++++ .../table-entries-range-bmv2.p4.p4info.txt | 1 + ...table-entries-ser-enum-bmv2.p4.entries.txt | 3 +++ .../table-entries-ser-enum-bmv2.p4.p4info.txt | 1 + .../table-entries-ternary-bmv2.p4.entries.txt | 4 ++++ .../table-entries-ternary-bmv2.p4.p4info.txt | 1 + .../table-entries-valid-bmv2.p4.entries.txt | 2 ++ .../table-entries-valid-bmv2.p4.p4info.txt | 1 + .../table-key-serenum-bmv2.p4.entries.txt | 2 ++ .../table-key-serenum-bmv2.p4.p4info.txt | 1 + .../v1model-const-entries-bmv2.p4.entries.txt | 3 +++ .../v1model-const-entries-bmv2.p4.p4info.txt | 1 + .../xor_test.p4.entries.txt | 2 ++ .../xor_test.p4.p4info.txt | 1 + 55 files changed, 148 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7bc5620ab..c6117c182b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,7 +383,7 @@ set(FETCHCONTENT_QUIET OFF) FetchContent_Declare( p4runtime GIT_REPOSITORY https://github.com/p4lang/p4runtime.git - GIT_TAG d76a3640a223f47a43dc34e5565b72e43796ba57 + GIT_TAG 1e771c4e05c4e7e250df00212b3ca02ee3202d71 GIT_PROGRESS TRUE ) FetchContent_MakeAvailable(p4runtime) diff --git a/bazel/p4c_deps.bzl b/bazel/p4c_deps.bzl index 7617b282cc..58c399621c 100644 --- a/bazel/p4c_deps.bzl +++ b/bazel/p4c_deps.bzl @@ -43,8 +43,8 @@ filegroup( git_repository( name = "com_github_p4lang_p4runtime", remote = "https://github.com/p4lang/p4runtime", - # Newest commit on main branch as of April 11, 2023. - commit = "d76a3640a223f47a43dc34e5565b72e43796ba57", + # Newest commit on main branch as of August 11, 2023. + commit = "1e771c4e05c4e7e250df00212b3ca02ee3202d71", shallow_since = "1680213111 -0700", # strip_prefix is broken; we use patch_cmds as a workaround, # see https://github.com/bazelbuild/bazel/issues/10062. diff --git a/control-plane/p4RuntimeSerializer.cpp b/control-plane/p4RuntimeSerializer.cpp index 8b75e36f08..c2c39fcd28 100644 --- a/control-plane/p4RuntimeSerializer.cpp +++ b/control-plane/p4RuntimeSerializer.cpp @@ -297,6 +297,15 @@ static bool getConstTable(const IR::P4Table *table) { return ep->isConstant; } +/// @return true if @table has an 'entries' or 'const entries' +/// property, and there is at least one entry. +static bool getHasInitialEntries(const IR::P4Table *table) { + BUG_CHECK(table != nullptr, "Failed precondition for getHasInitialEntries"); + auto entriesList = table->getEntries(); + if (entriesList == nullptr) return false; + return (entriesList->entries.size() >= 1); +} + static std::vector getActionRefs(const IR::P4Table *table, ReferenceMap *refMap) { std::vector actions; for (auto action : table->getActionList()->actionList) { @@ -655,6 +664,7 @@ class P4RuntimeAnalyzer { auto actions = getActionRefs(tableDeclaration, refMap); bool isConstTable = getConstTable(tableDeclaration); + bool hasInitialEntries = getHasInitialEntries(tableDeclaration); auto name = archHandler->getControlPlaneName(tableBlock); auto annotations = tableDeclaration->to(); @@ -712,6 +722,9 @@ class P4RuntimeAnalyzer { if (isConstTable) { table->set_is_const_table(true); } + if (hasInitialEntries) { + table->set_has_initial_entries(true); + } archHandler->addTableProperties(symbols, p4Info, table, tableBlock); } @@ -973,9 +986,9 @@ static void analyzeParser(P4RuntimeAnalyzer &analyzer, const IR::ParserBlock *pa } } -/// A converter which translates the 'const entries' for P4 tables (if any) -/// into a P4Runtime WriteRequest message which can be used by a target to -/// initialize its tables. +/// A converter which translates the 'entries' or 'const entries' for +/// P4 tables (if any) into a P4Runtime WriteRequest message which can +/// be used by a target to initialize its tables. class P4RuntimeEntriesConverter { private: friend class P4RuntimeAnalyzer; @@ -1012,6 +1025,7 @@ class P4RuntimeEntriesConverter { protoEntry->set_table_id(tableId); addMatchKey(protoEntry, table, e->getKeys(), refMap, typeMap); addAction(protoEntry, e->getAction(), refMap, typeMap); + protoEntry->set_is_const(isConst || e->isConst); if (needsPriority) { if (!isConst) { // The entry has a priority, use it. diff --git a/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4.entries.txt b/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4.entries.txt index 450174ce15..6bea237625 100644 --- a/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4.entries.txt +++ b/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4.entries.txt @@ -19,6 +19,7 @@ updates { } } } + is_const: true } } } @@ -43,6 +44,7 @@ updates { } } } + is_const: true } } } @@ -60,6 +62,7 @@ updates { } } } + is_const: true } } } @@ -77,6 +80,7 @@ updates { } } } + is_const: true } } } @@ -101,6 +105,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4.p4info.txt b/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4.p4info.txt index 687c2a991c..bb14f3a1f6 100644 --- a/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4.p4info.txt +++ b/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4.p4info.txt @@ -21,6 +21,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4.entries.txt b/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4.entries.txt index c29040cd27..0e761c9487 100644 --- a/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4.entries.txt +++ b/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4.entries.txt @@ -24,6 +24,7 @@ updates { } } priority: 3 + is_const: true } } } @@ -48,6 +49,7 @@ updates { } } priority: 2 + is_const: true } } } @@ -72,6 +74,7 @@ updates { } } priority: 1 + is_const: true } } } diff --git a/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4.p4info.txt b/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4.p4info.txt index cd455d0950..d21b80de87 100644 --- a/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4.p4info.txt +++ b/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4.p4info.txt @@ -27,6 +27,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/action-two-params.p4.entries.txt b/testdata/p4_16_samples_outputs/action-two-params.p4.entries.txt index ba6b99da56..f5098fe0da 100644 --- a/testdata/p4_16_samples_outputs/action-two-params.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/action-two-params.p4.entries.txt @@ -22,6 +22,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/action-two-params.p4.p4info.txt b/testdata/p4_16_samples_outputs/action-two-params.p4.p4info.txt index e8713cefd8..a5dfd9082a 100644 --- a/testdata/p4_16_samples_outputs/action-two-params.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/action-two-params.p4.p4info.txt @@ -22,6 +22,7 @@ tables { const_default_action_id: 25652968 size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/bvec-hdr-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/bvec-hdr-bmv2.p4.entries.txt index ea865f5060..5b7ad00eac 100644 --- a/testdata/p4_16_samples_outputs/bvec-hdr-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/bvec-hdr-bmv2.p4.entries.txt @@ -18,6 +18,7 @@ updates { } } } + is_const: true } } } @@ -41,6 +42,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/bvec-hdr-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/bvec-hdr-bmv2.p4.p4info.txt index 6f599d7c72..2f5fc3e851 100644 --- a/testdata/p4_16_samples_outputs/bvec-hdr-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/bvec-hdr-bmv2.p4.p4info.txt @@ -21,6 +21,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/checksum-l4-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/checksum-l4-bmv2.p4.entries.txt index 9c379f4ccd..0c22579676 100644 --- a/testdata/p4_16_samples_outputs/checksum-l4-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/checksum-l4-bmv2.p4.entries.txt @@ -14,6 +14,7 @@ updates { action_id: 25440736 } } + is_const: true } } } @@ -33,6 +34,7 @@ updates { action_id: 18556685 } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/checksum-l4-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/checksum-l4-bmv2.p4.p4info.txt index 879ec1f8ab..e223e1b5ff 100644 --- a/testdata/p4_16_samples_outputs/checksum-l4-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/checksum-l4-bmv2.p4.p4info.txt @@ -22,6 +22,7 @@ tables { const_default_action_id: 21257015 size: 1024 is_const_table: true + has_initial_entries: true } tables { preamble { @@ -44,6 +45,7 @@ tables { const_default_action_id: 21257015 size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/crc32-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/crc32-bmv2.p4.entries.txt index b46d59913e..6c7ec24ef9 100644 --- a/testdata/p4_16_samples_outputs/crc32-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/crc32-bmv2.p4.entries.txt @@ -14,6 +14,7 @@ updates { action_id: 24785092 } } + is_const: true } } } @@ -33,6 +34,7 @@ updates { action_id: 22867470 } } + is_const: true } } } @@ -52,6 +54,7 @@ updates { action_id: 32601303 } } + is_const: true } } } @@ -71,6 +74,7 @@ updates { action_id: 17405675 } } + is_const: true } } } @@ -90,6 +94,7 @@ updates { action_id: 31935968 } } + is_const: true } } } @@ -109,6 +114,7 @@ updates { action_id: 24997060 } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/crc32-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/crc32-bmv2.p4.p4info.txt index a5eabc420b..27acd85a82 100644 --- a/testdata/p4_16_samples_outputs/crc32-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/crc32-bmv2.p4.p4info.txt @@ -37,6 +37,7 @@ tables { const_default_action_id: 32121835 size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/init-entries-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/init-entries-bmv2.p4.entries.txt index b7a2d90434..b0c3482d93 100644 --- a/testdata/p4_16_samples_outputs/init-entries-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/init-entries-bmv2.p4.entries.txt @@ -26,6 +26,7 @@ updates { } } priority: 10 + is_const: true } } } @@ -119,6 +120,7 @@ updates { } } priority: 40 + is_const: true } } } @@ -205,6 +207,7 @@ updates { } } priority: 10 + is_const: true } } } @@ -298,6 +301,7 @@ updates { } } priority: 40 + is_const: true } } } @@ -384,6 +388,7 @@ updates { } } priority: 11 + is_const: true } } } @@ -477,6 +482,7 @@ updates { } } priority: 41 + is_const: true } } } @@ -563,6 +569,7 @@ updates { } } priority: 11 + is_const: true } } } @@ -656,6 +663,7 @@ updates { } } priority: 41 + is_const: true } } } @@ -742,6 +750,7 @@ updates { } } priority: 11 + is_const: true } } } @@ -835,6 +844,7 @@ updates { } } priority: 14 + is_const: true } } } @@ -921,6 +931,7 @@ updates { } } priority: 11 + is_const: true } } } @@ -1014,6 +1025,7 @@ updates { } } priority: 14 + is_const: true } } } @@ -1100,6 +1112,7 @@ updates { } } priority: 2001 + is_const: true } } } @@ -1224,6 +1237,7 @@ updates { } } priority: 2001 + is_const: true } } } @@ -1279,6 +1293,7 @@ updates { } } priority: 2001 + is_const: true } } } @@ -1403,6 +1418,7 @@ updates { } } priority: 2001 + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/init-entries-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/init-entries-bmv2.p4.p4info.txt index 38c2f68760..d9d8d89d16 100644 --- a/testdata/p4_16_samples_outputs/init-entries-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/init-entries-bmv2.p4.p4info.txt @@ -26,6 +26,7 @@ tables { id: 26776898 } size: 1024 + has_initial_entries: true } tables { preamble { @@ -52,6 +53,7 @@ tables { id: 26776898 } size: 1024 + has_initial_entries: true } tables { preamble { @@ -78,6 +80,7 @@ tables { id: 26776898 } size: 1024 + has_initial_entries: true } tables { preamble { @@ -104,6 +107,7 @@ tables { id: 26776898 } size: 1024 + has_initial_entries: true } tables { preamble { @@ -130,6 +134,7 @@ tables { id: 26776898 } size: 1024 + has_initial_entries: true } tables { preamble { @@ -156,6 +161,7 @@ tables { id: 26776898 } size: 1024 + has_initial_entries: true } tables { preamble { @@ -182,6 +188,7 @@ tables { id: 26776898 } size: 1024 + has_initial_entries: true } tables { preamble { @@ -208,6 +215,7 @@ tables { id: 26776898 } size: 1024 + has_initial_entries: true } tables { preamble { @@ -234,6 +242,7 @@ tables { id: 26776898 } size: 1024 + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/issue1107.p4.entries.txt b/testdata/p4_16_samples_outputs/issue1107.p4.entries.txt index 32e753bc2d..200abd3975 100644 --- a/testdata/p4_16_samples_outputs/issue1107.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/issue1107.p4.entries.txt @@ -24,6 +24,7 @@ updates { } } } + is_const: true } } } @@ -53,6 +54,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/issue1107.p4.p4info.txt b/testdata/p4_16_samples_outputs/issue1107.p4.p4info.txt index f9f9516585..28be72b06f 100644 --- a/testdata/p4_16_samples_outputs/issue1107.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/issue1107.p4.p4info.txt @@ -29,6 +29,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/issue1478-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/issue1478-bmv2.p4.entries.txt index 6d333e9ff5..81b805ee9c 100644 --- a/testdata/p4_16_samples_outputs/issue1478-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/issue1478-bmv2.p4.entries.txt @@ -14,6 +14,7 @@ updates { action_id: 21257015 } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/issue1478-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/issue1478-bmv2.p4.p4info.txt index a5cfadaf7d..6af190a011 100644 --- a/testdata/p4_16_samples_outputs/issue1478-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/issue1478-bmv2.p4.p4info.txt @@ -30,6 +30,7 @@ tables { } size: 10 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/issue1834-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/issue1834-bmv2.p4.entries.txt index 76f9961a81..828d29c811 100644 --- a/testdata/p4_16_samples_outputs/issue1834-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/issue1834-bmv2.p4.entries.txt @@ -18,6 +18,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/issue1834-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/issue1834-bmv2.p4.p4info.txt index 65ced035b3..f85ba8cf5f 100644 --- a/testdata/p4_16_samples_outputs/issue1834-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/issue1834-bmv2.p4.p4info.txt @@ -23,6 +23,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/issue2904.p4.entries.txt b/testdata/p4_16_samples_outputs/issue2904.p4.entries.txt index 97ba6d5e31..43865fa18b 100644 --- a/testdata/p4_16_samples_outputs/issue2904.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/issue2904.p4.entries.txt @@ -20,6 +20,7 @@ updates { } } priority: 3 + is_const: true } } } @@ -45,6 +46,7 @@ updates { } } priority: 2 + is_const: true } } } @@ -63,6 +65,7 @@ updates { } } priority: 1 + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/issue2904.p4.p4info.txt b/testdata/p4_16_samples_outputs/issue2904.p4.p4info.txt index ee3eda7462..2ba00bce65 100644 --- a/testdata/p4_16_samples_outputs/issue2904.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/issue2904.p4.p4info.txt @@ -23,6 +23,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/issue3550.p4.entries.txt b/testdata/p4_16_samples_outputs/issue3550.p4.entries.txt index 0733f77270..151d40841e 100644 --- a/testdata/p4_16_samples_outputs/issue3550.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/issue3550.p4.entries.txt @@ -57,6 +57,7 @@ updates { } } priority: 3 + is_const: true } } } @@ -119,6 +120,7 @@ updates { } } priority: 2 + is_const: true } } } @@ -181,6 +183,7 @@ updates { } } priority: 1 + is_const: true } } } @@ -223,6 +226,7 @@ updates { } } } + is_const: true } } } @@ -265,6 +269,7 @@ updates { } } } + is_const: true } } } @@ -307,6 +312,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/issue3550.p4.p4info.txt b/testdata/p4_16_samples_outputs/issue3550.p4.p4info.txt index 6f3a4ee792..81428d399b 100644 --- a/testdata/p4_16_samples_outputs/issue3550.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/issue3550.p4.p4info.txt @@ -57,6 +57,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } tables { preamble { @@ -96,6 +97,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.entries.txt b/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.entries.txt index fd2d19bb19..2bd9f20dd3 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.entries.txt @@ -26,6 +26,7 @@ updates { } } priority: 4 + is_const: true } } } @@ -57,6 +58,7 @@ updates { } } priority: 3 + is_const: true } } } @@ -88,6 +90,7 @@ updates { } } priority: 2 + is_const: true } } } @@ -112,6 +115,7 @@ updates { } } priority: 1 + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.p4info.txt b/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.p4info.txt index 3c4077510c..a631b989c7 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/psa-dpdk-table-entries-exact-ternary.p4.p4info.txt @@ -27,6 +27,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/saturated-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/saturated-bmv2.p4.entries.txt index 297d598b43..1b88f986da 100644 --- a/testdata/p4_16_samples_outputs/saturated-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/saturated-bmv2.p4.entries.txt @@ -14,6 +14,7 @@ updates { action_id: 20896217 } } + is_const: true } } } @@ -33,6 +34,7 @@ updates { action_id: 28347782 } } + is_const: true } } } @@ -52,6 +54,7 @@ updates { action_id: 30797801 } } + is_const: true } } } @@ -71,6 +74,7 @@ updates { action_id: 18945827 } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/saturated-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/saturated-bmv2.p4.p4info.txt index 309934ae6b..d2c357dba3 100644 --- a/testdata/p4_16_samples_outputs/saturated-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/saturated-bmv2.p4.p4info.txt @@ -30,6 +30,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/table-entries-exact-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/table-entries-exact-bmv2.p4.entries.txt index ea865f5060..5b7ad00eac 100644 --- a/testdata/p4_16_samples_outputs/table-entries-exact-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/table-entries-exact-bmv2.p4.entries.txt @@ -18,6 +18,7 @@ updates { } } } + is_const: true } } } @@ -41,6 +42,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/table-entries-exact-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/table-entries-exact-bmv2.p4.p4info.txt index 09e33c173e..b52b54f712 100644 --- a/testdata/p4_16_samples_outputs/table-entries-exact-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/table-entries-exact-bmv2.p4.p4info.txt @@ -21,6 +21,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/table-entries-exact-ternary-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/table-entries-exact-ternary-bmv2.p4.entries.txt index fd2d19bb19..2bd9f20dd3 100644 --- a/testdata/p4_16_samples_outputs/table-entries-exact-ternary-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/table-entries-exact-ternary-bmv2.p4.entries.txt @@ -26,6 +26,7 @@ updates { } } priority: 4 + is_const: true } } } @@ -57,6 +58,7 @@ updates { } } priority: 3 + is_const: true } } } @@ -88,6 +90,7 @@ updates { } } priority: 2 + is_const: true } } } @@ -112,6 +115,7 @@ updates { } } priority: 1 + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/table-entries-exact-ternary-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/table-entries-exact-ternary-bmv2.p4.p4info.txt index 6d7a19b999..ff0b5e462b 100644 --- a/testdata/p4_16_samples_outputs/table-entries-exact-ternary-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/table-entries-exact-ternary-bmv2.p4.p4info.txt @@ -27,6 +27,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/table-entries-lpm-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/table-entries-lpm-bmv2.p4.entries.txt index 00b364fe64..394a7866f3 100644 --- a/testdata/p4_16_samples_outputs/table-entries-lpm-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/table-entries-lpm-bmv2.p4.entries.txt @@ -19,6 +19,7 @@ updates { } } } + is_const: true } } } @@ -43,6 +44,7 @@ updates { } } } + is_const: true } } } @@ -60,6 +62,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/table-entries-lpm-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/table-entries-lpm-bmv2.p4.p4info.txt index 687c2a991c..bb14f3a1f6 100644 --- a/testdata/p4_16_samples_outputs/table-entries-lpm-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/table-entries-lpm-bmv2.p4.p4info.txt @@ -21,6 +21,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/table-entries-optional-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/table-entries-optional-bmv2.p4.entries.txt index 61e9d52698..c84154cf6e 100644 --- a/testdata/p4_16_samples_outputs/table-entries-optional-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/table-entries-optional-bmv2.p4.entries.txt @@ -25,6 +25,7 @@ updates { } } priority: 4 + is_const: true } } } @@ -49,6 +50,7 @@ updates { } } priority: 3 + is_const: true } } } @@ -73,6 +75,7 @@ updates { } } priority: 2 + is_const: true } } } @@ -91,6 +94,7 @@ updates { } } priority: 1 + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/table-entries-optional-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/table-entries-optional-bmv2.p4.p4info.txt index cd455d0950..d21b80de87 100644 --- a/testdata/p4_16_samples_outputs/table-entries-optional-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/table-entries-optional-bmv2.p4.p4info.txt @@ -27,6 +27,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4.entries.txt index 8abf680237..dc8017acc7 100644 --- a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4.entries.txt @@ -20,6 +20,7 @@ updates { } } priority: 3 + is_const: true } } } @@ -45,6 +46,7 @@ updates { } } priority: 2 + is_const: true } } } @@ -70,6 +72,7 @@ updates { } } priority: 1 + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4.p4info.txt index 7ff1fa629d..7302ed9948 100644 --- a/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/table-entries-priority-bmv2.p4.p4info.txt @@ -21,6 +21,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/table-entries-range-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/table-entries-range-bmv2.p4.entries.txt index 5941d56de5..ff3d88278f 100644 --- a/testdata/p4_16_samples_outputs/table-entries-range-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/table-entries-range-bmv2.p4.entries.txt @@ -20,6 +20,7 @@ updates { } } priority: 4 + is_const: true } } } @@ -45,6 +46,7 @@ updates { } } priority: 3 + is_const: true } } } @@ -70,6 +72,7 @@ updates { } } priority: 2 + is_const: true } } } @@ -88,6 +91,7 @@ updates { } } priority: 1 + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/table-entries-range-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/table-entries-range-bmv2.p4.p4info.txt index 05eb7c6d2f..a10bbe3154 100644 --- a/testdata/p4_16_samples_outputs/table-entries-range-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/table-entries-range-bmv2.p4.p4info.txt @@ -21,6 +21,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/table-entries-ser-enum-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/table-entries-ser-enum-bmv2.p4.entries.txt index dff14368d0..3dfb64b557 100644 --- a/testdata/p4_16_samples_outputs/table-entries-ser-enum-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/table-entries-ser-enum-bmv2.p4.entries.txt @@ -19,6 +19,7 @@ updates { } } priority: 3 + is_const: true } } } @@ -50,6 +51,7 @@ updates { } } priority: 2 + is_const: true } } } @@ -74,6 +76,7 @@ updates { } } priority: 1 + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/table-entries-ser-enum-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/table-entries-ser-enum-bmv2.p4.p4info.txt index 5ab1fab998..cdffc59089 100644 --- a/testdata/p4_16_samples_outputs/table-entries-ser-enum-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/table-entries-ser-enum-bmv2.p4.p4info.txt @@ -28,6 +28,7 @@ tables { const_default_action_id: 21186165 size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/table-entries-ternary-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/table-entries-ternary-bmv2.p4.entries.txt index ce1e15996f..f56353d94a 100644 --- a/testdata/p4_16_samples_outputs/table-entries-ternary-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/table-entries-ternary-bmv2.p4.entries.txt @@ -20,6 +20,7 @@ updates { } } priority: 4 + is_const: true } } } @@ -45,6 +46,7 @@ updates { } } priority: 3 + is_const: true } } } @@ -70,6 +72,7 @@ updates { } } priority: 2 + is_const: true } } } @@ -88,6 +91,7 @@ updates { } } priority: 1 + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/table-entries-ternary-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/table-entries-ternary-bmv2.p4.p4info.txt index 7ff1fa629d..7302ed9948 100644 --- a/testdata/p4_16_samples_outputs/table-entries-ternary-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/table-entries-ternary-bmv2.p4.p4info.txt @@ -21,6 +21,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/table-entries-valid-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/table-entries-valid-bmv2.p4.entries.txt index 837d6136c6..29a4c73690 100644 --- a/testdata/p4_16_samples_outputs/table-entries-valid-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/table-entries-valid-bmv2.p4.entries.txt @@ -24,6 +24,7 @@ updates { } } } + is_const: true } } } @@ -53,6 +54,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/table-entries-valid-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/table-entries-valid-bmv2.p4.p4info.txt index 669f24b2ce..5bcd40fbad 100644 --- a/testdata/p4_16_samples_outputs/table-entries-valid-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/table-entries-valid-bmv2.p4.p4info.txt @@ -27,6 +27,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/table-key-serenum-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/table-key-serenum-bmv2.p4.entries.txt index e9c10d03ca..1770910217 100644 --- a/testdata/p4_16_samples_outputs/table-key-serenum-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/table-key-serenum-bmv2.p4.entries.txt @@ -18,6 +18,7 @@ updates { } } } + is_const: true } } } @@ -41,6 +42,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/table-key-serenum-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/table-key-serenum-bmv2.p4.p4info.txt index 569d42619c..06f09e715b 100644 --- a/testdata/p4_16_samples_outputs/table-key-serenum-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/table-key-serenum-bmv2.p4.p4info.txt @@ -23,6 +23,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/v1model-const-entries-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/v1model-const-entries-bmv2.p4.entries.txt index 8701a5ca90..5244fedda1 100644 --- a/testdata/p4_16_samples_outputs/v1model-const-entries-bmv2.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/v1model-const-entries-bmv2.p4.entries.txt @@ -19,6 +19,7 @@ updates { } } } + is_const: true } } } @@ -43,6 +44,7 @@ updates { } } } + is_const: true } } } @@ -60,6 +62,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/v1model-const-entries-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/v1model-const-entries-bmv2.p4.p4info.txt index baf5e01bf2..e810ff3caa 100644 --- a/testdata/p4_16_samples_outputs/v1model-const-entries-bmv2.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/v1model-const-entries-bmv2.p4.p4info.txt @@ -22,6 +22,7 @@ tables { const_default_action_id: 30352513 size: 1024 is_const_table: true + has_initial_entries: true } actions { preamble { diff --git a/testdata/p4_16_samples_outputs/xor_test.p4.entries.txt b/testdata/p4_16_samples_outputs/xor_test.p4.entries.txt index 169a934324..f8ed8c80bf 100644 --- a/testdata/p4_16_samples_outputs/xor_test.p4.entries.txt +++ b/testdata/p4_16_samples_outputs/xor_test.p4.entries.txt @@ -18,6 +18,7 @@ updates { } } } + is_const: true } } } @@ -41,6 +42,7 @@ updates { } } } + is_const: true } } } diff --git a/testdata/p4_16_samples_outputs/xor_test.p4.p4info.txt b/testdata/p4_16_samples_outputs/xor_test.p4.p4info.txt index a281669916..6bdb5d6680 100644 --- a/testdata/p4_16_samples_outputs/xor_test.p4.p4info.txt +++ b/testdata/p4_16_samples_outputs/xor_test.p4.p4info.txt @@ -21,6 +21,7 @@ tables { } size: 1024 is_const_table: true + has_initial_entries: true } tables { preamble {