Skip to content

Commit 5e6138d

Browse files
Add Any protobuf message to CapabilitiesResponse for experimental features (#554)
1 parent 70b5cb0 commit 5e6138d

File tree

6 files changed

+116
-73
lines changed

6 files changed

+116
-73
lines changed

docs/v1/P4Runtime-Spec.adoc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6032,9 +6032,16 @@ error {
60326032
The `Capabilities` RPC offers a mechanism through which a P4Runtime client can
60336033
discover the capabilities of the P4Runtime server implementation. At the moment,
60346034
the `CapabilitiesRequest` message is empty and the `CapabilitiesResponse`
6035-
message only includes the `p4runtime_api_version` string field. This field must
6036-
be set to the full semantic version string cite:[SemVer] corresponding to the
6037-
version of the P4Runtime API implemented by the server, e.g. "1.1.0-rc.1".
6035+
message includes the `p4runtime_api_version` string field and the `experimental`
6036+
field, which has type `Any` Protobuf message cite:[ProtoAny].
6037+
6038+
The `p4runtime_api_version` field must be set to the full semantic version string cite:[SemVer]
6039+
corresponding to the version of the P4Runtime API implemented by the server, e.g. "1.1.0-rc.1".
6040+
6041+
The ` experimental` field is intended to allow parties to experiment with features
6042+
before proposing them for standardization. NOTE: This field will be deprecated after
6043+
`p4runtime.proto` is migrated from `proto3` to proto `editions`. Proto `extensions` cite:[ProtoExtension]
6044+
will be introduced as the standard way to support experimental use cases.
60386045

60396046
Future versions of P4Runtime may introduce more advanced capability discovery
60406047
features. For example, P4Runtime supports three xref:sec-batch-atomicity[atomicity

docs/v1/resources/theme/references.bib

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ @ONLINE { ProtoAny
100100
url = "https://developers.google.com/protocol-buffers/docs/proto3#any"
101101
}
102102

103+
@ONLINE { ProtoExtension,
104+
title = "Protobuf extension feature",
105+
url = "https://protobuf.dev/programming-guides/editions/#extensions"
106+
}
107+
103108
@ONLINE { gRPCStatus,
104109
title = "the gRPC $Status$ class",
105110
url = "https://github.com/grpc/grpc/blob/master/include/grpcpp/impl/codegen/status.h"

go/p4/v1/p4runtime.pb.go

Lines changed: 79 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/p4/v1/p4runtime.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,4 +840,8 @@ message CapabilitiesResponse {
840840
// The full semantic version string (e.g. "1.1.0-rc.1") corresponding to the
841841
// version of the P4Runtime API currently implemented by the server.
842842
string p4runtime_api_version = 1;
843+
844+
// Used for experimental features before proposing them for standardization.
845+
// Added in 1.5.0.
846+
.google.protobuf.Any experimental = 999;
843847
}

0 commit comments

Comments
 (0)