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

Feat(eos_cli_config_gen): Support cos in policy-map and service-policy in qos profile #1504

Merged
merged 3 commits into from
Feb 17, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ interface Management1
**PM_REPLICATION_LD**

| class | Set | Value |
emilarista marked this conversation as resolved.
Show resolved Hide resolved
| ---- | ----- | ----- |
| ----- | --- | ----- |
| CM_REPLICATION_LD | drop_precedence | 1 |
| CM_REPLICATION_LD | dscp | af11 |
| CM_REPLICATION_LD | traffic_class | 2 |
Expand All @@ -108,7 +108,8 @@ interface Management1
**PM_REPLICATION_LD2**

| class | Set | Value |
| ---- | ----- | ----- |
| ----- | --- | ----- |
| CM_REPLICATION_LD | cos | 4 |
| CM_REPLICATION_LD | dscp | af11 |

### QOS Policy Maps configuration
Expand All @@ -129,6 +130,7 @@ policy-map type quality-of-service PM_REPLICATION_LD
policy-map type quality-of-service PM_REPLICATION_LD2
class CM_REPLICATION_LD
set dscp af11
set cos 4
!
!
policy-map type pbr PM_PBR_BREAKOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ QOS Profile: **experiment**

**Settings**

| Default COS | Default DSCP | Trust | Shape Rate |
| ----------- | ------------ | ----- | ---------- |
| 2 | - | cos | - |
| Default COS | Default DSCP | Trust | Shape Rate | QOS Service Policy |
| ----------- | ------------ | ----- | ---------- | ------------------ |
| 2 | - | cos | - | test_qos_policy_v1 |

**Tx-queues**

Expand All @@ -240,17 +240,17 @@ QOS Profile: **no_qos_trust**

**Settings**

| Default COS | Default DSCP | Trust | Shape Rate |
| ----------- | ------------ | ----- | ---------- |
| 3 | 4 | disabled | - |
| Default COS | Default DSCP | Trust | Shape Rate | QOS Service Policy |
| ----------- | ------------ | ----- | ---------- | ------------------ |
| 3 | 4 | disabled | - | - |

QOS Profile: **test**

**Settings**

| Default COS | Default DSCP | Trust | Shape Rate |
| ----------- | ------------ | ----- | ---------- |
| - | 46 | dscp | 80 percent |
| Default COS | Default DSCP | Trust | Shape Rate | QOS Service Policy |
| ----------- | ------------ | ----- | ---------- | ------------------ |
| - | 46 | dscp | 80 percent | - |

**Tx-queues**

Expand All @@ -267,6 +267,7 @@ QOS Profile: **test**
qos profile experiment
qos trust cos
qos cos 2
service-policy type qos input test_qos_policy_v1
!
tx-queue 3
bandwidth percent 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ policy-map type quality-of-service PM_REPLICATION_LD
policy-map type quality-of-service PM_REPLICATION_LD2
class CM_REPLICATION_LD
set dscp af11
set cos 4
!
!
policy-map type pbr PM_PBR_BREAKOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ hostname qos
qos profile experiment
qos trust cos
qos cos 2
service-policy type qos input test_qos_policy_v1
!
tx-queue 3
bandwidth percent 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ policy_maps:
CM_REPLICATION_LD:
set:
dscp: af11
cos: 4
pbr:
PM_PBR_BREAKOUT:
classes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ qos_profiles:
experiment:
trust: cos
cos: 2
service_policy:
type:
qos_input: test_qos_policy_v1
tx_queues:
3:
bandwidth_percent: 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2381,6 +2381,7 @@ policy_maps:
classes:
< class name >:
set:
cos: < cos_value >
dscp: < dscp-code >
traffic_class: < traffic-class ID >
drop_precedence: < drop-precedence value >
Expand All @@ -2396,6 +2397,9 @@ qos_profiles:
dscp: < dscp-value >
shape:
rate: < "< rate > kbps" | "1-100 percent" | "< rate > pps" , supported options are platform dependent >
service_policy:
type:
qos_input: < policy_map_name >
tx_queues:
< tx-queue-id >:
bandwidth_percent: < value >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
**{{ policy_map }}**

| class | Set | Value |
| ---- | ----- | ----- |
| ----- | --- | ----- |
{% for class in policy_maps.qos[policy_map].classes | arista.avd.natural_sort %}
{% for set in policy_maps.qos[policy_map].classes[class].set | arista.avd.natural_sort %}
| {{ class }} | {{ set }} | {{ policy_maps.qos[policy_map].classes[class].set[set] }} |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ QOS Profile: **{{ profile }}**

**Settings**

| Default COS | Default DSCP | Trust | Shape Rate |
| ----------- | ------------ | ----- | ---------- |
| Default COS | Default DSCP | Trust | Shape Rate | QOS Service Policy |
| ----------- | ------------ | ----- | ---------- | ------------------ |
{% set cos = qos_profiles[profile].cos | arista.avd.default('-') %}
{% set dscp = qos_profiles[profile].dscp | arista.avd.default('-') %}
{% set trust = qos_profiles[profile].trust | arista.avd.default('-') %}
{% set shape_rate = qos_profiles[profile].shape.rate | arista.avd.default('-') %}
| {{ cos }} | {{ dscp }} | {{ trust }} | {{ shape_rate }} |
{% set qos_sp = qos_profiles[profile].service_policy.type.qos_input | arista.avd.default('-') %}
| {{ cos }} | {{ dscp }} | {{ trust }} | {{ shape_rate }} | {{ qos_sp }} |
{% if qos_profiles[profile].tx_queues is arista.avd.defined %}

**Tx-queues**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ policy-map type quality-of-service {{ policy_map }}
{% if policy_maps.qos[policy_map].classes[class].set is arista.avd.defined %}
{% for set in policy_maps.qos[policy_map].classes[class].set %}
{% set cli_set = set | replace('_','-') | lower %}
{% if cli_set in ['dscp', 'traffic-class', 'drop-precedence'] %}
{% if cli_set in ['cos', 'dscp', 'traffic-class', 'drop-precedence'] %}
set {{ cli_set }} {{ policy_maps.qos[policy_map].classes[class].set[set] }}
{% endif %}
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ qos profile {{ profile }}
{% if qos_profiles[profile].shape.rate is arista.avd.defined %}
shape rate {{ qos_profiles[profile].shape.rate }}
{% endif %}
{% if qos_profiles[profile].service_policy.type.qos_input is arista.avd.defined %}
service-policy type qos input {{ qos_profiles[profile].service_policy.type.qos_input }}
{% endif %}
{% for tx_queue in qos_profiles[profile].tx_queues | arista.avd.natural_sort %}
!
tx-queue {{ tx_queue }}
Expand Down