Skip to content
Merged
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
3 changes: 3 additions & 0 deletions ansible/templates/minigraph_device.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<MultiPortsInterface>false</MultiPortsInterface>
<PortName>0</PortName>
<Priority>0</Priority>
{% if subtype is defined and subtype == 'SmartSwitch' and index > 27 %}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @prabhataravind @nnelluri-cisco , looks like this will cause issue on the hwsku with more than 28 ports like Mellanox-SN4280-O8C40, And I still don't understand why we need this since we can add the Dpc role in the hwsku.json and when deploying mingraph it will be taken to the config_db.json automatically by sonic.
For example: https://github.com/sonic-net/sonic-buildimage/blob/3e0bdc60b22e68e11c8b513c4e63f0eab1529147/device/mellanox/x86_64-nvidia_sn4280-r0/Mellanox-SN4280-O8C40/hwsku.json#L247
It doesn't look like a proper way to handle this in test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nnelluri-cisco please check and update on the plan to address this without breaking any other platform.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prabhataravind
will check and Ramesh and will address the issue.

Copy link
Copy Markdown

@rameshraghupathy rameshraghupathy Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prabhataravind @nnelluri-cisco You don't have to check the index at all. You can check only the role as shown

{% for index in range(num_of_intf) %}
  <a:EthernetInterface>
    <ElementType>DeviceInterface</ElementType>
    <AlternateSpeeds i:nil="true"/>
    <EnableFlowControl>true</EnableFlowControl>
    <Index>1</Index>
    <InterfaceName>{{ port_alias[index] }}</InterfaceName>
    <InterfaceType i:nil="true"/>
    <MultiPortsInterface>false</MultiPortsInterface>
    <PortName>0</PortName>
    <Priority>0</Priority>
{% set intf = port_alias[index] %}
{% if subtype is defined and subtype == 'SmartSwitch' and intf[8:]|int >= 224 %}
    <role>Dpc</role>
{% endif %}
  </a:EthernetInterface>
{% endfor %}

<role>Dpc</role>
{% endif %}
{% if port_speed[port_alias[index]] is defined %}
<Speed>{{ port_speed[port_alias[index]] }}</Speed>
{% elif (breakout_speed is defined) and (hwsku in breakout_speed) and (port_alias[index] in breakout_speed[hwsku].keys()) %}
Expand Down
Loading