2020-02-17 16:09:15 -06:00
|
|
|
{# Default values which will be used if no actual configura available #}
|
|
|
|
{% set default_cable = '40m' %}
|
|
|
|
{% set default_speed = '10G' %}
|
|
|
|
{% set default_ports_num = 54 -%}
|
|
|
|
|
|
|
|
{# Port configuration to cable length look-up table #}
|
|
|
|
{# Each record describes mapping of DUT (DUT port) role and neighbor role to cable length #}
|
|
|
|
{# Roles described in the minigraph #}
|
|
|
|
{% set ports2cable = {
|
|
|
|
'torrouter_server' : '5m',
|
|
|
|
'leafrouter_torrouter' : '40m',
|
|
|
|
'spinerouter_leafrouter' : '300m'
|
|
|
|
}
|
|
|
|
%}
|
|
|
|
|
|
|
|
{%- macro cable_length(port_name) -%}
|
|
|
|
{%- set cable_len = [] -%}
|
|
|
|
{%- for local_port in DEVICE_NEIGHBOR -%}
|
|
|
|
{%- if local_port == port_name -%}
|
|
|
|
{%- if DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%}
|
|
|
|
{%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%}
|
|
|
|
{%- set neighbor_role = neighbor.type -%}
|
|
|
|
{%- set roles1 = switch_role + '_' + neighbor_role %}
|
|
|
|
{%- set roles2 = neighbor_role + '_' + switch_role -%}
|
|
|
|
{%- set roles1 = roles1 | lower -%}
|
|
|
|
{%- set roles2 = roles2 | lower -%}
|
|
|
|
{%- if roles1 in ports2cable -%}
|
|
|
|
{%- if cable_len.append(ports2cable[roles1]) -%}{%- endif -%}
|
|
|
|
{%- elif roles2 in ports2cable -%}
|
|
|
|
{%- if cable_len.append(ports2cable[roles2]) -%}{%- endif -%}
|
|
|
|
{%- endif -%}
|
|
|
|
{%- endif -%}
|
|
|
|
{%- endif -%}
|
|
|
|
{%- endfor -%}
|
|
|
|
{%- if cable_len -%}
|
|
|
|
{{ cable_len.0 }}
|
|
|
|
{%- else -%}
|
|
|
|
{{ default_cable }}
|
|
|
|
{%- endif -%}
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{%- if DEVICE_METADATA is defined %}
|
|
|
|
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
|
|
|
{%- endif -%}
|
|
|
|
|
|
|
|
{# Generate list of ports if not defined #}
|
|
|
|
{% if PORT is not defined %}
|
|
|
|
{% set PORT = [] %}
|
|
|
|
{% for port_idx in range(0,default_ports_num) %}
|
|
|
|
{% if PORT.append("Ethernet%d" % (port_idx)) %}{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif -%}
|
|
|
|
|
|
|
|
{% set port_names_list = [] %}
|
|
|
|
{% for port in PORT %}
|
|
|
|
{%- if port_names_list.append(port) %}{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% set port_names = port_names_list | join(',') -%}
|
|
|
|
|
|
|
|
{
|
|
|
|
"CABLE_LENGTH": {
|
|
|
|
"AZURE": {
|
|
|
|
{% for port in PORT %}
|
|
|
|
{% set cable = cable_length(port) -%}
|
|
|
|
"{{ port }}": "{{ cable }}"{%- if not loop.last -%},{% endif %}
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"BUFFER_POOL": {
|
|
|
|
"ingress_lossless_pool": {
|
|
|
|
"size": "20971328",
|
|
|
|
"type": "ingress",
|
|
|
|
"mode": "static"
|
|
|
|
},
|
|
|
|
"ingress_lossy_pool": {
|
|
|
|
"size": "20971328",
|
|
|
|
"type": "ingress",
|
|
|
|
"mode": "static"
|
|
|
|
},
|
|
|
|
"egress_lossy_pool": {
|
|
|
|
"size": "20971328",
|
|
|
|
"type": "egress",
|
|
|
|
"mode": "static"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"BUFFER_PROFILE": {
|
|
|
|
"ingress_lossless_profile": {
|
SONIC QOS YANG - Remove qos tables field value refernce format (#7752)
Depends on Azure/sonic-utilities#1626
Depends on Azure/sonic-swss#1754
QOS tables in config db used ABNF format i.e "[TABLE_NAME|name] to refer fieldvalue to other qos tables.
Example:
Config DB:
"Ethernet92|3": {
"scheduler": "[SCHEDULER|scheduler.1]",
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]"
},
"Ethernet0|0": {
"profile": "[BUFFER_PROFILE|ingress_lossy_profile]"
},
"Ethernet0": {
"dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]",
"pfc_enable": "3,4",
"pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]",
"tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]",
"tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]"
},
This format is not consistent with other DB schema followed in sonic.
And also this reference in DB is not required, This is taken care by YANG "leafref".
Removed this format from all platform files to consistent with other sonic db schema.
Example:
"Ethernet92|3": {
"scheduler": "scheduler.1",
"wred_profile": "AZURE_LOSSLESS"
},
Dependent pull requests:
#7752 - To modify platfrom files
#7281 - Yang model
Azure/sonic-utilities#1626 - DB migration
Azure/sonic-swss#1754 - swss change to remove ABNF format
2021-09-28 11:21:24 -05:00
|
|
|
"pool":"ingress_lossless_pool",
|
2020-02-17 16:09:15 -06:00
|
|
|
"xon":"78400",
|
|
|
|
"xoff":"132160",
|
|
|
|
"size":"3584",
|
|
|
|
"static_th":"82880"
|
|
|
|
},
|
|
|
|
"ingress_lossy_profile": {
|
SONIC QOS YANG - Remove qos tables field value refernce format (#7752)
Depends on Azure/sonic-utilities#1626
Depends on Azure/sonic-swss#1754
QOS tables in config db used ABNF format i.e "[TABLE_NAME|name] to refer fieldvalue to other qos tables.
Example:
Config DB:
"Ethernet92|3": {
"scheduler": "[SCHEDULER|scheduler.1]",
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]"
},
"Ethernet0|0": {
"profile": "[BUFFER_PROFILE|ingress_lossy_profile]"
},
"Ethernet0": {
"dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]",
"pfc_enable": "3,4",
"pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]",
"tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]",
"tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]"
},
This format is not consistent with other DB schema followed in sonic.
And also this reference in DB is not required, This is taken care by YANG "leafref".
Removed this format from all platform files to consistent with other sonic db schema.
Example:
"Ethernet92|3": {
"scheduler": "scheduler.1",
"wred_profile": "AZURE_LOSSLESS"
},
Dependent pull requests:
#7752 - To modify platfrom files
#7281 - Yang model
Azure/sonic-utilities#1626 - DB migration
Azure/sonic-swss#1754 - swss change to remove ABNF format
2021-09-28 11:21:24 -05:00
|
|
|
"pool":"ingress_lossy_pool",
|
2020-02-17 16:09:15 -06:00
|
|
|
"size":"3584",
|
|
|
|
"dynamic_th":"-1"
|
|
|
|
},
|
|
|
|
"egress_lossy_profile": {
|
SONIC QOS YANG - Remove qos tables field value refernce format (#7752)
Depends on Azure/sonic-utilities#1626
Depends on Azure/sonic-swss#1754
QOS tables in config db used ABNF format i.e "[TABLE_NAME|name] to refer fieldvalue to other qos tables.
Example:
Config DB:
"Ethernet92|3": {
"scheduler": "[SCHEDULER|scheduler.1]",
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]"
},
"Ethernet0|0": {
"profile": "[BUFFER_PROFILE|ingress_lossy_profile]"
},
"Ethernet0": {
"dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]",
"pfc_enable": "3,4",
"pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]",
"tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]",
"tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]"
},
This format is not consistent with other DB schema followed in sonic.
And also this reference in DB is not required, This is taken care by YANG "leafref".
Removed this format from all platform files to consistent with other sonic db schema.
Example:
"Ethernet92|3": {
"scheduler": "scheduler.1",
"wred_profile": "AZURE_LOSSLESS"
},
Dependent pull requests:
#7752 - To modify platfrom files
#7281 - Yang model
Azure/sonic-utilities#1626 - DB migration
Azure/sonic-swss#1754 - swss change to remove ABNF format
2021-09-28 11:21:24 -05:00
|
|
|
"pool":"egress_lossy_pool",
|
2020-02-17 16:09:15 -06:00
|
|
|
"size":"3584",
|
|
|
|
"dynamic_th":"-4"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"BUFFER_PG": {
|
|
|
|
},
|
|
|
|
"BUFFER_QUEUE": {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|