230 lines
7.1 KiB
Plaintext
230 lines
7.1 KiB
Plaintext
|
{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %}
|
||
|
"BUFFER_POOL": {
|
||
|
{% if dynamic_mode is not defined and port_names_inactive|length > 0 -%}
|
||
|
"ingress_zero_pool" : {
|
||
|
"mode": "static",
|
||
|
"type": "ingress",
|
||
|
"size": "0"
|
||
|
},
|
||
|
{% endif -%}
|
||
|
"ingress_lossless_pool": {
|
||
|
{% if dynamic_mode is not defined -%}
|
||
|
"size": "{{ ingress_lossless_pool_size }}",
|
||
|
{% endif -%}
|
||
|
"type": "ingress",
|
||
|
"mode": "dynamic"
|
||
|
},
|
||
|
"ingress_lossy_pool": {
|
||
|
{% if dynamic_mode is not defined -%}
|
||
|
"size": "{{ ingress_lossy_pool_size }}",
|
||
|
{% endif -%}
|
||
|
"type": "ingress",
|
||
|
"mode": "dynamic"
|
||
|
},
|
||
|
"egress_lossless_pool": {
|
||
|
"size": "{{ egress_lossless_pool_size }}",
|
||
|
"type": "egress",
|
||
|
"mode": "dynamic"
|
||
|
},
|
||
|
"egress_lossy_pool": {
|
||
|
{% if dynamic_mode is not defined -%}
|
||
|
"size": "{{ egress_lossy_pool_size }}",
|
||
|
{% endif -%}
|
||
|
"type": "egress",
|
||
|
"mode": "dynamic"
|
||
|
}
|
||
|
},
|
||
|
"BUFFER_PROFILE": {
|
||
|
{% if dynamic_mode is not defined and port_names_inactive|length > 0 -%}
|
||
|
"ingress_lossy_pg_zero_profile" : {
|
||
|
"pool":"[BUFFER_POOL|ingress_zero_pool]",
|
||
|
"size":"0",
|
||
|
"static_th":"0"
|
||
|
},
|
||
|
"ingress_lossless_zero_profile" : {
|
||
|
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
|
||
|
"size":"0",
|
||
|
"dynamic_th":"-8"
|
||
|
},
|
||
|
"ingress_lossy_zero_profile" : {
|
||
|
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
|
||
|
"size":"0",
|
||
|
"dynamic_th":"-8"
|
||
|
},
|
||
|
"egress_lossless_zero_profile" : {
|
||
|
"pool":"[BUFFER_POOL|egress_lossless_pool]",
|
||
|
"size":"0",
|
||
|
"dynamic_th":"-8"
|
||
|
},
|
||
|
"egress_lossy_zero_profile" : {
|
||
|
"pool":"[BUFFER_POOL|egress_lossy_pool]",
|
||
|
"size":"0",
|
||
|
"dynamic_th":"-8"
|
||
|
},
|
||
|
{% endif -%}
|
||
|
"ingress_lossless_profile": {
|
||
|
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
|
||
|
"size":"0",
|
||
|
"dynamic_th":"7"
|
||
|
},
|
||
|
"ingress_lossy_profile": {
|
||
|
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
|
||
|
"size":"0",
|
||
|
"dynamic_th":"3"
|
||
|
},
|
||
|
"egress_lossless_profile": {
|
||
|
"pool":"[BUFFER_POOL|egress_lossless_pool]",
|
||
|
"size":"0",
|
||
|
"dynamic_th":"7"
|
||
|
},
|
||
|
"egress_lossy_profile": {
|
||
|
"pool":"[BUFFER_POOL|egress_lossy_pool]",
|
||
|
"size":"9216",
|
||
|
"dynamic_th":"7"
|
||
|
},
|
||
|
"q_lossy_profile": {
|
||
|
"pool":"[BUFFER_POOL|egress_lossy_pool]",
|
||
|
"size":"0",
|
||
|
"dynamic_th":"3"
|
||
|
}
|
||
|
},
|
||
|
{%- endmacro %}
|
||
|
|
||
|
{%- macro generate_profile_lists(port_names_active, port_names_inactive) %}
|
||
|
"BUFFER_PORT_INGRESS_PROFILE_LIST": {
|
||
|
{% for port in port_names_active.split(',') %}
|
||
|
"{{ port }}": {
|
||
|
"profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]"
|
||
|
}{% if not loop.last %},{% endif %}
|
||
|
|
||
|
{% endfor %}
|
||
|
{% if port_names_inactive|length > 0 %}
|
||
|
,
|
||
|
{% for port in port_names_inactive.split(',') %}
|
||
|
"{{ port }}": {
|
||
|
{% if dynamic_mode is defined %}
|
||
|
"profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]"
|
||
|
{% else %}
|
||
|
"profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]"
|
||
|
{% endif %}
|
||
|
}{% if not loop.last %},{% endif %}
|
||
|
|
||
|
{% endfor %}
|
||
|
{% endif %}
|
||
|
},
|
||
|
"BUFFER_PORT_EGRESS_PROFILE_LIST": {
|
||
|
{% for port in port_names_active.split(',') %}
|
||
|
"{{ port }}": {
|
||
|
"profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]"
|
||
|
}{% if not loop.last %},{% endif %}
|
||
|
|
||
|
{% endfor %}
|
||
|
{% if port_names_inactive|length > 0 %}
|
||
|
,
|
||
|
{% for port in port_names_inactive.split(',') %}
|
||
|
"{{ port }}": {
|
||
|
{% if dynamic_mode is defined %}
|
||
|
"profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]"
|
||
|
{% else %}
|
||
|
"profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]"
|
||
|
{% endif %}
|
||
|
}{% if not loop.last %},{% endif %}
|
||
|
|
||
|
{% endfor %}
|
||
|
{% endif %}
|
||
|
}
|
||
|
{%- endmacro %}
|
||
|
|
||
|
{%- macro generate_queue_buffers(port_names_active, port_names_inactive) %}
|
||
|
"BUFFER_QUEUE": {
|
||
|
{% for port in port_names_active.split(',') %}
|
||
|
"{{ port }}|3-4": {
|
||
|
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
|
||
|
},
|
||
|
{% endfor %}
|
||
|
{% for port in port_names_active.split(',') %}
|
||
|
"{{ port }}|0-2": {
|
||
|
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
|
||
|
},
|
||
|
{% endfor %}
|
||
|
{% for port in port_names_active.split(',') %}
|
||
|
"{{ port }}|5-6": {
|
||
|
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
|
||
|
}{% if not loop.last %},{% endif %}
|
||
|
|
||
|
{% endfor %}
|
||
|
{% if port_names_inactive|length > 0 %}
|
||
|
,
|
||
|
{% if dynamic_mode is defined %}
|
||
|
{% for port in port_names_inactive.split(',') %}
|
||
|
"{{ port }}|3-4": {
|
||
|
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
|
||
|
},
|
||
|
{% endfor %}
|
||
|
{% for port in port_names_inactive.split(',') %}
|
||
|
"{{ port }}|0-2": {
|
||
|
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
|
||
|
},
|
||
|
{% endfor %}
|
||
|
{% for port in port_names_inactive.split(',') %}
|
||
|
"{{ port }}|5-6": {
|
||
|
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
|
||
|
}{% if not loop.last %},{% endif %}
|
||
|
|
||
|
{% endfor %}
|
||
|
{% else %}
|
||
|
{% for port in port_names_inactive.split(',') %}
|
||
|
"{{ port }}|3-4": {
|
||
|
"profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]"
|
||
|
},
|
||
|
{% endfor %}
|
||
|
{% for port in port_names_inactive.split(',') %}
|
||
|
"{{ port }}|0-2": {
|
||
|
"profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]"
|
||
|
},
|
||
|
{% endfor %}
|
||
|
{% for port in port_names_inactive.split(',') %}
|
||
|
"{{ port }}|5-6": {
|
||
|
"profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]"
|
||
|
}{% if not loop.last %},{% endif %}
|
||
|
|
||
|
{% endfor %}
|
||
|
{% endif %}
|
||
|
{% endif %}
|
||
|
}
|
||
|
{%- endmacro %}
|
||
|
|
||
|
{%- macro generate_pg_profiles(port_names_active, port_names_inactive) %}
|
||
|
"BUFFER_PG": {
|
||
|
{% for port in port_names_active.split(',') %}
|
||
|
{% if dynamic_mode is defined %}
|
||
|
"{{ port }}|3-4": {
|
||
|
"profile" : "NULL"
|
||
|
},
|
||
|
{% endif %}
|
||
|
"{{ port }}|0": {
|
||
|
"profile" : "[BUFFER_PROFILE|ingress_lossy_profile]"
|
||
|
}{% if not loop.last %},{% endif %}
|
||
|
|
||
|
{% endfor %}
|
||
|
{% if port_names_inactive|length > 0 %}
|
||
|
{%- for port in port_names_inactive.split(',') %}
|
||
|
{%- if loop.first -%},{%- endif -%}
|
||
|
{% if dynamic_mode is defined %}
|
||
|
"{{ port }}|3-4": {
|
||
|
"profile" : "NULL"
|
||
|
},
|
||
|
{% endif %}
|
||
|
"{{ port }}|0": {
|
||
|
{% if dynamic_mode is defined %}
|
||
|
"profile" : "[BUFFER_PROFILE|ingress_lossy_profile]"
|
||
|
{% else %}
|
||
|
"profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]"
|
||
|
{% endif %}
|
||
|
}{% if not loop.last %},{% endif %}
|
||
|
|
||
|
{% endfor %}
|
||
|
{% endif %}
|
||
|
}
|
||
|
{%- endmacro %}
|