p4lang / p4runtime

Specification documents for the P4Runtime control-plane API
Apache License 2.0
140 stars 86 forks source link

Changes for language spec update? Allow ranges to be specified by serializable enums #451

Open jafingerhut opened 10 months ago

jafingerhut commented 10 months ago

This issue should be closed exactly when the bullet item “Allow ranges to be specified by serializable enums” in Section 1.1 "P4 Language Version Applicability" is addressed and removed.

This issue is related to the following change made from v1.2.3 to v1.2.4 of the P4_16 language specification:

The emphasized text in the next sentence is the changed part. Before a range was restricted to endpoints with type int, bit<W>, or int<W>. By saying instead a "numeric type", that also allows serializable enum values to be the endpoints of ranges. Note that these ranges are in P4_16 source code, e.g. in parser select branches, or in entries definitions of tables with keys having match_kind range, so this might not affect the P4Runtime API at all.

The infix operator .. takes two arguments of the same numeric type T (Section 7.4),

(see https://p4.org/p4-spec/docs/P4-16-v1.2.4.html#sec-summary-of-changes-made-in-version-124 for the item in context of the full list of changes, but there are separate Github issues for each that might impact the P4Runtime API specification).