Skip to content

Commit

Permalink
Merge pull request #646 from byllyfish/proto
Browse files Browse the repository at this point in the history
Update p4runtime protobufs from HEAD.
  • Loading branch information
byllyfish authored Sep 28, 2024
2 parents bf8802c + 9e94da7 commit 98fbbec
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 13 deletions.
6 changes: 6 additions & 0 deletions finsy/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 @@ -321,11 +323,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.
int32 max_member_weight = 1;
Expand All @@ -334,8 +338,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
15 changes: 12 additions & 3 deletions finsy/proto/p4/config/v1/p4info_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ global___Documentation = Documentation

@typing.final
class PlatformProperties(google.protobuf.message.Message):
"""Used to describe the required properties of the underlying platform."""
"""Used to describe the required properties of the underlying platform.
Added in v1.4.0
"""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

Expand Down Expand Up @@ -201,6 +203,7 @@ class PkgInfo(google.protobuf.message.Message):
"""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
"""

def __init__(
Expand Down Expand Up @@ -777,6 +780,7 @@ class ActionProfile(google.protobuf.message.Message):
"""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
"""

DESCRIPTOR: google.protobuf.descriptor.Descriptor
Expand All @@ -790,6 +794,7 @@ class ActionProfile(google.protobuf.message.Message):
"""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
"""

DESCRIPTOR: google.protobuf.descriptor.Descriptor
Expand Down Expand Up @@ -830,11 +835,15 @@ class ActionProfile(google.protobuf.message.Message):

@property
def sum_of_weights(self) -> global___ActionProfile.SumOfWeights:
"""group size is the sum of the group's weights."""
"""group size is the sum of the group's weights.
Added in v1.4.0
"""

@property
def sum_of_members(self) -> global___ActionProfile.SumOfMembers:
"""group size is the sum of the group's members."""
"""group size is the sum of the group's members.
Added in v1.4.0
"""

def __init__(
self,
Expand Down
21 changes: 17 additions & 4 deletions finsy/proto/p4/v1/p4runtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ service P4Runtime {
//------------------------------------------------------------------------------
message WriteRequest {
uint64 device_id = 1;
uint64 role_id = 2 [deprecated = true];
// 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 @@ -98,6 +100,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 @@ -184,6 +187,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 @@ -342,6 +346,7 @@ message MeterEntry {
uint32 meter_id = 1;
Index index = 2;
MeterConfig config = 3;
// Added in v1.4.0
MeterCounterData counter_data = 4;
}

Expand All @@ -358,6 +363,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 @@ -424,6 +430,7 @@ message CounterData {
int64 packet_count = 2;
}

// Added in v1.4.0
message MeterCounterData {
CounterData green = 1;
CounterData yellow = 2;
Expand All @@ -444,7 +451,9 @@ message PacketReplicationEngineEntry {
message Replica {
oneof port_kind {
// Using uint32 as ports is deprecated, use port field instead.
uint32 egress_port = 1 [deprecated = true];
// 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 @@ -625,7 +634,9 @@ message MasterArbitrationUpdate {

message Role {
// Uniquely identifies this role.
uint64 id = 1 [deprecated = true];
// 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 @@ -729,7 +740,9 @@ message SetForwardingPipelineConfigRequest {
RECONCILE_AND_COMMIT = 5;
}
uint64 device_id = 1;
uint64 role_id = 2 [deprecated = true];
// 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
32 changes: 26 additions & 6 deletions finsy/proto/p4/v1/p4runtime_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ class WriteRequest(google.protobuf.message.Message):
ATOMICITY_FIELD_NUMBER: builtins.int
device_id: builtins.int
role_id: builtins.int
"""Deprecated in v1.4.0"""
role: builtins.str
"""Added in v1.4.0"""
atomicity: global___WriteRequest.Atomicity.ValueType
@property
def election_id(self) -> global___Uint128: ...
Expand Down Expand Up @@ -179,7 +181,9 @@ class ReadRequest(google.protobuf.message.Message):
ENTITIES_FIELD_NUMBER: builtins.int
device_id: builtins.int
role: builtins.str
"""When specified, only return table entries for the given role."""
"""When specified, only return table entries for the given role.
Added in 1.4.0.
"""
@property
def entities(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Entity]: ...
def __init__(
Expand Down Expand Up @@ -443,7 +447,9 @@ class TableEntry(google.protobuf.message.Message):
def counter_data(self) -> global___CounterData: ...
@property
def meter_counter_data(self) -> global___MeterCounterData:
"""Per color counters for tables with a direct meter."""
"""Per color counters for tables with a direct meter.
Added in v1.4.0
"""

@property
def time_since_last_hit(self) -> global___TableEntry.IdleTimeout:
Expand Down Expand Up @@ -846,7 +852,9 @@ class MeterEntry(google.protobuf.message.Message):
@property
def config(self) -> global___MeterConfig: ...
@property
def counter_data(self) -> global___MeterCounterData: ...
def counter_data(self) -> global___MeterCounterData:
"""Added in v1.4.0"""

def __init__(
self,
*,
Expand Down Expand Up @@ -886,7 +894,9 @@ class DirectMeterEntry(google.protobuf.message.Message):
@property
def config(self) -> global___MeterConfig: ...
@property
def counter_data(self) -> global___MeterCounterData: ...
def counter_data(self) -> global___MeterCounterData:
"""Added in v1.4.0"""

def __init__(
self,
*,
Expand Down Expand Up @@ -1039,6 +1049,8 @@ global___CounterData = CounterData

@typing.final
class MeterCounterData(google.protobuf.message.Message):
"""Added in v1.4.0"""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

GREEN_FIELD_NUMBER: builtins.int
Expand Down Expand Up @@ -1099,8 +1111,11 @@ class Replica(google.protobuf.message.Message):
PORT_FIELD_NUMBER: builtins.int
INSTANCE_FIELD_NUMBER: builtins.int
egress_port: builtins.int
"""Using uint32 as ports is deprecated, use port field instead."""
"""Using uint32 as ports is deprecated, use port field instead.
Deprecated in v1.4.0
"""
port: builtins.bytes
"""Added in v1.4.0"""
instance: builtins.int
def __init__(
self,
Expand Down Expand Up @@ -1585,8 +1600,11 @@ class Role(google.protobuf.message.Message):
NAME_FIELD_NUMBER: builtins.int
CONFIG_FIELD_NUMBER: builtins.int
id: builtins.int
"""Uniquely identifies this role."""
"""Uniquely identifies this role.
Deprecated in 1.4.0.
"""
name: builtins.str
"""Added in 1.4.0."""
@property
def config(self) -> google.protobuf.any_pb2.Any:
"""Describes the role configuration, i.e. what operations, P4 entities,
Expand Down Expand Up @@ -1859,7 +1877,9 @@ class SetForwardingPipelineConfigRequest(google.protobuf.message.Message):
CONFIG_FIELD_NUMBER: builtins.int
device_id: builtins.int
role_id: builtins.int
"""Deprecated in 1.4.0."""
role: builtins.str
"""Added in 1.4.0."""
action: global___SetForwardingPipelineConfigRequest.Action.ValueType
@property
def election_id(self) -> global___Uint128: ...
Expand Down

0 comments on commit 98fbbec

Please sign in to comment.