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

Conversation

fruffy
Copy link
Collaborator

@fruffy fruffy commented Jan 23, 2023

up.p4 was not checking whether the IPv4 header is valid before applying the routing control, which reads from the IPv4 header.

The PINS programs uses the p4runtime_translation annotation, which is currently not supported by PI (p4lang/PI#585).

@@ -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.

@fruffy fruffy added the p4tools Topics related to the P4Tools back end label Jan 24, 2023
@fruffy fruffy merged commit 1f34073 into main Jan 26, 2023
@fruffy fruffy deleted the fruffy/pins_fixes branch January 27, 2023 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4tools Topics related to the P4Tools back end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants