[P4-dev] Finding documentation sometimes is hard.

Mihai Budiu mbudiu at vmware.com
Tue Oct 17 12:01:07 EDT 2017

Indeed, v1model.p4 is not well-documented. V1model was intended to be a temporary solution for allowing p4-14 programs to be supported; however, this temporary solution is now turning 2 (years old), so probably should have been better documented to start with. 

V1model.p4 is really a representation of the P4-14 switch architecture model in P4-16. The P4-14 switch architecture is documented as part of the P4-14 spec https://github.com/p4lang/p4-spec/tree/master/p4-14/v1.0.4/tex. So your best bet for understanding v1model is to actually read the P4-14 spec itself. But some of these questions may not even have an answer there.

There is also a document, somewhat out-of-date, which shows how P4-14 programs are translated to P4-16 programs; that includes some details that are pertinent. The document is part of the P4-16 spec repository: 

BTW: we are very glad to accept contributions that improve on this state of affairs. Please feel free to submit contributions to v1model documentation in any way, including better comments.

For the future, there is an working group which is defining a Portable Switch Architecture, which will replace v1model going forward (but may lose backwards compatibility with P4-14 programs). That architecture will be much better documented:


-----Original Message-----
From: P4-dev [mailto:p4-dev-bounces at lists.p4.org] On Behalf Of ec
Sent: Tuesday, October 17, 2017 7:17 AM
To: p4-dev at lists.p4.org
Subject: [P4-dev] Finding documentation sometimes is hard.

Hi all,

Since p4-16 part of the specification has been moved into libraries and some of them are architecture-specific, for example v1model.p4 would be one of them.

Is there a way to find documentation for those specific libraries ? Sometimes just looking into the file is not enough (since things are not well commented). For example how do you know what is modified at ingress or egress? What does it make sense to access them ? (for example standard_metadata.egress_spec can only be written at ingess and then its value is reset at egress).

So far the only why i found to answer this is:

1) Learning from examples and try to deduce how to use them.
2) Trial and error
3) Hoping that someone asked what you want in the mailing list.

is there a way were we can find this detailed information ? 

P4-dev mailing list
P4-dev at lists.p4.org

More information about the P4-dev mailing list