[P4-arch] P4-API handling of enum types, and possible relationship to port ID types

Andy Fingerhut andy.fingerhut at gmail.com
Mon Sep 4 23:07:50 EDT 2017

There has been quite a bit of discussion on how to handling a port ID type
in the PSA, e.g. on this Github issue:

One point made during some of that discussion was that port IDs could be
treated somewhat similarly to enum types.  enum types are similar to what
Vladimir Gurevich has proposed for port ID types, in that their bit level
representation and widths can vary across P4_16 implementations, and thus
if a P4-API controller wishes to use enum type values as search key fields
of a table, or action parameters, there must be some part of the system
between the P4-API controller and the P4 program that performs this
conversion, probably what Vladimir has called a P4-API agent (software that
processes the messages from a P4-API controller, and handles it in a way
specific to a particular P4 implementation).


Is it the plan that P4-API can support adding table entries to a P4_16
table with an enum type as a search key field?

If so, how would the values of this enum type be represented in the Google
Protocol Buffers messages?  Text strings?  If integer code points, how
would the numerical values of those integer code points be decided?

The same set of questions as above, except for a P4_16 action with an enum
type as an action parameter.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-arch_lists.p4.org/attachments/20170904/3aea4c02/attachment-0002.html>

More information about the P4-arch mailing list