From 3dacb862e26a03a997ba8d3a6b3422ab9fd733fa Mon Sep 17 00:00:00 2001 From: verios-google <110698235+verios-google@users.noreply.github.com> Date: Fri, 9 May 2025 18:44:01 +0000 Subject: [PATCH 1/5] Clarify in spec that device id can never be 0 Signed-off-by: verios-google <110698235+verios-google@users.noreply.github.com> --- docs/v1/P4Runtime-Spec.adoc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/v1/P4Runtime-Spec.adoc b/docs/v1/P4Runtime-Spec.adoc index 0718dfc5..d32b3ea8 100755 --- a/docs/v1/P4Runtime-Spec.adoc +++ b/docs/v1/P4Runtime-Spec.adoc @@ -601,7 +601,7 @@ their write requests. gRPC provides authentication methods cite:[gRPCAuth] that should be deployed to prevent untrusted clients from creating channels, and thus from making changes or even reading the state of the server. -=== Default Role +=== Default Role and Default Device ID A controller can omit the role message in `MasterArbitrationUpdate`. This implies the "default role", which corresponds to "full pipeline access". @@ -609,6 +609,11 @@ This also implies that a default role has a `role_id` of `""` (default). If using a default role, all RPCs from the controller (e.g. `Write`) must leave the `role` unset. +The "default device_id" corresponds to `0`. As mentioned [previously](#sec-default-valued-fields), +an application is unable to distinguish between unset vs default valued scalar +fields. Some requests (e.g. [Cabilities](#sec-capabilities-rpc)) uniquely handle an unset `device_id`. +Therefore, a device must NEVER be assigned a `device_id` of 0. + [#sec-arbitration-role-config] === Role Config @@ -6027,6 +6032,7 @@ error { } ---- +[#sec-capabilities-rpc] == `Capabilities` RPC The `Capabilities` RPC offers a mechanism through which a P4Runtime client can From 2a084bc69d2f05a6caefd1309a453b039f1b9b5e Mon Sep 17 00:00:00 2001 From: verios-google <110698235+verios-google@users.noreply.github.com> Date: Fri, 9 May 2025 20:42:53 +0000 Subject: [PATCH 2/5] Addressed comment Signed-off-by: verios-google <110698235+verios-google@users.noreply.github.com> --- docs/v1/P4Runtime-Spec.adoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/v1/P4Runtime-Spec.adoc b/docs/v1/P4Runtime-Spec.adoc index d32b3ea8..c3759eae 100755 --- a/docs/v1/P4Runtime-Spec.adoc +++ b/docs/v1/P4Runtime-Spec.adoc @@ -609,7 +609,10 @@ This also implies that a default role has a `role_id` of `""` (default). If using a default role, all RPCs from the controller (e.g. `Write`) must leave the `role` unset. -The "default device_id" corresponds to `0`. As mentioned [previously](#sec-default-valued-fields), +As per section [X](#sec-default-valued-fields), default values are invalid for all scalar P4 object IDs. +This includes `device_id`, so the `0` ID may not be assigned to a device. + +The "default device_id" corresponds to `0`. As mentioned [previously](), an application is unable to distinguish between unset vs default valued scalar fields. Some requests (e.g. [Cabilities](#sec-capabilities-rpc)) uniquely handle an unset `device_id`. Therefore, a device must NEVER be assigned a `device_id` of 0. From d1cad5b1b21e62215a242472f2ae57e4beaaf46f Mon Sep 17 00:00:00 2001 From: verios-google <110698235+verios-google@users.noreply.github.com> Date: Fri, 9 May 2025 20:44:09 +0000 Subject: [PATCH 3/5] Fixed lint issue Signed-off-by: verios-google <110698235+verios-google@users.noreply.github.com> --- docs/v1/P4Runtime-Spec.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/v1/P4Runtime-Spec.adoc b/docs/v1/P4Runtime-Spec.adoc index c3759eae..ef8f69c9 100755 --- a/docs/v1/P4Runtime-Spec.adoc +++ b/docs/v1/P4Runtime-Spec.adoc @@ -610,7 +610,7 @@ If using a default role, all RPCs from the controller (e.g. `Write`) must leave the `role` unset. As per section [X](#sec-default-valued-fields), default values are invalid for all scalar P4 object IDs. -This includes `device_id`, so the `0` ID may not be assigned to a device. +This includes `device_id`, so the `0` ID may not be assigned to a device. The "default device_id" corresponds to `0`. As mentioned [previously](), an application is unable to distinguish between unset vs default valued scalar From f28e303a39227219f676b41e7af335b2cdb2e241 Mon Sep 17 00:00:00 2001 From: verios-google <110698235+verios-google@users.noreply.github.com> Date: Wed, 14 May 2025 18:09:24 +0000 Subject: [PATCH 4/5] Addressed comments Signed-off-by: verios-google <110698235+verios-google@users.noreply.github.com> --- docs/v1/P4Runtime-Spec.adoc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/v1/P4Runtime-Spec.adoc b/docs/v1/P4Runtime-Spec.adoc index ef8f69c9..415932b3 100755 --- a/docs/v1/P4Runtime-Spec.adoc +++ b/docs/v1/P4Runtime-Spec.adoc @@ -609,13 +609,9 @@ This also implies that a default role has a `role_id` of `""` (default). If using a default role, all RPCs from the controller (e.g. `Write`) must leave the `role` unset. -As per section [X](#sec-default-valued-fields), default values are invalid for all scalar P4 object IDs. -This includes `device_id`, so the `0` ID may not be assigned to a device. - -The "default device_id" corresponds to `0`. As mentioned [previously](), -an application is unable to distinguish between unset vs default valued scalar -fields. Some requests (e.g. [Cabilities](#sec-capabilities-rpc)) uniquely handle an unset `device_id`. -Therefore, a device must NEVER be assigned a `device_id` of 0. +As per section [Default-Valued Fields](#sec-default-valued-fields), default values are invalid for all +scalar P4 object IDs. This includes `device_id`, so the `0` ID must not be +assigned to a device. [#sec-arbitration-role-config] === Role Config From 25b0631327b6d9965fbff0d68aa62c861aa6f525 Mon Sep 17 00:00:00 2001 From: verios-google <110698235+verios-google@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:52:00 +0000 Subject: [PATCH 5/5] Addressing comments Signed-off-by: verios-google <110698235+verios-google@users.noreply.github.com> --- docs/v1/P4Runtime-Spec.adoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/v1/P4Runtime-Spec.adoc b/docs/v1/P4Runtime-Spec.adoc index 415932b3..15c86895 100755 --- a/docs/v1/P4Runtime-Spec.adoc +++ b/docs/v1/P4Runtime-Spec.adoc @@ -610,8 +610,7 @@ If using a default role, all RPCs from the controller (e.g. `Write`) must leave the `role` unset. As per section [Default-Valued Fields](#sec-default-valued-fields), default values are invalid for all -scalar P4 object IDs. This includes `device_id`, so the `0` ID must not be -assigned to a device. +scalar P4 object IDs. This includes `device_i`, which must be non-zero. [#sec-arbitration-role-config] === Role Config