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

'size' is always a legal table property #3662

Merged
merged 1 commit into from
Nov 3, 2022
Merged
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
3 changes: 2 additions & 1 deletion backends/ebpf/midend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ const IR::ToplevelBlock* MidEnd::run(EbpfOptions& options,
});
} else {
midEnd.addPasses({
new P4::ValidateTableProperties({"implementation"})
new P4::ValidateTableProperties({ "size",
"implementation" })
});
}

Expand Down
1 change: 1 addition & 0 deletions testdata/p4_16_samples/calc-ebpf.p4
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ control Ingress(inout headers hdr,
}
/* this is required in XDP model */
implementation = hash_table(8);
size = 100;
}

apply {
Expand Down
1 change: 1 addition & 0 deletions testdata/p4_16_samples_outputs/calc-ebpf-first.p4
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ control Ingress(inout headers hdr, out bool xout) {
8w0x5e : operation_xor();
}
implementation = hash_table(32w8);
size = 100;
}
apply {
xout = true;
Expand Down
1 change: 1 addition & 0 deletions testdata/p4_16_samples_outputs/calc-ebpf-frontend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ control Ingress(inout headers hdr, out bool xout) {
8w0x5e : operation_xor();
}
implementation = hash_table(32w8);
size = 100;
}
apply {
xout = true;
Expand Down
11 changes: 6 additions & 5 deletions testdata/p4_16_samples_outputs/calc-ebpf-midend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,16 @@ control Ingress(inout headers hdr, out bool xout) {
8w0x5e : operation_xor();
}
implementation = hash_table(32w8);
size = 100;
}
@hidden action calcebpf152() {
@hidden action calcebpf153() {
xout = true;
}
@hidden table tbl_calcebpf152 {
@hidden table tbl_calcebpf153 {
actions = {
calcebpf152();
calcebpf153();
}
const default_action = calcebpf152();
const default_action = calcebpf153();
}
@hidden table tbl_operation_drop {
actions = {
Expand All @@ -151,7 +152,7 @@ control Ingress(inout headers hdr, out bool xout) {
const default_action = operation_drop_1();
}
apply {
tbl_calcebpf152.apply();
tbl_calcebpf153.apply();
if (hdr.p4calc.isValid()) {
calculate_0.apply();
} else {
Expand Down
1 change: 1 addition & 0 deletions testdata/p4_16_samples_outputs/calc-ebpf.p4
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ control Ingress(inout headers hdr, out bool xout) {
P4CALC_CARET : operation_xor();
}
implementation = hash_table(8);
size = 100;
}
apply {
xout = true;
Expand Down