From 84da2bbe390e71e567ff2706bee0977ba26686b3 Mon Sep 17 00:00:00 2001 From: Satish Pitchikala Date: Thu, 9 Feb 2023 01:26:17 -0800 Subject: [PATCH 1/4] proto/p4/v1/p4runtime.proto --- proto/p4/v1/p4runtime.proto | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/proto/p4/v1/p4runtime.proto b/proto/p4/v1/p4runtime.proto index e1469502..2bde8be7 100755 --- a/proto/p4/v1/p4runtime.proto +++ b/proto/p4/v1/p4runtime.proto @@ -59,6 +59,11 @@ service P4Runtime { rpc Capabilities(CapabilitiesRequest) returns (CapabilitiesResponse) { } + +// Get properties of a resource + rpc GetResourceProperties(GetResourcePropertiesRequest) + returns (GetResourcePropertiesResponse) { + } } //------------------------------------------------------------------------------ @@ -791,3 +796,30 @@ message CapabilitiesResponse { // version of the P4Runtime API currently implemented by the server. string p4runtime_api_version = 1; } + +//------------------------------------------------------------------------------ +message GetResourcePropertiesRequest { + enum PropertyType { + // Default behavior. Returns all the properties of the resource. + ALL = 0; + // Returns number of entries in the resource + NUM_OF_ENTRIES = 1; + // Returns total capacity of the resource + SIZE = 2; + } + + // Unique identifier of a resource + // 0 is wildcard which fetches properties of all the resources + uint32 id = 1; + PropertyType property_type = 2; +} + +message GetResourcePropertiesResponse { + repeated ResourceProperties = 1; +} + +ResourceProperties { + uint32 id = 1; + uint32 num_of_entries = 2; + uint32 size = 3; +} From c296eb94be84b1ad57e0998539dd5b4472787067 Mon Sep 17 00:00:00 2001 From: Satish Pitchikala Date: Thu, 9 Feb 2023 01:28:52 -0800 Subject: [PATCH 2/4] proto/p4/v1/p4runtime.proto --- proto/p4/v1/p4runtime.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/p4/v1/p4runtime.proto b/proto/p4/v1/p4runtime.proto index 2bde8be7..de09854b 100755 --- a/proto/p4/v1/p4runtime.proto +++ b/proto/p4/v1/p4runtime.proto @@ -818,7 +818,7 @@ message GetResourcePropertiesResponse { repeated ResourceProperties = 1; } -ResourceProperties { +message ResourceProperties { uint32 id = 1; uint32 num_of_entries = 2; uint32 size = 3; From bc0a9e9bfa7895bcc80d5315d293d2407e63da29 Mon Sep 17 00:00:00 2001 From: Satish Pitchikala Date: Thu, 9 Feb 2023 01:31:05 -0800 Subject: [PATCH 3/4] proto/p4/v1/p4runtime.proto --- proto/p4/v1/p4runtime.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proto/p4/v1/p4runtime.proto b/proto/p4/v1/p4runtime.proto index de09854b..ee596687 100755 --- a/proto/p4/v1/p4runtime.proto +++ b/proto/p4/v1/p4runtime.proto @@ -800,11 +800,11 @@ message CapabilitiesResponse { //------------------------------------------------------------------------------ message GetResourcePropertiesRequest { enum PropertyType { - // Default behavior. Returns all the properties of the resource. - ALL = 0; - // Returns number of entries in the resource + // Default behavior. Returns all the properties of the resource. + ALL = 0; + // Returns number of entries in the resource NUM_OF_ENTRIES = 1; - // Returns total capacity of the resource + // Returns total capacity of the resource SIZE = 2; } From 273b7c9ce1b09d4af122182b1c56b9aa862ccfb8 Mon Sep 17 00:00:00 2001 From: Satish Pitchikala Date: Thu, 9 Feb 2023 01:33:04 -0800 Subject: [PATCH 4/4] proto/p4/v1/p4runtime.proto --- proto/p4/v1/p4runtime.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/p4/v1/p4runtime.proto b/proto/p4/v1/p4runtime.proto index ee596687..3850019f 100755 --- a/proto/p4/v1/p4runtime.proto +++ b/proto/p4/v1/p4runtime.proto @@ -815,7 +815,7 @@ message GetResourcePropertiesRequest { } message GetResourcePropertiesResponse { - repeated ResourceProperties = 1; + repeated ResourceProperties = 1; } message ResourceProperties {