Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sonic-port xfmr support
Browse files Browse the repository at this point in the history
Satoru-Shinohara committed Jan 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9905269 commit b7c0d8d
Showing 9 changed files with 1,364 additions and 1,651 deletions.
4 changes: 3 additions & 1 deletion config/transformer/models_list
Original file line number Diff line number Diff line change
@@ -2,4 +2,6 @@
openconfig-acl.yang
openconfig-acl-annot.yang
openconfig-sampling-sflow.yang
openconfig-sampling-sflow-annot.yang
openconfig-if-ethernet.yang
openconfig-interfaces.yang
openconfig-interfaces-annot.yang
79 changes: 79 additions & 0 deletions models/yang/annotations/openconfig-interfaces-annot.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
module openconfig-interfaces-annot {

yang-version "1";

namespace "http://openconfig.net/yang/annotation/openconfig-interfaces-annot";
prefix "oc-interfaces-annot";

import sonic-extensions { prefix sonic-ext; }
import openconfig-interfaces { prefix oc-intf; }

deviation /oc-intf:interfaces/oc-intf:interface {
deviate add {
sonic-ext:key-transformer "intf_tbl_key_xfmr";
sonic-ext:table-transformer "intf_table_xfmr";
}
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:config {
deviate add {
sonic-ext:subtree-transformer "intf_eth_port_config_xfmr";
sonic-ext:path-transformer "intf_eth_port_config_path_xfmr";
}
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state {
deviate add {
sonic-ext:db-name "APPL_DB";
}
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state {
deviate add {
sonic-ext:db-name "APPL_DB";
}
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:auto-negotiate {
deviate add {
sonic-ext:field-transformer "intf_eth_auto_neg_xfmr";
sonic-ext:field-name "autoneg";
}
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:config/oc-intf:mtu {
deviate add {
sonic-ext:field-transformer "intf_mtu_xfmr";
}
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:port-speed {
deviate add {
sonic-ext:field-transformer "intf_eth_port_speed_xfmr";
sonic-ext:field-name "speed";
}
}


deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:admin-status {
deviate add {
sonic-ext:field-transformer "intf_admin_status_xfmr";
sonic-ext:field-name "admin_status";
}
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:config/oc-intf:enabled {
deviate add {
sonic-ext:field-transformer "intf_enabled_xfmr";
sonic-ext:field-name "admin_status";
}
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:enabled {
deviate add {
sonic-ext:field-transformer "intf_enabled_xfmr";
sonic-ext:field-name "admin_status";
}
}

}
147 changes: 147 additions & 0 deletions models/yang/extensions/openconfig-interfaces-ext.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
module openconfig-interfaces-ext {

yang-version "1.1";

// namespace
namespace "http://openconfig.net/yang/interfaces/extension";

prefix "oc-intf-ext";

import openconfig-extensions { prefix oc-ext; }
import openconfig-interfaces { prefix oc-intf; }
import openconfig-vlan { prefix oc-vlan; }
import openconfig-if-ethernet {prefix oc-eth; }
import openconfig-if-aggregate {prefix oc-lag; }
import openconfig-if-tunnel {prefix oc-tun; }


organization "SONiC";

contact
"SONiC";

description
"This module contains collection of yang definitions for extensions to
openconfig-interfaces yang";

oc-ext:openconfig-version "0.1.0";

revision 2024-01-18 {
description
"Initial version.";
reference "0.1.0";
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:config/oc-intf:loopback-mode {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:config/oc-vlan:tpid {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:config/oc-intf:type {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:loopback-mode {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:oper-status {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:last-change {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:counters {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:type {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:ifindex {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:logical {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-vlan:tpid {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:hold-time {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:config/oc-eth:mac-address {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:config/oc-eth:duplex-mode {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:config/oc-eth:enable-flow-control {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:config/oc-lag:aggregate-id {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:mac-address {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:duplex-mode {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:enable-flow-control {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:counters {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-lag:aggregate-id {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:hw-mac-address {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:negotiated-duplex-mode {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:negotiated-port-speed {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-vlan:switched-vlan {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-tun:tunnel {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-lag:aggregation {
deviate not-supported;
}

deviation /oc-intf:interfaces/oc-intf:interface/oc-vlan:routed-vlan {
deviate not-supported;
}

}
102 changes: 98 additions & 4 deletions models/yang/openconfig-if-ethernet.yang
Original file line number Diff line number Diff line change
@@ -24,7 +24,83 @@ module openconfig-if-ethernet {
"Model for managing Ethernet interfaces -- augments the OpenConfig
model for interface configuration and state.";

oc-ext:openconfig-version "2.6.2";
oc-ext:openconfig-version "2.13.0";

revision "2023-03-10" {
description
"Allow Ethernet configuration parameters to be
used for aggregate (LAG) interfaces.";
reference "2.13.0";
}

revision "2022-04-20" {
description
"Remove unused import";
reference "2.12.2";
}

revision "2021-07-20" {
description
"Fix typo in hardware MAC address description.";
reference "2.12.1";
}

revision "2021-07-07" {
description
"Add support for configuring fec-mode per interface.";
reference "2.12.0";
}

revision "2021-06-16" {
description
"Remove trailing whitespace.";
reference "2.11.1";
}

revision "2021-06-09" {
description
"Add support for standalone link training.";
reference "2.11.0";
}

revision "2021-05-17" {
description
"Add ethernet counters: in-carrier-errors,
in-interrupted-tx, in-late-collision, in-mac-errors-rx,
in-single-collision, in-symbol-error and out-mac-errors-tx";
reference "2.10.0";
}

revision "2021-03-30" {
description
"Add counter for drops due to oversized frames.";
reference "2.9.0";
}

revision "2020-05-06" {
description
"Minor formatting fix.";
reference "2.8.1";
}

revision "2020-05-06" {
description
"Add 200G, 400G, 600G and 800G Ethernet speeds.";
reference "2.8.0";
}

revision "2020-05-05" {
description
"Fix when statement checks to use rw paths when
from a rw context.";
reference "2.7.3";
}

revision "2019-04-16" {
description
"Update import prefix for iana-if-type module";
reference "2.7.2";
}

revision "2018-11-21" {
description
@@ -146,6 +222,26 @@ module openconfig-if-ethernet {
description "100 Gbps Ethernet";
}

identity SPEED_200GB {
base ETHERNET_SPEED;
description "200 Gbps Ethernet";
}

identity SPEED_400GB {
base ETHERNET_SPEED;
description "400 Gbps Ethernet";
}

identity SPEED_600GB {
base ETHERNET_SPEED;
description "600 Gbps Ethernet";
}

identity SPEED_800GB {
base ETHERNET_SPEED;
description "800 Gbps Ethernet";
}

identity SPEED_UNKNOWN {
base ETHERNET_SPEED;
description
@@ -349,7 +445,7 @@ module openconfig-if-ethernet {
leaf hw-mac-address {
type oc-yang:mac-address;
description
"Represenets the 'burned-in', or system-assigned, MAC
"Represents the 'burned-in', or system-assigned, MAC
address for the Ethernet interface.";
}

@@ -382,9 +478,7 @@ module openconfig-if-ethernet {
description "Ethernet interface counters";

uses ethernet-interface-state-counters;

}

}

// data definition statements
4 changes: 3 additions & 1 deletion models/yang/sonic/import.mk
Original file line number Diff line number Diff line change
@@ -5,4 +5,6 @@
# or glob patterns of basenames (like sonic-telemetry*.yang) can be specified.
# Other sonic yangs referred by these will also be copied.
#
SONICYANG_IMPORTS += sonic-sflow.yang
SONICYANG_IMPORTS += sonic-sflow.yang
SONICYANG_IMPORTS += sonic-interface.yang
SONICYANG_IMPORTS += sonic-port.yang
Loading

0 comments on commit b7c0d8d

Please sign in to comment.