p4lang / p4runtime

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

use Preamble for MatchField? #309

Open blp opened 4 years ago

blp commented 4 years ago

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.

antoninbas commented 4 years ago

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.