Skip to content

Commit

Permalink
Merge branch 'master' into bookworm_migration_for_mgmt_framework_and_…
Browse files Browse the repository at this point in the history
…gnmi
  • Loading branch information
ranjinidn committed May 8, 2024
2 parents ecc1d02 + 8047998 commit 99ec35e
Show file tree
Hide file tree
Showing 127 changed files with 3,725 additions and 1,629 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,6 @@
[submodule "platform/marvell/sonic-platform-marvell"]
path = platform/marvell/sonic-platform-marvell
url = https://github.com/Marvell-switching/sonic-platform-arm64.git
[submodule "platform/innovium/sonic-platform-marvell"]
path = platform/innovium/sonic-platform-marvell
url = https://github.com/Marvell-switching/sonic-platform-marvell
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# name lanes alias index role speed asic_port_name coreId corePortId numVoq
# name lanes alias index role speed asic_port_name core_id core_port_id num_voq
Ethernet0 6,7 Ethernet1/1 1 Ext 100000 Eth0 0 1 8
Ethernet4 2,3 Ethernet2/1 2 Ext 100000 Eth4 0 2 8
Ethernet8 4,5 Ethernet3/1 3 Ext 100000 Eth8 0 3 8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# name lanes alias index role speed asic_port_name coreId corePortId numVoq
# name lanes alias index role speed asic_port_name core_id core_port_id num_voq
Ethernet0 72,73,74,75 Ethernet1/1 1 Ext 100000 Eth0 1 1 8
Ethernet8 80,81,82,83 Ethernet2/1 2 Ext 100000 Eth8 1 2 8
Ethernet16 88,89,90,91 Ethernet3/1 3 Ext 100000 Eth16 1 3 8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# name lanes alias index role speed asic_port_name coreId corePortId numVoq
# name lanes alias index role speed asic_port_name core_id core_port_id num_voq
Ethernet144 72,73,74,75 Ethernet19/1 19 Ext 100000 Eth0 1 1 8
Ethernet152 80,81,82,83 Ethernet20/1 20 Ext 100000 Eth8 1 2 8
Ethernet160 88,89,90,91 Ethernet21/1 21 Ext 100000 Eth16 1 3 8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# name lanes alias index role speed asic_port_name coreId corePortId numVoq
# name lanes alias index role speed asic_port_name core_id core_port_id num_voq
Ethernet0 72,73,74,75 Ethernet1/1 1 Ext 100000 Eth0 1 1 8
Ethernet4 76,77,78,79 Ethernet1/5 1 Ext 100000 Eth4 1 2 8
Ethernet8 80,81,82,83 Ethernet2/1 2 Ext 100000 Eth8 1 3 8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# name lanes alias index role speed asic_port_name coreId corePortId numVoq
# name lanes alias index role speed asic_port_name core_id core_port_id num_voq
Ethernet144 72,73,74,75 Ethernet19/1 19 Ext 100000 Eth144 1 1 8
Ethernet148 76,77,78,79 Ethernet19/5 19 Ext 100000 Eth148 1 2 8
Ethernet152 80,81,82,83 Ethernet20/1 20 Ext 100000 Eth152 1 3 8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# name lanes alias index role speed asic_port_name coreId corePortId numVoq
# name lanes alias index role speed asic_port_name core_id core_port_id num_voq
Ethernet0 72,73,74,75,76,77,78,79 Ethernet1/1 1 Ext 400000 Eth0 1 1 8
Ethernet8 80,81,82,83,84,85,86,87 Ethernet2/1 2 Ext 400000 Eth8 1 2 8
Ethernet16 88,89,90,91,92,93,94,95 Ethernet3/1 3 Ext 400000 Eth16 1 3 8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# name lanes alias index role speed asic_port_name coreId corePortId numVoq
# name lanes alias index role speed asic_port_name core_id core_port_id num_voq
Ethernet144 72,73,74,75,76,77,78,79 Ethernet19/1 19 Ext 400000 Eth0 1 1 8
Ethernet152 80,81,82,83,84,85,86,87 Ethernet20/1 20 Ext 400000 Eth8 1 2 8
Ethernet160 88,89,90,91,92,93,94,95 Ethernet21/1 21 Ext 400000 Eth16 1 3 8
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{# Default values which will be used if no actual configuration available #}
{% set default_cable = '40m' %}

{# 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 is defined and 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 %}
{%- if switch_role.lower() == 'torrouter' %}
{%- for local_port in VLAN_MEMBER %}
{%- if local_port[1] == port_name %}
{%- set roles3 = switch_role + '_' + 'server' %}
{%- set roles3 = roles3 | lower %}
{%- if roles3 in ports2cable %}
{%- if cable_len.append(ports2cable[roles3]) %}{% endif %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if cable_len -%}
{{ cable_len.0 }}
{%- else -%}
{{ default_cable }}
{%- endif %}
{%- else -%}
{{ default_cable }}
{%- endif %}
{%- endif %}
{%- endmacro %}

{%- if DEVICE_METADATA is defined %}
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
{%- 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": "158630302",
"type": "ingress",
"mode": "dynamic",
"xoff": "71577600"
},
"lossy_pool": {
"size": "56012386",
"type": "egress",
"mode": "dynamic",
"xoff": "0"
},
"egress_lossless_pool": {
"size": "214642688",
"type": "egress",
"mode": "static"
}
},
"BUFFER_PROFILE": {
"ingress_lossless_profile": {
"pool":"ingress_lossless_pool",
"xoff":"135520",
"size":"1518",
"dynamic_th":"1",
"xon_offset":"9408"
},
"egress_lossless_profile": {
"pool":"ingress_lossless_pool",
"size":"0",
"static_th":"22798336"
},
"ingress_lossy_profile": {
"pool":"lossy_pool",
"size":"0",
"static_th":"22798336"
},
"egress_lossy_profile": {
"pool":"lossy_pool",
"size":"1518",
"dynamic_th":"2"
}
},
"BUFFER_PG": {
{% for port in port_names_list %}
"{{ port }}|3-4": {
"profile" : "ingress_lossless_profile"
},
{% endfor %}
{% for port in port_names_list %}
"{{ port }}|0": {
"profile" : "ingress_lossy_profile"
},
{% endfor %}
{% for port in port_names_list %}
"{{ port }}|1-2": {
"profile" : "ingress_lossy_profile"
},
{% endfor %}
{% for port in port_names_list %}
"{{ port }}|5-7": {
"profile" : "ingress_lossy_profile"
}{% if not loop.last %},{% endif %}

{% endfor %}
},

"BUFFER_QUEUE": {
{% for port in port_names_list %}
"{{ port }}|3-4": {
"profile" : "egress_lossless_profile"
},
{% endfor %}
{% for port in port_names_list %}
"{{ port }}|0-2": {
"profile" : "egress_lossy_profile"
},
{% endfor %}
{% for port in port_names_list %}
"{{ port }}|5-7": {
"profile" : "egress_lossy_profile"
}{% if not loop.last %},{% endif %}

{% endfor %}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{% 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": {
"lossy_pool": {
"size": "182386688",
"type": "egress",
"mode": "dynamic",
"xoff": "0"
}
},
"BUFFER_PROFILE": {
"ingress_lossy_profile": {
"pool":"lossy_pool",
"size":"0",
"static_th":"22798336"
},
"egress_lossy_profile": {
"pool":"lossy_pool",
"size":"1518",
"dynamic_th":"2"
}
},
"BUFFER_PG": {
{% for port in port_names_list %}
"{{ port }}|0-7": {
"profile" : "ingress_lossy_profile"
}{% if not loop.last %},{% endif %}
{% endfor %}
},
"BUFFER_QUEUE": {
{% for port in port_names_list %}
"{{ port }}|0-7": {
"profile" : "egress_lossy_profile"
}{% if not loop.last %},{% endif %}
{% endfor %}
}
}
Loading

0 comments on commit 99ec35e

Please sign in to comment.