Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change tc template define #4949

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backends/tc/tc.def
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ class TCPipeline {
}
toString {
std::string tcCode = absl::StrCat("#!/bin/bash -x\n",
"\nset -e\n", "\nTC=\"tc\"",
"\nset -e\n", "\n: \"${TC:=\"tc\"}\"",
"\n$TC p4template create pipeline/", pipelineName.string_view(),
" numtables ", numTables);
if (!actionDefs.empty()) {
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/add_entry_1_example.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/add_entry_1_example numtables 1

$TC p4template create action/add_entry_1_example/MainControlImpl/send_nh actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/add_entry_3_example.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/add_entry_3_example numtables 1

$TC p4template create action/add_entry_3_example/MainControlImpl/send_nh actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/add_entry_example.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/add_entry_example numtables 2

$TC p4template create action/add_entry_example/MainControlImpl/next_hop actid 1
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/calculator.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/calculator numtables 1

$TC p4template create action/calculator/MainControlImpl/operation_add actid 1
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/checksum.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/checksum numtables 1

$TC p4template create action/checksum/ingress/send_nh actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/const_entries_range_mask numtables 1

$TC p4template create action/const_entries_range_mask/MainControlImpl/a actid 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/default_action_example numtables 2

$TC p4template create action/default_action_example/MainControlImpl/next_hop actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/default_action_example_01 numtables 2

$TC p4template create action/default_action_example_01/MainControlImpl/next_hop actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/default_action_with_param numtables 2

$TC p4template create action/default_action_with_param/MainControlImpl/next_hop actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/default_action_with_param_01 numtables 2

$TC p4template create action/default_action_with_param_01/MainControlImpl/next_hop actid 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/default_hit_const_example numtables 1

$TC p4template create action/default_hit_const_example/MainControlImpl/tcp_syn_packet actid 1
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/digest.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/digest numtables 1

$TC p4template create action/digest/ingress/send_nh actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/digest_01.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/digest_01 numtables 1

$TC p4template create action/digest_01/ingress/send_nh actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/direct_counter_example numtables 1

$TC p4template create action/direct_counter_example/ingress/send_nh actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/direct_meter.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/direct_meter numtables 1

$TC p4template create action/direct_meter/ingress/meter_exec actid 1
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/direct_meter_color.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/direct_meter_color numtables 1

$TC p4template create action/direct_meter_color/ingress/meter_exec actid 1
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/drop_packet_example.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/drop_packet_example numtables 1

$TC p4template create action/drop_packet_example/MainControlImpl/next_hop actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/global_action_example_01 numtables 2

$TC p4template create action/global_action_example_01/send_nh actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/global_action_example_02 numtables 2

$TC p4template create action/global_action_example_02/drop actid 1
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/hash1.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/hash1 numtables 0
$TC p4template update pipeline/hash1 state ready
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/indirect_counter_01_example numtables 1

$TC p4template create action/indirect_counter_01_example/ingress/send_nh actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/internetchecksum_01.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/internetchecksum_01 numtables 1

$TC p4template create action/internetchecksum_01/ingress/set_ipip_csum actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/ipip.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/ipip numtables 1

$TC p4template create action/ipip/Main/set_ipip actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/is_host_port.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/is_host_port numtables 1

$TC p4template create action/is_host_port/ingress/send_nh actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/is_net_port.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/is_net_port numtables 1

$TC p4template create action/is_net_port/ingress/send_nh actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/matchtype.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/matchtype numtables 4

$TC p4template create action/matchtype/MainControlImpl/next_hop actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/meter.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/meter numtables 1

$TC p4template create action/meter/ingress/meter_exec actid 1
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/meter_color.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/meter_color numtables 1

$TC p4template create action/meter_color/ingress/meter_exec actid 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/mix_matchtype_example numtables 4

$TC p4template create action/mix_matchtype_example/MainControlImpl/next_hop actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/multiple_tables_example_01 numtables 7

$TC p4template create action/multiple_tables_example_01/MainControlImpl/next_hop actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/multiple_tables_example_02 numtables 7

$TC p4template create action/multiple_tables_example_02/MainControlImpl/next_hop actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/name_annotation_example numtables 2

$TC p4template create action/name_annotation_example/MainControlImpl/next_hop actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/no_table_example.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/no_table_example numtables 0
$TC p4template update pipeline/no_table_example state ready
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/noaction_example_01.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/noaction_example_01 numtables 2

$TC p4template create action/noaction_example_01/MainControlImpl/next_hop actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/noaction_example_02.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/noaction_example_02 numtables 2

$TC p4template create action/noaction_example_02/MainControlImpl/next_hop actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/nummask_annotation_example numtables 1

$TC p4template create action/nummask_annotation_example/MainControlImpl/tcp_syn_packet actid 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/send_to_port_example numtables 1

$TC p4template create action/send_to_port_example/MainControlImpl/next_hop actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/set_entry_timer_example numtables 2

$TC p4template create action/set_entry_timer_example/MainControlImpl/next_hop actid 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/simple_exact_example numtables 1

$TC p4template create action/simple_exact_example/ingress/send_nh actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/simple_extern_example numtables 1

$TC p4template create action/simple_extern_example/ingress/send_nh actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/simple_lpm_example.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/simple_lpm_example numtables 1

$TC p4template create action/simple_lpm_example/ingress/send_nh actid 1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/simple_ternary_example numtables 1

$TC p4template create action/simple_ternary_example/ingress/send_nh actid 1 \
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4tc_samples_outputs/size_param_example.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

TC="tc"
: "${TC:="tc"}"
$TC p4template create pipeline/size_param_example numtables 2

$TC p4template create action/size_param_example/MainControlImpl/next_hop actid 1 \
Expand Down
Loading
Loading