[sonic-cfggen]: Add DEVICE_NEIGHBOR_METADATA field and move msn27xx template (#1025)

This field contains all neighbor devices information using the device
hostname as the key and having lo_addr, mgmt_addr, hwsku, type as the
attributes.

Move the file msn27xx.32ports.buffers.json.j2 from sonic-swss repository to
this repository so that we could add unit test for this file.

Unit test is added for platform ACS-MSN2700.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
This commit is contained in:
Shuotian Cheng 2017-10-19 00:38:25 -07:00 committed by GitHub
parent d302d713a6
commit 2a56479187
7 changed files with 2929 additions and 0 deletions

View File

@ -31,5 +31,6 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["ipinip.json.j2", "/usr/share/sonic/templates/"]
COPY ["mirror.json.j2", "/usr/share/sonic/templates/"]
COPY ["ports.json.j2", "/usr/share/sonic/templates/"]
COPY ["msn27xx.32ports.buffers.json.j2", "/usr/share/sonic/templates/"]
ENTRYPOINT ["/usr/bin/supervisord"]

View File

@ -0,0 +1,294 @@
[
{% set port_names_list = [] %}
{% for port in PORT %}
{%- if port_names_list.append(port) %}{% endif %}
{% endfor %}
{% set port_names = port_names_list | join(',') %}
{
"BUFFER_POOL_TABLE:ingress_lossless_pool": {
"size": "3024486",
"type": "ingress",
"mode": "dynamic"
},
"OP": "SET"
},
{
"BUFFER_POOL_TABLE:ingress_lossy_pool": {
"size": "6422528",
"type": "ingress",
"mode": "dynamic"
},
"OP": "SET"
},
{
"BUFFER_POOL_TABLE:egress_lossless_pool": {
"size": "7291456",
"type": "egress",
"mode": "dynamic"
},
"OP": "SET"
},
{
"BUFFER_POOL_TABLE:egress_lossy_pool": {
"size": "8254464",
"type": "egress",
"mode": "dynamic"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:ingress_lossless_profile": {
"pool":"[BUFFER_POOL_TABLE:ingress_lossless_pool]",
"size":"0",
"dynamic_th":"7"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:ingress_lossy_profile": {
"pool":"[BUFFER_POOL_TABLE:ingress_lossy_pool]",
"size":"0",
"dynamic_th":"7"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:egress_lossless_profile": {
"pool":"[BUFFER_POOL_TABLE:egress_lossless_pool]",
"size":"1518",
"dynamic_th":"7"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:egress_lossy_profile": {
"pool":"[BUFFER_POOL_TABLE:egress_lossy_pool]",
"size":"4096",
"dynamic_th":"7"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:pg_lossy_profile": {
"pool":"[BUFFER_POOL_TABLE:ingress_lossy_pool]",
"size":"0",
"dynamic_th":"3"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:q_lossless_profile": {
"pool":"[BUFFER_POOL_TABLE:egress_lossless_pool]",
"size":"0",
"dynamic_th":"7"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:q_lossy_profile": {
"pool":"[BUFFER_POOL_TABLE:egress_lossy_pool]",
"size":"0",
"dynamic_th":"1"
},
"OP": "SET"
},
{
"BUFFER_PORT_INGRESS_PROFILE_LIST:{{ port_names }}": {
"profile_list" : "[BUFFER_PROFILE_TABLE:ingress_lossless_profile],[BUFFER_PROFILE_TABLE:ingress_lossy_profile]"
},
"OP": "SET"
},
{
"BUFFER_PORT_EGRESS_PROFILE_LIST:{{ port_names }}": {
"profile_list" : "[BUFFER_PROFILE_TABLE:egress_lossless_profile],[BUFFER_PROFILE_TABLE:egress_lossy_profile]"
},
"OP": "SET"
},
{# The following template part is for variable PG profile configuration #}
{% set pg_range = '3-4' %}
{# Lists of supported speed and cable length #}
{% set supported_speed = [10000, 25000, 40000, 50000, 100000] %}
{% set supported_cable = [5, 40, 300] %}
{# The key in this lictionary consist of two parts: (port speed)_(cable length) #}
{%- set portconfig2profile = {
'10000_5' : 'pg_lossless_10G_5m_profile',
'25000_5' : 'pg_lossless_25G_5m_profile',
'40000_5' : 'pg_lossless_40G_5m_profile',
'50000_5' : 'pg_lossless_50G_5m_profile',
'100000_5' : 'pg_lossless_100G_5m_profile',
'10000_40' : 'pg_lossless_10G_40m_profile',
'25000_40' : 'pg_lossless_25G_40m_profile',
'40000_40' : 'pg_lossless_40G_40m_profile',
'50000_40' : 'pg_lossless_50G_40m_profile',
'100000_40' : 'pg_lossless_100G_40m_profile',
'10000_300' : 'pg_lossless_10G_300m_profile',
'25000_300' : 'pg_lossless_25G_300m_profile',
'40000_300' : 'pg_lossless_40G_300m_profile',
'50000_300' : 'pg_lossless_50G_300m_profile',
'100000_300': 'pg_lossless_100G_300m_profile'
}
-%}
{# PG profiles. All profiles reffered in portconfig2profile dictionary should be declared here #}
{# Only those which were actually used will be created in SAI #}
{%- set pg_profiles = {
'pg_lossless_10G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 1 },
'pg_lossless_25G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 1 },
'pg_lossless_40G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 1 },
'pg_lossless_50G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 1 },
'pg_lossless_100G_5m_profile': { 'xon': 18432, 'xoff': 18432, 'size': 36864, 'dynamic_th': 1 },
'pg_lossless_10G_40m_profile': { 'xon': 18432, 'xoff': 18432, 'size': 36864, 'dynamic_th': 1 },
'pg_lossless_25G_40m_profile': { 'xon': 18432, 'xoff': 21504, 'size': 39936, 'dynamic_th': 1 },
'pg_lossless_40G_40m_profile': { 'xon': 18432, 'xoff': 23552, 'size': 41984, 'dynamic_th': 1 },
'pg_lossless_50G_40m_profile': { 'xon': 18432, 'xoff': 23552, 'size': 41984, 'dynamic_th': 1 },
'pg_lossless_100G_40m_profile': { 'xon': 18432, 'xoff': 35840, 'size': 54272, 'dynamic_th': 1 },
'pg_lossless_10G_300m_profile': { 'xon': 18432, 'xoff': 30720, 'size': 49152, 'dynamic_th': 1 },
'pg_lossless_25G_300m_profile': { 'xon': 18432, 'xoff': 53248, 'size': 71680, 'dynamic_th': 1 },
'pg_lossless_40G_300m_profile': { 'xon': 18432, 'xoff': 75776, 'size': 94208, 'dynamic_th': 1 },
'pg_lossless_50G_300m_profile': { 'xon': 18432, 'xoff': 75776, 'size': 94208, 'dynamic_th': 1 },
'pg_lossless_100G_300m_profile':{ 'xon': 18432, 'xoff': 165888,'size': 184320,'dynamic_th': 1 },
}
-%}
{# 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' : '5',
'LeafRouter_ToRRouter' : '40',
'SpineRouter_LeafRouter' : '300'
}
%}
{% set switch_role = DEVICE_METADATA['localhost']['type'] %}
{%- 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 -%}
{%- 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 -%}
{{ supported_cable | last }}
{%- endif -%}
{% endmacro %}
{%- macro find_closest_greater_config(speed, cable) -%}
{%- set new_speed = [] -%}
{%- for std_speed in supported_speed -%}
{%- if std_speed | int >= speed | int -%}
{%- if new_speed.append(std_speed) -%}{%- endif -%}
{% endif -%}
{%- endfor -%}
{%- set new_cable = [] -%}
{%- for std_cable in supported_cable -%}
{% if std_cable | int >= cable | int -%}
{%- if new_cable.append(std_cable) -%}{%- endif -%}
{% endif %}
{%- endfor -%}
{{ new_speed.0 }}_{{ new_cable.0 }}
{%- endmacro -%}
{% set ingress_lossless_pg_pool_size = [] %}
{% set used_pg_profiles = [] %}
{% for port in PORT %}
{%- if PORT[port].speed -%}
{%- set speed = PORT[port]['speed'] -%}
{% else %}
{%- set speed = supported_speed|last -%}
{%- endif -%}
{%- set cable = cable_length(port) -%}
{%- set port_config = speed|string + '_' + cable -%}
{%- if not port_config in portconfig2profile -%}
{% set port_config = find_closest_greater_config(speed, cable) -%}
{%- endif -%}
{% set profile = portconfig2profile[port_config] -%}
{% if ingress_lossless_pg_pool_size.append(pg_profiles[profile]['size']) %}{% endif %}
{# add to list profiles which were actually used #}
{%- if profile not in used_pg_profiles and used_pg_profiles.append(profile) %}{% endif -%}
{
"BUFFER_PG_TABLE:{{ port }}:{{ pg_range }}": {
"profile" : "[BUFFER_PROFILE_TABLE:{{ profile }}]"
},
"OP": "SET"
},
{% endfor -%}
{# PG profiles declaration #}
{% for profile_name in used_pg_profiles %}
{%- set profile_config = pg_profiles[profile_name] %}
{
"BUFFER_PROFILE_TABLE:{{ profile_name }}": {
"pool":"[BUFFER_POOL_TABLE:ingress_lossless_pg_pool]",
"xon":"{{ profile_config['xon'] }}",
"xoff":"{{ profile_config['xoff'] }}",
"size":"{{ profile_config['size'] }}",
"dynamic_th":"{{ profile_config['dynamic_th'] }}"
},
"OP": "SET"
},
{% endfor -%}
{# Pool declaration #}
{
"BUFFER_POOL_TABLE:ingress_lossless_pg_pool": {
"size": "{{ ingress_lossless_pg_pool_size | sum }}",
"type": "ingress",
"mode": "dynamic"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:{{ port_names }}:0-1": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossy_profile]"
},
"OP": "SET"
},
{
"BUFFER_QUEUE_TABLE:{{ port_names }}:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:q_lossless_profile]"
},
"OP": "SET"
},
{
"BUFFER_QUEUE_TABLE:{{ port_names }}:0-1": {
"profile" : "[BUFFER_PROFILE_TABLE:q_lossy_profile]"
},
"OP": "SET"
},
{
"PFC_PRIORITY_TO_PRIORITY_GROUP_MAP_TABLE:AZURE": {
"0": "0",
"1": "1",
"3": "3",
"4": "4"
},
"OP": "SET"
},
{
"PORT_QOS_MAP_TABLE:{{ port_names }}": {
"pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP_TABLE:AZURE]"
},
"OP": "SET"
}
]

View File

@ -443,6 +443,7 @@ def parse_xml(filename, platform=None, port_config_file=None):
results['VLAN'] = vlans
results['DEVICE_NEIGHBOR'] = neighbors
results['DEVICE_NEIGHBOR_METADATA'] = { key:devices[key] for key in devices if key != hostname }
results['SYSLOG_SERVER'] = dict((item, {}) for item in syslog_servers)
results['DHCP_SERVER'] = dict((item, {}) for item in dhcp_servers)
results['NTP_SERVER'] = dict((item, {}) for item in ntp_servers)

View File

@ -0,0 +1,33 @@
# name lanes
Ethernet0 0,1,2,3
Ethernet4 4,5,6,7
Ethernet8 8,9,10,11
Ethernet12 12,13,14,15
Ethernet16 16,17,18,19
Ethernet20 20,21,22,23
Ethernet24 24,25,26,27
Ethernet28 28,29,30,31
Ethernet32 32,33,34,35
Ethernet36 36,37,38,39
Ethernet40 40,41,42,43
Ethernet44 44,45,46,47
Ethernet48 48,49,50,51
Ethernet52 52,53,54,55
Ethernet56 56,57,58,59
Ethernet60 60,61,62,63
Ethernet64 64,65,66,67
Ethernet68 68,69,70,71
Ethernet72 72,73,74,75
Ethernet76 76,77,78,79
Ethernet80 80,81,82,83
Ethernet84 84,85,86,87
Ethernet88 88,89,90,91
Ethernet92 92,93,94,95
Ethernet96 96,97,98,99
Ethernet100 100,101,102,103
Ethernet104 104,105,106,107
Ethernet108 108,109,110,111
Ethernet112 112,113,114,115
Ethernet116 116,117,118,119
Ethernet120 120,121,122,123
Ethernet124 124,125,126,127

View File

@ -0,0 +1,349 @@
[
{
"BUFFER_POOL_TABLE:ingress_lossless_pool": {
"size": "3024486",
"type": "ingress",
"mode": "dynamic"
},
"OP": "SET"
},
{
"BUFFER_POOL_TABLE:ingress_lossy_pool": {
"size": "6422528",
"type": "ingress",
"mode": "dynamic"
},
"OP": "SET"
},
{
"BUFFER_POOL_TABLE:egress_lossless_pool": {
"size": "7291456",
"type": "egress",
"mode": "dynamic"
},
"OP": "SET"
},
{
"BUFFER_POOL_TABLE:egress_lossy_pool": {
"size": "8254464",
"type": "egress",
"mode": "dynamic"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:ingress_lossless_profile": {
"pool":"[BUFFER_POOL_TABLE:ingress_lossless_pool]",
"size":"0",
"dynamic_th":"7"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:ingress_lossy_profile": {
"pool":"[BUFFER_POOL_TABLE:ingress_lossy_pool]",
"size":"0",
"dynamic_th":"7"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:egress_lossless_profile": {
"pool":"[BUFFER_POOL_TABLE:egress_lossless_pool]",
"size":"1518",
"dynamic_th":"7"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:egress_lossy_profile": {
"pool":"[BUFFER_POOL_TABLE:egress_lossy_pool]",
"size":"4096",
"dynamic_th":"7"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:pg_lossy_profile": {
"pool":"[BUFFER_POOL_TABLE:ingress_lossy_pool]",
"size":"0",
"dynamic_th":"3"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:q_lossless_profile": {
"pool":"[BUFFER_POOL_TABLE:egress_lossless_pool]",
"size":"0",
"dynamic_th":"7"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:q_lossy_profile": {
"pool":"[BUFFER_POOL_TABLE:egress_lossy_pool]",
"size":"0",
"dynamic_th":"1"
},
"OP": "SET"
},
{
"BUFFER_PORT_INGRESS_PROFILE_LIST:Ethernet8,Ethernet0,Ethernet4,Ethernet108,Ethernet100,Ethernet104,Ethernet68,Ethernet96,Ethernet124,Ethernet92,Ethernet120,Ethernet52,Ethernet56,Ethernet76,Ethernet72,Ethernet64,Ethernet32,Ethernet16,Ethernet36,Ethernet12,Ethernet88,Ethernet116,Ethernet80,Ethernet112,Ethernet84,Ethernet48,Ethernet44,Ethernet40,Ethernet28,Ethernet60,Ethernet20,Ethernet24": {
"profile_list" : "[BUFFER_PROFILE_TABLE:ingress_lossless_profile],[BUFFER_PROFILE_TABLE:ingress_lossy_profile]"
},
"OP": "SET"
},
{
"BUFFER_PORT_EGRESS_PROFILE_LIST:Ethernet8,Ethernet0,Ethernet4,Ethernet108,Ethernet100,Ethernet104,Ethernet68,Ethernet96,Ethernet124,Ethernet92,Ethernet120,Ethernet52,Ethernet56,Ethernet76,Ethernet72,Ethernet64,Ethernet32,Ethernet16,Ethernet36,Ethernet12,Ethernet88,Ethernet116,Ethernet80,Ethernet112,Ethernet84,Ethernet48,Ethernet44,Ethernet40,Ethernet28,Ethernet60,Ethernet20,Ethernet24": {
"profile_list" : "[BUFFER_PROFILE_TABLE:egress_lossless_profile],[BUFFER_PROFILE_TABLE:egress_lossy_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet8:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet0:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet4:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet108:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet100:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet104:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet68:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet96:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet124:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet92:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet120:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet52:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet56:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet76:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet72:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet64:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet32:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet16:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet36:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet12:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet88:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet116:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet80:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet112:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet84:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet48:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet44:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet40:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet28:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet60:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet20:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet24:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile]"
},
"OP": "SET"
},
{
"BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile": {
"pool":"[BUFFER_POOL_TABLE:ingress_lossless_pg_pool]",
"xon":"18432",
"xoff":"75776",
"size":"94208",
"dynamic_th":"1"
},
"OP": "SET"
},
{
"BUFFER_POOL_TABLE:ingress_lossless_pg_pool": {
"size": "3014656",
"type": "ingress",
"mode": "dynamic"
},
"OP": "SET"
},
{
"BUFFER_PG_TABLE:Ethernet8,Ethernet0,Ethernet4,Ethernet108,Ethernet100,Ethernet104,Ethernet68,Ethernet96,Ethernet124,Ethernet92,Ethernet120,Ethernet52,Ethernet56,Ethernet76,Ethernet72,Ethernet64,Ethernet32,Ethernet16,Ethernet36,Ethernet12,Ethernet88,Ethernet116,Ethernet80,Ethernet112,Ethernet84,Ethernet48,Ethernet44,Ethernet40,Ethernet28,Ethernet60,Ethernet20,Ethernet24:0-1": {
"profile" : "[BUFFER_PROFILE_TABLE:pg_lossy_profile]"
},
"OP": "SET"
},
{
"BUFFER_QUEUE_TABLE:Ethernet8,Ethernet0,Ethernet4,Ethernet108,Ethernet100,Ethernet104,Ethernet68,Ethernet96,Ethernet124,Ethernet92,Ethernet120,Ethernet52,Ethernet56,Ethernet76,Ethernet72,Ethernet64,Ethernet32,Ethernet16,Ethernet36,Ethernet12,Ethernet88,Ethernet116,Ethernet80,Ethernet112,Ethernet84,Ethernet48,Ethernet44,Ethernet40,Ethernet28,Ethernet60,Ethernet20,Ethernet24:3-4": {
"profile" : "[BUFFER_PROFILE_TABLE:q_lossless_profile]"
},
"OP": "SET"
},
{
"BUFFER_QUEUE_TABLE:Ethernet8,Ethernet0,Ethernet4,Ethernet108,Ethernet100,Ethernet104,Ethernet68,Ethernet96,Ethernet124,Ethernet92,Ethernet120,Ethernet52,Ethernet56,Ethernet76,Ethernet72,Ethernet64,Ethernet32,Ethernet16,Ethernet36,Ethernet12,Ethernet88,Ethernet116,Ethernet80,Ethernet112,Ethernet84,Ethernet48,Ethernet44,Ethernet40,Ethernet28,Ethernet60,Ethernet20,Ethernet24:0-1": {
"profile" : "[BUFFER_PROFILE_TABLE:q_lossy_profile]"
},
"OP": "SET"
},
{
"PFC_PRIORITY_TO_PRIORITY_GROUP_MAP_TABLE:AZURE": {
"0": "0",
"1": "1",
"3": "3",
"4": "4"
},
"OP": "SET"
},
{
"PORT_QOS_MAP_TABLE:Ethernet8,Ethernet0,Ethernet4,Ethernet108,Ethernet100,Ethernet104,Ethernet68,Ethernet96,Ethernet124,Ethernet92,Ethernet120,Ethernet52,Ethernet56,Ethernet76,Ethernet72,Ethernet64,Ethernet32,Ethernet16,Ethernet36,Ethernet12,Ethernet88,Ethernet116,Ethernet80,Ethernet112,Ethernet84,Ethernet48,Ethernet44,Ethernet40,Ethernet28,Ethernet60,Ethernet20,Ethernet24": {
"pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP_TABLE:AZURE]"
},
"OP": "SET"
}
]

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,8 @@ class TestJ2Files(TestCase):
self.t0_minigraph = os.path.join(self.test_dir, 't0-sample-graph.xml')
self.pc_minigraph = os.path.join(self.test_dir, 'pc-test-graph.xml')
self.t0_port_config = os.path.join(self.test_dir, 't0-sample-port-config.ini')
self.t1_mlnx_minigraph = os.path.join(self.test_dir, 't1-sample-graph-mlnx.xml')
self.mlnx_port_config = os.path.join(self.test_dir, 'sample-port-config-mlnx.ini')
self.output_file = os.path.join(self.test_dir, 'output')
def run_script(self, argument):
@ -84,6 +86,15 @@ class TestJ2Files(TestCase):
assert filecmp.cmp(sample_output_file, self.output_file)
def test_msn27xx_32ports_buffers(self):
buffer_file = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'msn27xx.32ports.buffers.json.j2')
argument = '-m ' + self.t1_mlnx_minigraph + ' -p ' + self.mlnx_port_config + ' -t ' + buffer_file + ' > ' + self.output_file
self.run_script(argument)
sample_output_file = os.path.join(self.test_dir, 'sample_output', 'msn27.32ports.json')
self.assertTrue(filecmp.cmp(sample_output_file, self.output_file))
def tearDown(self):
try: