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

More comments wanted for basic.p4 #97

Open
liujed opened this issue Nov 13, 2017 · 2 comments
Open

More comments wanted for basic.p4 #97

liujed opened this issue Nov 13, 2017 · 2 comments

Comments

@liujed
Copy link
Member

liujed commented Nov 13, 2017

Since basic.p4 is a first look at a P4 program, I think more comments would be nice. For example, it would be helpful to have a comment on ipv4_forward() saying that the dstAddr and port arguments (1) are provided as action data when the control plane fills out the ipv4_lpm table, and (2) indicate the Ethernet destination and port number on which the packet should be forwarded.

@jafingerhut
Copy link
Collaborator

As an example of a different P4 program with comments intended for someone brand new to P4, to learn a few things from the comments, you can take a look at this one:

https://github.com/jafingerhut/p4-guide/blob/master/demo1/demo1-heavily-commented.p4_16.p4

It may be more verbose in its comments than you want, but you are welcome to copy any or all of it and adapt it for the tutorials, if you find it helpful.

@jnfoster
Copy link
Contributor

Thanks @jafingerhut!

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

No branches or pull requests

3 participants