p4runtime icon indicating copy to clipboard operation
p4runtime copied to clipboard

use Preamble for MatchField?

Open blp opened this issue 5 years ago • 1 comments

The MatchField message contains everything in Preamble except for alias. It's not clear to me why MatchField doesn't just use Preamble. Perhaps it is because the id is scoped differently, but I'm not sure about that.

blp avatar Aug 25 '20 18:08 blp

I don't have a great answer for this. I think the idea was to reserve Preamble for "top-level" P4 objects which expose a control-plane API, and for which the ids share the same number space (https://github.com/p4lang/p4runtime/blob/6a457c2eb594a09c60a2930c93b552e85e816daa/proto/p4/config/v1/p4info.proto#L115-L124). Match fields - as well as action parameters - indeed use a local scope for their ids (local to the table / the action). That doesn't mean we couldn't use the same Preamble Protobuf message since syntactically we include the same information, but I believe the idea was to emphasize the different between the 2 by not using the same message.

antoninbas avatar Aug 26 '20 19:08 antoninbas