-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[chassis] add the scheduler config only on ports which are admin-up #24603
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ | |
| {%- set PORT_UPLINK = [] %} | ||
| {%- set PORT_DOWNLINK = [] %} | ||
| {%- set PORT_SERVICE = [] %} | ||
| {%- set SYSTEM_PORT_ACTIVE [] %} | ||
|
|
||
|
|
||
| {% if template_exists("buffers.json.j2") %} | ||
| {% import "buffers.json.j2" as buffer_defs with context %} | ||
|
|
@@ -23,20 +25,38 @@ | |
| {%- endif -%} | ||
|
|
||
| {%- set voq_chassis = false %} | ||
| {%- set hostname = "" %} | ||
| {%- set asicname = "" %} | ||
arlakshm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost']['switch_type'] is defined and DEVICE_METADATA['localhost']['switch_type'] == 'voq' %} | ||
| {%- set voq_chassis = true %} | ||
| {%- endif -%} | ||
|
|
||
| {%- if voq_chassis %} | ||
| {%- for system_port in SYSTEM_PORT %} | ||
| {% if '|' not in system_port %} | ||
| {%- set system_port_name = system_port|join("|") %} | ||
| {% else %} | ||
| {%- set system_port_name = system_port %} | ||
| {% endif %} | ||
| {%- if 'cpu' not in system_port_name.lower() and 'IB' not in system_port_name and 'Rec' not in system_port_name %} | ||
| {%- if SYSTEM_PORT_ALL.append(system_port_name) %}{%- endif %} | ||
| {%- if DEVICE_METADATA is defined and 'localhost' in DEVICE_METADATA and 'hostname' in DEVICE_METADATA['localhost'] -%} | ||
| {%- set hostname = DEVICE_METADATA['localhost']['hostname'] -%} | ||
| {%- endif %} | ||
| {%- if DEVICE_METADATA is defined and 'localhost' in DEVICE_METADATA and 'asic_name' in DEVICE_METADATA['localhost'] -%} | ||
| {%- set asicname = DEVICE_METADATA['localhost']['asic_name'] -%} | ||
| {%- endif %} | ||
| {%- for system_port in SYSTEM_PORT -%} | ||
| {% if '|' not in system_port %} | ||
| {%- set system_port_name = system_port|join("|") -%} | ||
| {%- else %} | ||
| {%- set system_port_name = system_port -%} | ||
| {%- endif %} | ||
| {%- if 'cpu' not in system_port_name.lower() and 'IB' not in system_port_name and 'Rec' not in system_port_name -%} | ||
| {%- if SYSTEM_PORT_ALL.append(system_port_name) -%} | ||
| {%- endif %} | ||
| {#- find all system_port_name has hostname|asicname. If it is true, get the portname and check if the port name is present in the deviceNeighbor -#} | ||
| {%- if hostname != "" and asicname != "" -%} | ||
| {%- if system_port_name.startswith(hostname + '|' + asicname) -%} | ||
| {%- set port_name = system_port_name.split('|')[2] -%} | ||
| {%- if DEVICE_NEIGHBOR is defined and port_name in DEVICE_NEIGHBOR -%} | ||
arlakshm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {%- if SYSTEM_PORT_ACTIVE.append(system_port_name) %}{%- endif -%} | ||
| {%- endif -%} | ||
| {%- endif -%} | ||
| {%- endif -%} | ||
| {%- endif %} | ||
| {%- endfor %} | ||
| {%- endif %} | ||
| {%- for port in PORT %} | ||
|
|
@@ -492,40 +512,44 @@ | |
| "QUEUE": { | ||
| {% for system_port in SYSTEM_PORT_ALL %} | ||
| "{{ system_port }}|3": { | ||
| "scheduler" : "scheduler.1", | ||
| {% if system_port in SYSTEM_PORT_ACTIVE -%} | ||
| "scheduler": "scheduler.1", | ||
| {% endif -%} | ||
| "wred_profile": "AZURE_LOSSLESS" | ||
| }, | ||
|
Comment on lines
514
to
519
|
||
| {% endfor %} | ||
| {% for system_port in SYSTEM_PORT_ALL %} | ||
| "{{ system_port }}|4": { | ||
| "scheduler" : "scheduler.1", | ||
| {% if system_port in SYSTEM_PORT_ACTIVE -%} | ||
| "scheduler": "scheduler.1", | ||
| {% endif -%} | ||
| "wred_profile": "AZURE_LOSSLESS" | ||
| }, | ||
| {% endfor %} | ||
| {% for system_port in SYSTEM_PORT_ALL %} | ||
| }{% if not loop.last %},{% endif %} | ||
|
||
| {% for system_port in SYSTEM_PORT_ACTIVE %} | ||
| "{{ system_port }}|0": { | ||
| "scheduler": "scheduler.0" | ||
| }, | ||
| {% endfor %} | ||
| {% for system_port in SYSTEM_PORT_ALL %} | ||
| {% for system_port in SYSTEM_PORT_ACTIVE %} | ||
| "{{ system_port }}|1": { | ||
| "scheduler": "scheduler.0" | ||
| }, | ||
| {% endfor %} | ||
| {% for system_port in SYSTEM_PORT_ALL %} | ||
| {% for system_port in SYSTEM_PORT_ACTIVE %} | ||
| "{{ system_port }}|2": { | ||
| "scheduler": "scheduler.0" | ||
| }, | ||
| {% endfor %} | ||
| {% for system_port in SYSTEM_PORT_ALL %} | ||
| {% for system_port in SYSTEM_PORT_ACTIVE %} | ||
| "{{ system_port }}|5": { | ||
| "scheduler": "scheduler.0" | ||
| }, | ||
| {% endfor %} | ||
| {% for system_port in SYSTEM_PORT_ALL %} | ||
| {% for system_port in SYSTEM_PORT_ACTIVE %} | ||
| "{{ system_port }}|6": { | ||
| "scheduler": "scheduler.0" | ||
| }{% if not loop.last %},{% endif %} | ||
|
|
||
| {% endfor %} | ||
| } | ||
| {% elif generate_direction_based_queue_per_sku is defined and (PORT_DOWNLINK|length > 0 or PORT_UPLINK|length > 0) %} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing equals sign in list initialization. The syntax should be
{%- set SYSTEM_PORT_ACTIVE = [] %}instead of{%- set SYSTEM_PORT_ACTIVE [] %}.