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

Create and potentially include in p4c repo p4include directory a "stdheaders.p4" file #25

Open
jafingerhut opened this issue Nov 8, 2024 · 4 comments
Labels
smalltask A task that appears to require a small amount of work

Comments

@jafingerhut
Copy link
Collaborator

jafingerhut commented Nov 8, 2024

Alan Lo created a detailed proposal for the contents of such a file, which basically contained definitions for standard packet header formats like Ethernet, IPv4, IPv6, TCP, UDP, and a dozen or two others.

Alan sent me the document he wrote privately, and gave me permission to publish it under the Apache 2 license, which I have done here for now, in case others take up this work besides me:

It was discussed in (I believe) the P4 language design work group meeting during 2021.

I do recall that one of the last things discussed on this topic was to postpone it until we had implemented P4 namespaces (#3), to prevent people from having conflicts in the type names between the proposed new file, and existing header definitions they might already be using. Unfortunately the stalling of the P4 namespaces work also ended up stalling the introduction of a 'stdheaders.p4' file.

I would propose that we create a 'stdheaders.p4' file, even in the absence of an implementation of P4 namespaces, and simply tell people "use it if you like". They can always either (a) avoid using stdheaders.p4, or (b) #include it, but create their own custom definitions if they wish, as long as their custom definitions use different type names.

@fruffy fruffy added the smalltask A task that appears to require a small amount of work label Nov 8, 2024
@Dscano
Copy link

Dscano commented Nov 12, 2024

I can take care of it

@jafingerhut
Copy link
Collaborator Author

I have corresponded with Alan Lo privately to ask him about his work on this, and he has found a document that he created then. I will ask him if he is willing to publish some or all of it, and have the source code parts published under Apache 2 license, so that we can start from that.

@Dscano
Copy link

Dscano commented Nov 12, 2024

Perfect, keep me posted

@Dscano
Copy link

Dscano commented Dec 13, 2024

I have started to work on it jafingerhut/p4-guide#81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
smalltask A task that appears to require a small amount of work
Projects
None yet
Development

No branches or pull requests

3 participants