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

Support for truncate primitive #157

Merged
merged 1 commit into from
Nov 30, 2016
Merged

Conversation

ChrisDodd
Copy link
Contributor

No description provided.

@@ -48,6 +48,8 @@ extern packet_out {
void emit<T>(in T hdr);
}

extern void truncate(in bit<32> length);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be in an architecture-specific file, not in core.p4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The question is, is this something that should be the same in every architecture that supports it (like other things in core), or something that might be different in different architectures?

@mihaibudiu
Copy link
Contributor

My main problem is that the notion of "payload" is not well-defined. It makes sense only after the parser has run - the payload starts at the point where the parser has stopped extracting. However, where in the pipeline the parser runs is a question of architecture. Some architectures may have multiple parsers.

What happens if you call truncate in the parser?

@ChrisDodd
Copy link
Contributor Author

ChrisDodd commented Nov 30, 2016 via email

@mihaibudiu
Copy link
Contributor

After I merge this I plan to move truncate to v1model.p4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants