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

Handle bfrt Info for new type #3103

Merged
merged 1 commit into from
Mar 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
6 changes: 1 addition & 5 deletions backends/dpdk/DpdkXfail.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
p4c_add_xfail_reason("dpdk"
"error: Error when generating BF-RT info for 'Digest' .*: packed type is too complex"
testdata/p4_16_samples/psa-example-digest-bmv2.p4
)

p4c_add_xfail_reason("dpdk"
"Expected packet length argument for"
testdata/p4_16_samples/psa-example-counters-bmv2.p4
Expand Down Expand Up @@ -46,6 +41,7 @@ p4c_add_xfail_reason("dpdk"

p4c_add_xfail_reason("dpdk"
"Unknown extern function"
testdata/p4_16_samples/psa-example-digest-bmv2.p4
testdata/p4_16_samples/psa-example-parser-checksum.p4
testdata/p4_16_samples/psa-meter6.p4
)
Expand Down
10 changes: 10 additions & 0 deletions control-plane/bfruntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ TypeSpecParser TypeSpecParser::make(const p4configv1::P4Info& p4info,
type = makeTypeBytes(fSpec.bitstring().varbit().max_bitwidth());
} else if (fSpec.has_bool_()) {
type = makeTypeBool(1);
} else if (fSpec.has_new_type()) {
auto newtypes = typeInfo.new_types();
auto typeName = fSpec.new_type().name();
auto newType = newtypes.find(typeName);
if (newType == newtypes.end()) {
::error("New type '%1%' not found in typeInfo for '%2%' '%3%'",
typeName, instanceType, instanceName);
return;
}
type = makeTypeBytes(newType->second.translated_type().sdn_bitwidth());
}

if (!type) {
Expand Down