Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.4.0 rc updates to bazel and protobuf comments #499

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bazel/example/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ local_repository(

# http_archive(
# name = "com_github_p4lang_p4runtime",
# urls = ["https://github.com/p4lang/p4runtime/archive/v1.3.0.tar.gz"],
# strip_prefix = "p4runtime-1.3.0/proto",
# urls = ["https://github.com/p4lang/p4runtime/archive/v1.4.0.tar.gz"],
# strip_prefix = "p4runtime-1.4.0/proto",
# # sha256 = "<insert hash value here>",
# )

Expand All @@ -21,7 +21,7 @@ local_repository(
# remote = "https://github.com/p4lang/p4runtime.git",
# # strip_prefix = "proto", # https://github.com/bazelbuild/bazel/issues/10062
# patch_cmds = ["mv proto/* ."], # Workaround since strip_prefix is broken.
# tag = "v1.3.0",
# tag = "v1.4.0",
# )

load("@com_github_p4lang_p4runtime//:p4runtime_deps.bzl", "p4runtime_deps")
Expand Down
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 @@ -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
21 changes: 17 additions & 4 deletions 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
6 changes: 6 additions & 0 deletions rust/src/p4.config.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ pub struct Documentation {
pub description: ::prost::alloc::string::String,
}
/// Used to describe the required properties of the underlying platform.
/// Added in v1.4.0
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PlatformProperties {
/// The minimum number of multicast entries (i.e. multicast groups) that the
Expand Down Expand Up @@ -527,6 +528,7 @@ pub struct 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
#[prost(message, optional, tag="11")]
pub platform_properties: ::core::option::Option<PlatformProperties>,
}
Expand Down Expand Up @@ -967,12 +969,14 @@ pub mod action_profile {
/// 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
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct 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
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SumOfMembers {
/// the maximum weight of each individual member in a group.
Expand All @@ -983,9 +987,11 @@ pub mod action_profile {
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum SelectorSizeSemantics {
/// group size is the sum of the group's weights.
/// Added in v1.4.0
#[prost(message, tag="6")]
SumOfWeights(SumOfWeights),
/// group size is the sum of the group's members.
/// Added in v1.4.0
#[prost(message, tag="7")]
SumOfMembers(SumOfMembers),
}
Expand Down
Loading
Loading