Skip to content

Commit 9959898

Browse files
vharish02yxieca
authored andcommitted
[device/dell] Get Server ports from vlan config (#1386)
This commit adds new support for dynamic buffer configuration. The cable_length macro is updated to return the cable length for server ports. Since the server ports are part of VLAN MEMBERS, the macro loops through the VLAN MEMBER ports and returns the cable length accordingly. If the port is not part of the SERVER port then it defaults to default cable length. The new code in the macro will be executed only if the switch is ToRRouter which is connected to the server on one side. Tested the code by loading minigraph configuration on the switch which had configuration for leaf-router as DEVICE NEIGHHOR and server ports in VLAN and ports which are not part of either server or leaf router. The dynamically generated buffer.json and config_db.json file had the cable_legnth updated accordingly for server ports with "5m" and leafrouter with "40m" and unconnected port to default "300m". The redis database also reflects the buffer profile's for 5m, 40m and 300m. Signed-off-by: Harish Venkatraman <[email protected]>
1 parent 5576c11 commit 9959898

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers.json.j2

+19-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,25 @@
3535
{%- if cable_len -%}
3636
{{ cable_len.0 }}
3737
{%- else -%}
38-
{{ default_cable }}
38+
{%- if switch_role == 'ToRRouter' -%}
39+
{%- for local_port in VLAN_MEMBER -%}
40+
{%- set vlan_port = local_port.split("|") -%}
41+
{%- if vlan_port[1] == port_name -%}
42+
{%- set roles3 = switch_role + '_' + 'server' -%}
43+
{%- set roles3 = roles3 | lower -%}
44+
{%- if roles3 in ports2cable -%}
45+
{%- if cable_len.append(ports2cable[roles3]) -%}{%- endif -%}
46+
{%- endif -%}
47+
{%- endif -%}
48+
{%- endfor -%}
49+
{%- if cable_len -%}
50+
{{cable_len.0}}
51+
{%- else -%}
52+
{{ default_cable }}
53+
{%- endif -%}
54+
{%- else -%}
55+
{{ default_cable }}
56+
{%- endif -%}
3957
{%- endif -%}
4058
{% endmacro %}
4159

0 commit comments

Comments
 (0)