Skip to content

Commit

Permalink
Add v1.4.0 comments to protobufs - fix #487 (#490)
Browse files Browse the repository at this point in the history
* Added missing "Added/deprecated in v1.4.0" comments per convention.

* Added missing "Added/deprecated in v1.4.0" comments per convention.

* Refresh generated go files.
  • Loading branch information
chrispsommers authored Aug 6, 2024
1 parent eb57617 commit f0123f7
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
6 changes: 6 additions & 0 deletions go/p4/config/v1/p4info.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 23 additions & 8 deletions go/p4/v1/p4runtime.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions proto/p4/config/v1/p4info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ message Documentation {
}

// Used to describe the required properties of the underlying platform.
// Added in v1.4.0
message PlatformProperties {
// The minimum number of multicast entries (i.e. multicast groups) that the
// platform is required to support. If 0, there are no requirements.
Expand Down Expand Up @@ -90,6 +91,7 @@ message PkgInfo {
// If set, specifies the properties that the underlying platform should have.
// If the platform does not conform to these properties, the server should
// reject the P4Info when used with a SetForwardingPipelineConfigRequest.
// Added in 1.4.0
PlatformProperties platform_properties = 11;
}

Expand Down Expand Up @@ -304,11 +306,13 @@ message ActionProfile {
// indicates that `size` and `max_group_size` represent the maximum sum of
// weights that can be present across all selector groups and within a
// single selector group respectively.
// Added in v1.4.0
message SumOfWeights {}

// indicates that `size` and `max_group_size` represent the maximum number
// of members that can be present across all selector groups and within a
// single selector group respectively.
// Added in v1.4.0
message SumOfMembers {
// the maximum weight of each individual member in a group.
optional int32 max_member_weight = 1;
Expand All @@ -317,8 +321,10 @@ message ActionProfile {
// specifies the semantics of `size` and `max_group_size` above
oneof selector_size_semantics {
// group size is the sum of the group's weights.
// Added in v1.4.0
SumOfWeights sum_of_weights = 6;
// group size is the sum of the group's members.
// Added in v1.4.0
SumOfMembers sum_of_members = 7;
}
}
Expand Down
13 changes: 13 additions & 0 deletions proto/p4/v1/p4runtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ service P4Runtime {
//------------------------------------------------------------------------------
message WriteRequest {
uint64 device_id = 1;
// Deprecated in v1.4.0
uint64 role_id = 2 [deprecated=true];
// Added in v1.4.0
string role = 6;
Uint128 election_id = 3;
// The write batch, comprising a list of Update operations. The P4Runtime
Expand Down Expand Up @@ -105,6 +107,7 @@ message WriteResponse {
message ReadRequest {
uint64 device_id = 1;
// When specified, only return table entries for the given role.
// Added in 1.4.0.
string role = 3;
repeated Entity entities = 2;
}
Expand Down Expand Up @@ -191,6 +194,7 @@ message TableEntry {
MeterConfig meter_config = 6;
CounterData counter_data = 7;
// Per color counters for tables with a direct meter.
// Added in v1.4.0
MeterCounterData meter_counter_data = 12;
// Set to true if the table entry is being used to update the non-const
// default action of the table. If true, the "match" field must be empty and
Expand Down Expand Up @@ -349,6 +353,7 @@ message MeterEntry {
uint32 meter_id = 1;
Index index = 2;
MeterConfig config = 3;
// Added in v1.4.0
MeterCounterData counter_data = 4;
}

Expand All @@ -365,6 +370,7 @@ message DirectMeterEntry {
// table_entry.action is ignored. Other fields specify the match.
TableEntry table_entry = 1;
MeterConfig config = 2;
// Added in v1.4.0
MeterCounterData counter_data = 3;
}

Expand Down Expand Up @@ -416,6 +422,7 @@ message CounterData {
int64 packet_count = 2;
}

// Added in v1.4.0
message MeterCounterData {
CounterData green = 1;
CounterData yellow = 2;
Expand All @@ -436,7 +443,9 @@ message PacketReplicationEngineEntry {
message Replica {
oneof port_kind {
// Using uint32 as ports is deprecated, use port field instead.
// Deprecated in v1.4.0
uint32 egress_port = 1 [deprecated=true];
// Added in v1.4.0
bytes port = 3;
}
uint32 instance = 2;
Expand Down Expand Up @@ -617,7 +626,9 @@ message MasterArbitrationUpdate {

message Role {
// Uniquely identifies this role.
// Deprecated in 1.4.0.
uint64 id = 1 [deprecated=true];
// Added in 1.4.0.
string name = 3;
// Describes the role configuration, i.e. what operations, P4 entities,
// behaviors, etc. are in the scope of a given role. If config is not set
Expand Down Expand Up @@ -721,7 +732,9 @@ message SetForwardingPipelineConfigRequest {
RECONCILE_AND_COMMIT = 5;
}
uint64 device_id = 1;
// Deprecated in 1.4.0.
uint64 role_id = 2 [deprecated=true];
// Added in 1.4.0.
string role = 6;
Uint128 election_id = 3;
Action action = 4;
Expand Down

0 comments on commit f0123f7

Please sign in to comment.