Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add QoS scheduler module #249

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
52 changes: 52 additions & 0 deletions models/enterprise_sonic/qos_scheduler/deleted_example_01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Using deleted
#
# Before state:
# -------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
# Queue: 0
# type: dwrr
# weight: 10
# meter-type: packets
# cir: 32000 Pps
# cbs: 30000 Packets
# pir: 40000 Pps
# pbs: 35000 Packets
# Queue: 1
# type: dwrr
# weight: 14
# meter-type: packets
# Scheduler Policy: policy2
# Queue: 0
# type: wrr
# weight: 5
# meter-type: bytes
# cir: 50 Kbps
# cbs: 800000 Bytes
# pir: 60 Kbps
# pbs: 900000 Bytes

- name: Delete QoS scheduler configurations
dellemc.enterprise_sonic.sonic_qos_scheduler:
config:
- name: policy1
schedulers:
- sequence: 0
cir: 32000
pir: 40000
cbs: 30000
pbs: 35000
- sequence: 1
- name: policy2
state: deleted

# After state:
# -------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
# Queue: 0
# type: dwrr
# weight: 10
# meter-type: packets
36 changes: 36 additions & 0 deletions models/enterprise_sonic/qos_scheduler/merged_example_01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Using Merged
#
# Before state:
# -------------
#
# sonic# show qos scheduler-policy
# (No qos scheduler-policy configuration present)

- name: Merge QoS scheduler configurations
dellemc.enterprise_sonic.sonic_qos_scheduler:
config:
- name: policy1
schedulers:
- sequence: 0
scheduler_type: dwrr
weight: 10
meter_type: packets
cir: 32000
pir: 40000
cbs: 30000
pbs: 35000
state: merged

# After state:
# ------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
# Queue: 0
# type: dwrr
# weight: 10
# meter-type: packets
# cir: 32000 Pps
# cbs: 30000 Packets
# pir: 40000 Pps
# pbs: 35000 Packets
47 changes: 47 additions & 0 deletions models/enterprise_sonic/qos_scheduler/overridden_example_01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Using Overridden
# Before state:
# -------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
# Queue: 0
# type: dwrr
# weight: 10
# meter-type: packets
# cir: 32000 Pps
# cbs: 30000 Packets
# pir: 40000 Pps
# pbs: 35000 Packets
# Queue: 1
# type: dwrr
# weight: 14
# meter-type: packets

- name: Override QoS scheduler configurations
dellemc.enterprise_sonic.sonic_qos_scheduler:
config:
- name: policy2
schedulers:
- sequence: 0
scheduler_type: wrr
weight: 5
meter_type: bytes
cir: 50000
pir: 60000
cbs: 800000
pbs: 900000
state: overridden

# After state:
# ------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy2
# Queue: 0
# type: wrr
# weight: 5
# meter-type: bytes
# cir: 50 Kbps
# cbs: 800000 Bytes
# pir: 60 Kbps
# pbs: 900000 Bytes
32 changes: 32 additions & 0 deletions models/enterprise_sonic/qos_scheduler/replaced_example_01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Using Replaced
#
# Before state:
# -------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
# Queue: 0
# type: dwrr
# weight: 10
# meter-type: packets
# cir: 32000 Pps
# cbs: 30000 Packets
# pir: 40000 Pps
# pbs: 35000 Packets

- name: Replace QoS scheduler configurations
dellemc.enterprise_sonic.sonic_qos_scheduler:
config:
- name: policy1
schedulers:
- sequence: 0
weight: 12
state: replaced

# After state:
# ------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
# Queue: 0
# weight: 12
95 changes: 95 additions & 0 deletions models/enterprise_sonic/qos_scheduler/sonic_qos_scheduler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
GENERATOR_VERSION: '1.0'
NETWORK_OS: sonic
RESOURCE: qos_scheduler
COPYRIGHT: Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved
DOCUMENTATION: |
module: sonic_qos_scheduler
version_added: "2.5.0"
short_description: Manage QoS scheduler configuration on SONiC
description:
- This module provides configuration management of QoS scheduler for devices running SONiC
author: "Shade Talabi (@stalabi1)"
options:
config:
description:
- QoS scheduler configuration
type: list
elements: dict
suboptions:
name:
description:
- Name of scheduler policy
type: str
required: True
schedulers:
description:
- Schedulers configuration for the scheduler policy
type: list
elements: dict
suboptions:
sequence:
description:
- Sequence number of the scheduler
- Range 0-7 for interface queues
- Range 0-47 for CPU queues
- Specify 255 for port queues
type: int
required: True
scheduler_type:
description:
- Specifies the type of scheduler
- Strict priority scheduling cannot be configured with weight
type: str
choices:
- dwrr
- wrr
- strict
weight:
description:
- Weight of the scheduler
- Range 1-100
type: int
meter_type:
description:
- Metering method used by the scheduler
type: str
choices:
- packets
- bytes
cir:
description:
- Commited information rate measured in bps
- Range 0-400000000000
type: int
pir:
description:
- Peak information rate measured in bps
- Range 0-400000000000, must be greater than or equal to cir
type: int
cbs:
description:
- Committed burst size measured in bytes
- Range 0-125000000
type: int
pbs:
description:
- Excess burst size measured in bytes
- Range 0-125000000
type: int
state:
description:
- The state of the configuration after module completion
type: str
choices:
- merged
- deleted
- replaced
- overridden
default: merged
EXAMPLES:
- deleted_example_01.txt
- merged_example_01.txt
- overridden_example_01.txt
- replaced_example_01.txt