-
Notifications
You must be signed in to change notification settings - Fork 445
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
Conversation
@@ -48,6 +48,8 @@ extern packet_out { | |||
void emit<T>(in T hdr); | |||
} | |||
|
|||
extern void truncate(in bit<32> length); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
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? |
Perhaps truncate should be a method of packet_out then? But that would
require having packet_out as an argument to other than the deparser, or
having a way of doing things other than emit in a deparser.
…On Wed, Nov 30, 2016 at 10:25 AM, Mihai Budiu ***@***.***> wrote:
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?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#157 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AD4c8ekyGSL6zo35Fu5w4bdwsP3_9mxcks5rDb-QgaJpZM4K7Pm2>
.
|
After I merge this I plan to move truncate to v1model.p4. |
No description provided.