Skip to content
Open
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
10 changes: 10 additions & 0 deletions mdd/python/translation/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,13 @@ def verify_ipv4(ip: str) -> bool:
return False
except ValueError:
return False


def is_qos_configured(nso_props):
if (len(nso_props.service.oc_qos__qos.classifiers.classifier) > 0 or
len(nso_props.service.oc_qos__qos.forwarding_groups.forwarding_group) > 0 or
len(nso_props.service.oc_qos__qos.interfaces.interface) > 0 or
len(nso_props.service.oc_qos__qos.scheduler_policies.scheduler_policy)):
return True

return False
7 changes: 7 additions & 0 deletions mdd/python/translation/openconfig_nx/nx_main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# -*- mode: python; python-indent: 4 -*-
from translation.common import is_oc_routing_policy_configured
from translation.openconfig_nx.nx_system import nx_system_program_service
from translation.common import is_qos_configured


def check_nx_features(self, nso_props) -> None:
"""
Expand Down Expand Up @@ -33,3 +35,8 @@ def check_nx_features(self, nso_props) -> None:

# OpenConfig System
nx_system_program_service(self, nso_props)

# Openconfig QoS
if is_qos_configured(nso_props):
raise NotImplementedError('openconfig-qos has not yet been implemented for XR')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the exception for NX


6 changes: 5 additions & 1 deletion mdd/python/translation/openconfig_xe/xe_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from translation.openconfig_xe.xe_routing_policy import xe_routing_policy_program_service
from translation.openconfig_xe.xe_system import xe_system_program_service
from translation.openconfig_xe.xe_stp import xe_stp_program_service

from translation.openconfig_xe.xe_qos import xe_qos_program_service

def check_xe_features(oc_self, nso_props) -> None:
"""
Expand Down Expand Up @@ -40,6 +40,9 @@ def check_xe_features(oc_self, nso_props) -> None:
# OpenConfig System
xe_system_program_service(oc_self, nso_props)

# OpenConfig QoS
if nso_props.service.oc_qos__qos:
xe_qos_program_service(oc_self, nso_props)

def clean_xe_cdb(nso_props) -> None:
"""
Expand Down Expand Up @@ -78,3 +81,4 @@ def clean_xe_cdb(nso_props) -> None:
device.ios__ntp.trusted_key.delete()
device.ios__router.bgp.delete()
device.ios__router.ospf.delete()

279 changes: 279 additions & 0 deletions mdd/python/translation/openconfig_xe/xe_qos.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions mdd/python/translation/openconfig_xr/xr_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from translation.openconfig_xr.xr_acls import xr_acls_lines_program_service
from translation.openconfig_xr.xr_acls import xr_acls_ntp_program_service
from translation.openconfig_xr.xr_network_instances import xr_network_instances_program_service
from translation.common import is_qos_configured


def check_xr_features(oc_self, nso_props) -> None:
Expand Down Expand Up @@ -41,6 +42,10 @@ def check_xr_features(oc_self, nso_props) -> None:
# OpenConfig System
xr_system_program_service(oc_self, nso_props)

# OpenConfig QoS
if is_qos_configured(nso_props):
raise NotImplementedError('openconfig-qos has not yet been implemented for XR')


def clean_xr_cdb(nso_props) -> None:
"""
Expand Down
3 changes: 2 additions & 1 deletion mdd/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ OC_MODELS = $(filter-out %aaa-tacacs.yang %aaa-radius.yang %grpc.yang, $(wildcar
$(filter-out %if-8021X.yang %if-ethernet-ext.yang %if-ip-ext.yang %if-sdn-ext.yang, $(wildcard yang/openconfig/interfaces/*.yang)) \
$(wildcard yang/openconfig/vlan/*.yang) \
$(wildcard yang/openconfig/stp/*.yang) \
$(wildcard yang/openconfig/multicast/*.yang) \
$(filter-out %openconfig-qos-interfaces.yang %openconfig-qos-elements.yang, $(wildcard yang/openconfig/qos/*.yang)) \
$(wildcard yang/openconfig/multicast/*.yang) \
$(filter-out %system-ext-sub-nat.yang, $(wildcard yang/extensions/*.yang))

# Not used
Expand Down
126 changes: 40 additions & 86 deletions mdd/src/yang/openconfig/qos/openconfig-qos-elements.yang
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ submodule openconfig-qos-elements {

contact
"OpenConfig working group
www.openconfig.net";
netopenconfig@googlegroups.com";

description
"This submodule defines configuration and operational state
Expand All @@ -36,44 +36,7 @@ submodule openconfig-qos-elements {
packets for transmission, including policer and shaper
functions";

oc-ext:openconfig-version "0.8.0";

revision "2023-02-17" {
description
"Add queue identifier.";
reference "0.8.0";
}

revision "2023-02-08" {
description
"Remove incorrect output placement of interface-ref";
reference "0.7.0";
}

revision "2023-01-28" {
description
"Split groupings in interfaces for better leaf reuse.";
reference "0.6.1";
}

revision "2022-09-13" {
description
"Add queue octet drop counter.";
reference "0.6.0";
}

revision "2021-08-28" {
description
"Revision updating memory management profile WRED and RED configuration.";
reference "0.5.0";
}

revision "2021-04-28" {
description
"Revision updating buffer management and queue management
configuration.";
reference "0.3.0";
}
oc-ext:openconfig-version "0.2.3";

revision "2019-11-28" {
description
Expand Down Expand Up @@ -372,33 +335,7 @@ submodule openconfig-qos-elements {
path "../../../../queues/queue/config/name";
}
description
"Output queue for packets in this forwarding group.
This leaf applies to both multicast and unicast
packets. Where a user or system requires separate
queueing for multicast and unicast the unicast-output-queue
and multicast-output-queue leaves should be specified.";
}

leaf unicast-output-queue {
type leafref {
path "../../../../queues/queue/config/name";
}
description
"Output queue for unicast packets within this
forwarding group. Where an operator or system does
not require separate queueing for multicast and
unicast this leaf is not specified.";
}

leaf multicast-output-queue {
type leafref {
path "../../../../queues/queue/config/name";
}
description
"Output queue for multicast packets within this
forwarding group. Where an operator or system does
not require separate queueing for multicast and
unicast this leaf is not specified.";
"Queue for packets in this forwarding group.";
}
}

Expand Down Expand Up @@ -456,7 +393,7 @@ submodule openconfig-qos-elements {

leaf enable-ecn {
type boolean;
default false;
//default false;
description
"When set to true, the device should mark packets that are
ECN-capable rather than dropping them. The receiver is
Expand Down Expand Up @@ -579,11 +516,13 @@ submodule openconfig-qos-elements {
description
"User-defined name of the queue";
}
leaf queue-id {
type uint8;

leaf queue-type {
type identityref {
base oc-qos-types:QOS_QUEUE_TYPE;
}
description
"An optional identifier which may be required by some hardware to map
the named queue to a hardware queue";
"Sets the type of the queue";
}
}

Expand Down Expand Up @@ -628,6 +567,21 @@ submodule openconfig-qos-elements {
uses qos-queue-config;
uses qos-queue-state;
}

uses qos-queue-red-top {
when "./config/queue-type = 'oc-qos-types:RED'" {
description
"RED configuration is valid when the queue-type
is set accordingly.";
}
}
uses qos-queue-wred-top {
when "./config/queue-type = 'oc-qos-types:WRED'" {
description
"WRED configuration is valid when the queue-type
is set accordingly.";
}
}
}
}
}
Expand Down Expand Up @@ -660,11 +614,6 @@ submodule openconfig-qos-elements {
}

leaf child-scheduler {
when "../output-type = 'SCHEDULER'" {
description
"The child-scheduler leaf is valid only when
the output type of the scheduler is a child scheduler";
}
// TODO: consider whether both child (output) and parent
// (input) references are needed; consider whether child
// reference should separate in-profile and out-of-profile
Expand All @@ -675,23 +624,28 @@ submodule openconfig-qos-elements {
path "../../../../../../../scheduler-policies/scheduler-policy/" +
"config/name";
}
when "../output-type = 'SCHEDULER'" {
description
"The child-scheduler leaf is valid only when
the output type of the scheduler is a child scheduler";
}
description
"When the scheduler output type is a child scheduler,
this leaf provides a reference to the downstream
scheduler.";
}

leaf output-fwd-group {
type leafref {
path "../../../../../../../forwarding-groups/forwarding-group" +
"/config/name";
}
when "../output-type = 'FWD_GROUP'" {
description
"The output-fwd-group leaf is valid only when
the output type of the scheduler is a forwarding group";
}
type leafref {
path "../../../../../../../forwarding-groups/forwarding-group" +
"/config/name";
}
description
description
"When the scheduler output type is a forwarding group,
this leaf provides a reference to the forwarding group.";
}
Expand Down Expand Up @@ -760,16 +714,16 @@ submodule openconfig-qos-elements {
}

leaf queue {
when "../input-type = 'QUEUE'" {
description
"The queue leaf is valid only when
the input type of the scheduler is a queue";
}
type leafref {
// current loc: /qos/scheduler-policies/scheduler-policy/schedulers/
// scheduler/inputs/input/config/queue
path "../../../../../../../../queues/queue/name";
}
when "../input-type = 'QUEUE'" {
description
"The queue leaf is valid only when
the input type of the scheduler is a queue";
}
description
"Reference to a queue that is an input source for the
scheduler";
Expand Down
Loading