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

Fix flawed code in up4.p4 and the pins switch models. #3857

Merged
merged 4 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,9 @@ control PreQosPipe(inout parsed_headers_t hdr, inout local_metadata_t local_meta
}
}
}
Routing.apply(hdr, local_meta, std_meta);
if (hdr.ipv4.isValid()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't it be better if Routing control checks if the header is valid?
I would assume Acl control would need the same check too ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. For ACL, I believe BMv2 will not match if one of the keys is from an invalid header, but it is better to be safe.

Routing.apply(hdr, local_meta, std_meta);
}
Acl.apply(hdr, local_meta, std_meta);
}
}
Expand Down
9 changes: 0 additions & 9 deletions testdata/p4_16_samples/pins/pins_fabric.p4
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,6 @@ enum bit<8> PreservedFieldList {
CLONE_I2E = 8w1
}

@p4runtime_translation("" , string) type bit<10> nexthop_id_t;
@p4runtime_translation("" , string) type bit<10> tunnel_id_t;
@p4runtime_translation("" , string) type bit<12> wcmp_group_id_t;
@p4runtime_translation("" , string) @p4runtime_translation_mappings({ { "" , 0 } , }) type bit<10> vrf_id_t;
const vrf_id_t kDefaultVrf = 0;
@p4runtime_translation("" , string) type bit<10> router_interface_id_t;
@p4runtime_translation("" , string) type bit<9> port_id_t;
@p4runtime_translation("" , string) type bit<10> mirror_session_id_t;
@p4runtime_translation("" , string) type bit<8> qos_queue_t;
typedef bit<6> route_metadata_t;
enum bit<2> MeterColor_t {
GREEN = 0,
Expand Down
9 changes: 0 additions & 9 deletions testdata/p4_16_samples_outputs/pins/pins_middleblock.p4
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,6 @@ enum bit<8> PreservedFieldList {
CLONE_I2E = 8w1
}

@p4runtime_translation("" , string) type bit<10> nexthop_id_t;
@p4runtime_translation("" , string) type bit<10> tunnel_id_t;
@p4runtime_translation("" , string) type bit<12> wcmp_group_id_t;
@p4runtime_translation("" , string) @p4runtime_translation_mappings({ { "" , 0 } , }) type bit<10> vrf_id_t;
const vrf_id_t kDefaultVrf = 0;
@p4runtime_translation("" , string) type bit<10> router_interface_id_t;
@p4runtime_translation("" , string) type bit<9> port_id_t;
@p4runtime_translation("" , string) type bit<10> mirror_session_id_t;
@p4runtime_translation("" , string) type bit<8> qos_queue_t;
typedef bit<6> route_metadata_t;
enum bit<2> MeterColor_t {
GREEN = 0,
Expand Down
9 changes: 0 additions & 9 deletions testdata/p4_16_samples_outputs/pins/pins_wbb.p4
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,6 @@ enum bit<8> PreservedFieldList {
CLONE_I2E = 8w1
}

@p4runtime_translation("" , string) type bit<10> nexthop_id_t;
@p4runtime_translation("" , string) type bit<10> tunnel_id_t;
@p4runtime_translation("" , string) type bit<12> wcmp_group_id_t;
@p4runtime_translation("" , string) @p4runtime_translation_mappings({ { "" , 0 } , }) type bit<10> vrf_id_t;
const vrf_id_t kDefaultVrf = 0;
@p4runtime_translation("" , string) type bit<10> router_interface_id_t;
@p4runtime_translation("" , string) type bit<9> port_id_t;
@p4runtime_translation("" , string) type bit<10> mirror_session_id_t;
@p4runtime_translation("" , string) type bit<8> qos_queue_t;
typedef bit<6> route_metadata_t;
enum bit<2> MeterColor_t {
GREEN = 0,
Expand Down