tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

More comments wanted for basic.p4

Open liujed opened this issue 8 years ago • 2 comments

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.

liujed avatar Nov 13 '17 23:11 liujed

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.

jafingerhut avatar Nov 14 '17 18:11 jafingerhut

Thanks @jafingerhut!

jnfoster avatar Nov 15 '17 03:11 jnfoster