Skip to content
Draft
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
5 changes: 5 additions & 0 deletions config/transformer/models_list
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ openconfig-sampling-sflow-annot.yang
openconfig-sampling-sflow.yang
openconfig-system-annot.yang
openconfig-vlan.yang
sonic-platform-node.yang
openconfig-p4rt.yang
openconfig-platform-annot.yang
openconfig-platform.yang
gnsi-authz.yang
gnsi-pathz.yang
gnsi-certz.yang
gnsi-credentialz.yang

16 changes: 16 additions & 0 deletions models/yang/annotations/openconfig-platform-annot.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module openconfig-platform-annot {

yang-version "1";
namespace "http://openconfig.net/yang/platform-annot";
prefix "oc-platform-annot";

import openconfig-platform { prefix oc-platform; }
import sonic-extensions { prefix sonic-ext; }

deviation /oc-platform:components/oc-platform:component {
deviate add {
sonic-ext:subtree-transformer "pfm_components_xfmr";
sonic-ext:path-transformer "pfm_components_path_xfmr";
}
}
}
107 changes: 107 additions & 0 deletions models/yang/openconfig-p4rt.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
module openconfig-p4rt {
yang-version "1";

prefix "oc-p4rt";

namespace "http://openconfig.net/yang/p4rt";

import openconfig-extensions { prefix oc-ext; }
import openconfig-interfaces { prefix oc-if; }
import openconfig-platform { prefix oc-platform; }

organization
"OpenConfig Working Group";

contact
"www.openconfig.net";

description
"This module defines a set of extensions that provide P4Runtime (P4RT)
specific extensions to the OpenConfig data models. Specifically, these
parameters for configuration and state provide extensions that control
the P4RT service, or allow it to be used alongside other OpenConfig
data models.

The P4RT protocol specification is linkde from https://p4.org/specs/
under the P4Runtime heading.";

oc-ext:openconfig-version "0.1.0";

revision 2021-04-06 {
description
"Initial revision.";
reference "0.1.0";
}

grouping p4rt-interface-config {
description
"Interface-specific configuration that is applicable to devices that
are running the P4RT service.";

leaf id {
type uint32;
description
"The numeric identifier used by the controller to address the interface.
This ID is assigned by an external-to-the-device entity (e.g., an SDN
management system) to establish an externally deterministic numeric
reference for the interface. The programming entity must ensure that
the ID is unique within the required context.

Note that this identifier is used only when a numeric reference to the
interface is required, it does not replace the unique name assigned to
the interface.";
}
}

augment "/oc-if:interfaces/oc-if:interface/oc-if:config" {
description
"Add interface-specific intended configuration for P4RT.";

uses p4rt-interface-config;
}

augment "/oc-if:interfaces/oc-if:interface/oc-if:state" {
description
"Add interface-specific applied configuration for P4RT.";

uses p4rt-interface-config;
}

grouping p4rt-ic-config {
description
"Integrated-circuit specific configuration that is applicable to devices
that are running the P4RT service.";

leaf node-id {
type uint64;
description
"The numeric ID used by the controller to address the integrated circuit,
which may be referred to as a 'device', 'node' or 'target' by the P4RT
specification.

Each switching ASIC (i.e., node) is addressed by the external entity
based on its numeric identifier.

The node ID is specified in addition to the string identifier assigned to
the integrated circuit within the /components/component list.";
}
}

augment "/oc-platform:components/oc-platform:component/" +
"oc-platform:integrated-circuit/oc-platform:config" {
description
"Add integrated circuit specific intended configuration that is required
for P4RT.";

uses p4rt-ic-config;
}

augment "/oc-platform:components/oc-platform:component/" +
"oc-platform:integrated-circuit/oc-platform:state" {
description
"Add integrated circuit specific operational state that is required
for P4RT.";

uses p4rt-ic-config;
}
}
Loading