-
Notifications
You must be signed in to change notification settings - Fork 80
LDWG Meeting minutes: February 12, 2018
- Chris Sommers (IXIA)
- Gordon Brebner (Xilinx)
- Han Wang (Barefoot)
- Robert Halstead (Xilinx)
- Venkat Puella (Broadcom)
- Yuki (Net One Systems)
- Andy Keep (Cisco)
- Andy Fingerhut (Cisco)
- Mihai Budiu (VMware)
- Michael Miller (Mosys)
- James Coole (Cisco)
- Calin Cascaval (Barefoot)
https://github.com/p4lang/p4-spec/issues/565
Parser value sets allow the behavior of the parser to be dynamically modified by the control plane. P4_14 included support for parser value sets, but the hope was that this could be handled by the extern mechanism rather than adding a new built-in type.
Han has implemented an experimental feature in the compiler to add support for parser value_set externs.
Proposal:
- New first-class type value_set
- Size of value_set controlled by annotation
- Name of a parser value set can be used as a select case
- Typing rule is that a value_set is set.
Open questions:
- How to specify size?
- What are the restrictions on this type?
Action item: Han, Andy F, with Mihai will draft some text?
The goal of this proposal is to extend the syntax of P4_16 to support named parameters to controls, tables, actions, externs, and packages. The main motivation is to enable optional parameters to enable reducing the overhead of listing all parameters and limit the ordering constraints.
Status quo The p4c compiler currently supports optional parameters as an experimental feature. This is enabled
by the @optional
annotation followed by an ordered list of arguments. That is, if an optional
argument is present, all preceeding arguments (non-optional and optional) must be present. Optional
arguments apply to extern methods.
Design We propose the following changes:
- Calls specify parameters by name. By default, all parameters must be specified.
- Optional parameters are specified by assigning a default parameter value:
param_modifier param_type name = default_parameter_value
- We allow specifying
_
as the default value and the compiler will initialize the optional parameter with an appropriate value. - Mandatory parameters must preceed all optional parameters and all parameters must be called in the order in which they were declared. This is similar to C++, except that preceeding optional parameters can be fully omitted (as in Python).
- We only allow optional parameters for some kinds of functions:
- Constructors, including extern constructors and package constructors, controls, tables, and parsers
- Extern methods
- Actions
- Optional parameters must be either
in
or directionless
Action Item: Chris, Calin, Mihai to discuss offline and come back with a specification
https://github.com/p4lang/p4-spec/issues/556
The P4_16 specification includes a blanket statement that functional blocks are atomic and also specifies that actions and extern calls are atomic. This makes the @atomic annotation mostly redundant. The proposal (#560) changes this so that actions are merely “run to completion." Note that in the absence of externs, it seems that the semantics of a P4 program is automatically atomic.
Questions
- Q: Are control plane operations guaranteed to be atomic?
- A: The P4_16 specification leaves it up to the architecture, which is why this came up with PSA
- Q: What about multiple operations?
- A: P4 Runtime has a notion of batch
Action Item: Andy F to merge 560.
https://github.com/p4lang/p4-spec/issues/563
Action Item: Nate and Mihai to harmonize, probably by separating the notion of a control type from a control instance
https://github.com/p4lang/p4-spec/issues/561 https://github.com/p4lang/p4-spec/issues/446
Issue is whether virtual functions are allowed, or if there is problem with variable capture. Compiler front-end does not understand how the externs are implemented
Action Item: More examples that cannot be expressed without this feature
https://github.com/p4lang/p4-spec/issues/549
Idea is how to add information to P4 programs so it can make it into P4 Info. Decision was to discuss in the P4 API WG. Result of that discussion was positive. Chris implemented a tool to pull out these annotations and put them into P4 Info. Question is whether we should extend the compiler to support comments?
Action Items:
- Lexer to save comments
- Write parser for JavaDoc
- Someone has an intern project?
March 5th @ Barefoot
-
[5 minutes] PSA Pack/Unpack vs. Field Lists (Andy F) https://github.com/p4lang/p4-spec/issues/51
-
[5 minutes] Equality for Structs (Mihai) https://github.com/p4lang/p4-spec/issues/542
-
[5 minutes] Reserved Table Attributes (Andy F) https://github.com/p4lang/p4-spec/issues/514
-
[5 minutes ] Table Results (James) https://github.com/p4lang/p4-spec/issues/485
-
Empty List Types (Chris/Mihai) https://github.com/p4lang/p4-spec/issues/282
-
Width Declarations (Tom) https://github.com/p4lang/p4-spec/issues/294
-
Int Types (Mihai) https://github.com/p4lang/p4-spec/issues/331
-
Serializable Types (Andy K / James) https://github.com/p4lang/p4c/issues/861