dellemc.enterprise_sonic.sonic_qos_buffer module – Manage QoS buffer configuration on SONiC

Note

This module is part of the dellemc.enterprise_sonic collection (version 2.5.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install dellemc.enterprise_sonic.

To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_qos_buffer.

New in dellemc.enterprise_sonic 2.5.0

Synopsis

  • This module provides configuration management of QoS buffer for devices running SONiC

Parameters

Parameter

Comments

config

dictionary

QoS buffer configuration

buffer_pools

list / elements=dictionary

Buffer pools configuration

name

string / required

Name of buffer pool

Choices:

  • "ingress_lossless_pool"

xoff

integer

Amount of shared buffer space in bytes, must be less than pool size

Required non-key attribute

buffer_profiles

list / elements=dictionary

Buffer profiles configuration

static_threshold and dynamic_threshold are mutually exclusive required non-key attributes

dynamic_threshold

integer

Dynamic threshold value

Range -6-3

name

string / required

Name of buffer profile

pause_threshold

integer

Threshold value at which to stop traffic from peer

Range 46080-8388608

Configurable for ingress lossless pool

pool

string

Name of buffer pool

Required non-key attribute

Choices:

  • "ingress_lossless_pool"

  • "egress_lossless_pool"

  • "egress_lossy_pool"

size

integer

Size of reserved buffer in bytes

Required non-key attribute

static_threshold

integer

Static threshold for the shared usage in bytes

state

string

The state of the configuration after module completion

Replaced and overridden states are not supported for this module due to configuration constraints

Choices:

  • "merged" ← (default)

  • "deleted"

Notes

Note

  • Tested against Enterprise SONiC Distribution by Dell Technologies.

  • Supports check_mode.

  • The SONiC buffer initialization command must be executed before attempting to apply

  • the configuration commands provided in this resource module. The buffer initialization will cause

  • the switch to reboot. See the “playbooks/common_examples/QoS_buffer_init.yaml” file

  • in this repo for an example playbook that initializes the buffers, waits for the reboot,

  • then proceeds with execution of QoS buffer configuration commands. Alternatively, make use of the

  • sonic_roce resource module to enable RoCEv2 default buffer configuration.

Examples

# Using Merged
#
# Before state:
# -------------
#
# sonic# show running-configuration | grep buffer
# buffer init lossless
# buffer pool ingress_lossless_pool shared-headroom-size 1000000

  - name: Merge QoS buffer configuration
    dellemc.enterprise_sonic.sonic_qos_buffer:
      config:
        buffer_pools:
          - name: ingress_lossless_pool
            xoff: 3500000
        buffer_profiles:
          - name: profile1
            pool: ingress_lossless_pool
            size: 45
            static_threshold: 25
            pause_threshold: 55000
          - name: profile2
            pool: egress_lossless_pool
            size: 85
            dynamic_threshold: -2
          - name: profile3
            pool: egress_lossy_pool
            size: 90
            static_threshold: 30
      state: merged

# After state:
# ------------
#
# sonic# show running-configuration | grep buffer
# buffer init lossless
# buffer pool ingress_lossless_pool shared-headroom-size 3500000
# buffer profile profile1 ingress_lossless_pool 45 static-threshold 25 pause pause-threshold 55000
# buffer profile profile2 egress_lossy_pool 85 dynamic-threshold -2
# buffer profile profile3 egress_lossless_pool 90 static-threshold 30
#
#
# Using deleted
#
# Before state:
# -------------
#
# sonic# show running-configuration | grep buffer
# buffer init lossless
# buffer pool ingress_lossless_pool shared-headroom-size 3500000
# buffer profile profile1 ingress_lossless_pool 45 static-threshold 25 pause pause-threshold 55000
# buffer profile profile2 egress_lossy_pool 85 dynamic-threshold -2
# buffer profile profile3 egress_lossless_pool 90 static-threshold 30

  - name: Delete QoS buffer profile configuration
    dellemc.enterprise_sonic.sonic_qos_buffer:
      config:
        buffer_profiles:
          - name: profile1
            static_threshold: 25
            pause_threshold: 55000
          - name: profile2
            dynamic_threshold: -2
          - name: profile3
      state: deleted

# After state:
# ------------
#
# sonic# show running-configuration | grep buffer
# buffer init lossless
# buffer pool ingress_lossless_pool shared-headroom-size 3500000
# buffer profile profile1 ingress_lossless_pool 45
# buffer profile profile2 egress_lossy_pool 85

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

after

list / elements=string

The resulting configuration model invocation.

Returned: when changed

Sample: ["The configuration returned will always be in the same format of the parameters above.\n"]

after(generated)

list / elements=string

The generated configuration model invocation.

Returned: when check_mode

Sample: ["The configuration returned will always be in the same format\n of the parameters above.\n"]

before

list / elements=string

The configuration prior to the model invocation.

Returned: always

Sample: ["The configuration returned will always be in the same format of the parameters above.\n"]

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: always

Sample: ["command 1", "command 2", "command 3"]

Authors

  • Shade Talabi (@stalabi1)