Skip to content

[platform/device][inventec] support new platform d7264 and new platfo… #3937

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
@@ -0,0 +1,128 @@
{# Default values which will be used if no actual configura available #}
{% set default_cable = '300m' %}
{% set default_speed = '100G' %}
{% set default_ports_num = 64 -%}

{# 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*4)) %}{% 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": "12766208",
"type": "ingress",
"mode": "dynamic"
},
"egress_lossless_pool": {
"size": "6000000",
"type": "egress",
"mode": "static"
},
"egress_lossy_pool": {
"size": "8072396",
"type": "egress",
"mode": "dynamic"
}
},
"BUFFER_PROFILE": {
"ingress_lossless_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"xon":"18432",
"xoff":"40560",
"size":"41808",
"dynamic_th":"-4",
"xon_offset":"2496"
},
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"3"
},
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"0",
"static_th":"6000000"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"1518",
"dynamic_th":"3"
}
},
"BUFFER_PG": {
"{{ port_names }}|3-4": {
"profile" : "[BUFFER_PROFILE|ingress_lossless_profile]"
},
"{{ port_names }}|0-1": {
"profile" : "[BUFFER_PROFILE|ingress_lossy_profile]"
}
},
"BUFFER_QUEUE": {
"{{ port_names }}|3-4": {
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
},
"{{ port_names }}|0-1": {
"profile" : "[BUFFER_PROFILE|egress_lossy_profile]"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# name lanes alias index speed
Ethernet0 9,10,11,12 Ethernet0 0 100000
Ethernet4 1,2,3,4 Ethernet4 1 100000
Ethernet8 25,26,27,28 Ethernet8 2 100000
Ethernet12 17,18,19,20 Ethernet12 3 100000
Ethernet16 41,42,43,44 Ethernet16 4 100000
Ethernet20 33,34,35,36 Ethernet20 5 100000
Ethernet24 57,58,59,60 Ethernet24 6 100000
Ethernet28 49,50,51,52 Ethernet28 7 100000
Ethernet32 73,74,75,76 Ethernet32 8 100000
Ethernet36 65,66,67,68 Ethernet36 9 100000
Ethernet40 89,90,91,92 Ethernet40 10 100000
Ethernet44 81,82,83,84 Ethernet44 11 100000
Ethernet48 105,106,107,108 Ethernet48 12 100000
Ethernet52 97,98,99,100 Ethernet52 13 100000
Ethernet56 121,122,123,124 Ethernet56 14 100000
Ethernet60 113,114,115,116 Ethernet60 15 100000
Ethernet64 137,138,139,140 Ethernet64 16 100000
Ethernet68 129,130,131,132 Ethernet68 17 100000
Ethernet72 153,154,155,156 Ethernet72 18 100000
Ethernet76 145,146,147,148 Ethernet76 19 100000
Ethernet80 169,170,171,172 Ethernet80 20 100000
Ethernet84 161,162,163,164 Ethernet84 21 100000
Ethernet88 185,186,187,188 Ethernet88 22 100000
Ethernet92 177,178,179,180 Ethernet92 23 100000
Ethernet96 201,202,203,204 Ethernet96 24 100000
Ethernet100 193,194,195,196 Ethernet100 25 100000
Ethernet104 217,218,219,220 Ethernet104 26 100000
Ethernet108 209,210,211,212 Ethernet108 27 100000
Ethernet112 233,234,235,236 Ethernet112 28 100000
Ethernet116 225,226,227,228 Ethernet116 29 100000
Ethernet120 249,250,251,252 Ethernet120 30 100000
Ethernet124 241,242,243,244 Ethernet124 31 100000
Ethernet128 13,14,15,16 Ethernet128 32 100000
Ethernet132 5,6,7,8 Ethernet132 33 100000
Ethernet136 29,30,31,32 Ethernet136 34 100000
Ethernet140 21,22,23,24 Ethernet140 35 100000
Ethernet144 45,46,47,48 Ethernet144 36 100000
Ethernet148 37,38,39,40 Ethernet148 37 100000
Ethernet152 61,62,63,64 Ethernet152 38 100000
Ethernet156 53,54,55,56 Ethernet156 39 100000
Ethernet160 77,78,79,80 Ethernet160 40 100000
Ethernet164 69,70,71,72 Ethernet164 41 100000
Ethernet168 93,94,95,96 Ethernet168 42 100000
Ethernet172 85,86,87,88 Ethernet172 43 100000
Ethernet176 109,110,111,112 Ethernet176 44 100000
Ethernet180 101,102,103,104 Ethernet180 45 100000
Ethernet184 125,126,127,128 Ethernet184 46 100000
Ethernet188 117,118,119,120 Ethernet188 47 100000
Ethernet192 141,142,143,144 Ethernet192 48 100000
Ethernet196 133,134,135,136 Ethernet196 49 100000
Ethernet200 157,158,159,160 Ethernet200 50 100000
Ethernet204 149,150,151,152 Ethernet204 51 100000
Ethernet208 173,174,175,176 Ethernet208 52 100000
Ethernet212 165,166,167,168 Ethernet212 53 100000
Ethernet216 189,190,191,192 Ethernet216 54 100000
Ethernet220 181,182,183,184 Ethernet220 55 100000
Ethernet224 205,206,207,208 Ethernet224 56 100000
Ethernet228 197,198,199,200 Ethernet228 57 100000
Ethernet232 221,222,223,224 Ethernet232 58 100000
Ethernet236 213,214,215,216 Ethernet236 59 100000
Ethernet240 237,238,239,240 Ethernet240 60 100000
Ethernet244 229,230,231,232 Ethernet244 61 100000
Ethernet248 253,254,255,256 Ethernet248 62 100000
Ethernet252 245,246,247,248 Ethernet252 63 100000
143 changes: 143 additions & 0 deletions device/inventec/x86_64-inventec_d7264-r0/INVENTEC-D7264/qos.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"TC_TO_PRIORITY_GROUP_MAP": {
"AZURE": {
"0": "0",
"1": "1",
"3": "3",
"4": "4"
}
},
"MAP_PFC_PRIORITY_TO_QUEUE": {
"AZURE": {
"0": "0",
"1": "1",
"3": "3",
"4": "4"
}
},
"TC_TO_QUEUE_MAP": {
"AZURE": {
"0": "0",
"1": "1",
"3": "3",
"4": "4"
}
},
"DSCP_TO_TC_MAP": {
"AZURE": {
"0":"0",
"1":"0",
"2":"0",
"3":"3",
"4":"4",
"5":"0",
"6":"0",
"7":"0",
"8":"1",
"9":"0",
"10":"0",
"11":"0",
"12":"0",
"13":"0",
"14":"0",
"15":"0",
"16":"0",
"17":"0",
"18":"0",
"19":"0",
"20":"0",
"21":"0",
"22":"0",
"23":"0",
"24":"0",
"25":"0",
"26":"0",
"27":"0",
"28":"0",
"29":"0",
"30":"0",
"31":"0",
"32":"0",
"33":"0",
"34":"0",
"35":"0",
"36":"0",
"37":"0",
"38":"0",
"39":"0",
"40":"0",
"41":"0",
"42":"0",
"43":"0",
"44":"0",
"45":"0",
"46":"0",
"47":"0",
"48":"0",
"49":"0",
"50":"0",
"51":"0",
"52":"0",
"53":"0",
"54":"0",
"55":"0",
"56":"0",
"57":"0",
"58":"0",
"59":"0",
"60":"0",
"61":"0",
"62":"0",
"63":"0"
}
},
"SCHEDULER": {
"scheduler.0" : {
"type":"DWRR",
"weight": "25"
},
"scheduler.1" : {
"type":"DWRR",
"weight": "30"
},
"scheduler.2" : {
"type":"DWRR",
"weight": "20"
}
},
"PORT_QOS_MAP": {
"Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124,Ethernet128,Ethernet132,Ethernet136,Ethernet140,Ethernet144,Ethernet148,Ethernet152,Ethernet156,Ethernet160,Ethernet164,Ethernet168,Ethernet172,Ethernet176,Ethernet180,Ethernet184,Ethernet188,Ethernet192,Ethernet196,Ethernet200,Ethernet204,Ethernet208,Ethernet212,Ethernet216,Ethernet220,Ethernet224,Ethernet228,Ethernet232,Ethernet236,Ethernet240,Ethernet244,Ethernet248,Ethernet252": {
"dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]",
"tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]",
"tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]",
"pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]",
"pfc_enable": "3,4"
}
},
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable":"true",
"wred_yellow_enable":"true",
"wred_red_enable":"true",
"ecn":"ecn_all",
"red_max_threshold":"312000",
"red_min_threshold":"104000",
"yellow_max_threshold":"312000",
"yellow_min_threshold":"104000",
"green_max_threshold":"312000",
"green_min_threshold":"104000"
}
},
"QUEUE": {
"Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124,Ethernet128,Ethernet132,Ethernet136,Ethernet140,Ethernet144,Ethernet148,Ethernet152,Ethernet156,Ethernet160,Ethernet164,Ethernet168,Ethernet172,Ethernet176,Ethernet180,Ethernet184,Ethernet188,Ethernet192,Ethernet196,Ethernet200,Ethernet204,Ethernet208,Ethernet212,Ethernet216,Ethernet220,Ethernet224,Ethernet228,Ethernet232,Ethernet236,Ethernet240,Ethernet244,Ethernet248,Ethernet252|3-4" : {
"scheduler" : "[SCHEDULER|scheduler.0]",
"wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]"
},
"Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124,Ethernet128,Ethernet132,Ethernet136,Ethernet140,Ethernet144,Ethernet148,Ethernet152,Ethernet156,Ethernet160,Ethernet164,Ethernet168,Ethernet172,Ethernet176,Ethernet180,Ethernet184,Ethernet188,Ethernet192,Ethernet196,Ethernet200,Ethernet204,Ethernet208,Ethernet212,Ethernet216,Ethernet220,Ethernet224,Ethernet228,Ethernet232,Ethernet236,Ethernet240,Ethernet244,Ethernet248,Ethernet252|0" : {
"scheduler" : "[SCHEDULER|scheduler.1]"
},
"Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124,Ethernet128,Ethernet132,Ethernet136,Ethernet140,Ethernet144,Ethernet148,Ethernet152,Ethernet156,Ethernet160,Ethernet164,Ethernet168,Ethernet172,Ethernet176,Ethernet180,Ethernet184,Ethernet188,Ethernet192,Ethernet196,Ethernet200,Ethernet204,Ethernet208,Ethernet212,Ethernet216,Ethernet220,Ethernet224,Ethernet228,Ethernet232,Ethernet236,Ethernet240,Ethernet244,Ethernet248,Ethernet252|1" : {
"scheduler" : "[SCHEDULER|scheduler.2]"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th2-d7264-64x100g.config.bcm
SAI_NUM_ECMP_MEMBERS=32
Loading