Skip to content

Commit

Permalink
Allow indirect tables to have default actions declared const in P4
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Fingerhut <[email protected]>
  • Loading branch information
jafingerhut committed Jan 19, 2025
1 parent 87e6bf3 commit 686a57c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/bm_sim/P4Objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1867,13 +1867,7 @@ P4Objects::init_pipelines(const Json::Value &cfg_root,
const Json::Value false_value(false);
const bool is_action_const =
cfg_default_entry.get("action_const", false_value).asBool();
if (table_type != "simple" && is_action_const) {
throw json_exception(
EFormat() << "Table '" << table_name << "' does not have type "
<< "'simple' and therefore setting 'action_const' to "
<< "true is meaningless",
cfg_table);
} else if (is_action_const) {
if (is_action_const) {
auto simple_table = dynamic_cast<MatchTable *>(table);
assert(simple_table);
simple_table->set_const_default_action_fn(action);
Expand Down

0 comments on commit 686a57c

Please sign in to comment.