Skip to content

Comments

Allow for minigraph to change to 100G speed with platform capability#25658

Draft
arpit-nexthop wants to merge 2 commits intosonic-net:masterfrom
nexthop-ai:nh5010.speed_change_minigraph
Draft

Allow for minigraph to change to 100G speed with platform capability#25658
arpit-nexthop wants to merge 2 commits intosonic-net:masterfrom
nexthop-ai:nh5010.speed_change_minigraph

Conversation

@arpit-nexthop
Copy link
Contributor

Why I did it

Allow minigraph.py to generate 100G with 2 lanes in config_db for speed change.

How I did it

  1. Migrated NH-5010 to use platform.json and hwsku.json instead of port_config.ini
  2. Enhanced portconfig.py to accept parameters for the voq platforms
  3. Enhanced minigraph.py to read the platform.json for number of lanes

How to verify it

Used

<?xml version="1.0" encoding="utf-8"?>
<DeviceMiniGraph xmlns="Microsoft.Search.Autopilot.Evolution" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <CpgDec>
    <IsisRouters xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
    <PeeringSessions/>
    <Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
  </CpgDec>
  <DpgDec>
    <DeviceDataPlaneInfo>
      <Hostname>NH-5010-F-O64-TEST</Hostname>
      <IPSecTunnels xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.NetMux"/>
      <LoopbackIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.NetMux">
        <a:LoopbackIPInterface>
          <a:AttachTo>Loopback0</a:AttachTo>
          <a:Prefix xmlns:b="Microsoft.Search.Autopilot.NetMux">10.1.0.1/32</a:Prefix>
        </a:LoopbackIPInterface>
      </LoopbackIPInterfaces>
      <ManagementIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.NetMux">
        <a:ManagementIPInterface>
          <a:AttachTo>eth0</a:AttachTo>
          <a:Prefix xmlns:b="Microsoft.Search.Autopilot.NetMux">10.0.0.100/24</a:Prefix>
        </a:ManagementIPInterface>
      </ManagementIPInterfaces>
      <IPInterfaces>
        <IPInterface>
          <Name i:nil="true"/>
          <AttachTo>etp1</AttachTo>
          <Prefix>192.168.1.1/31</Prefix>
        </IPInterface>
        <IPInterface>
          <Name i:nil="true"/>
          <AttachTo>etp33</AttachTo>
          <Prefix>192.168.2.1/31</Prefix>
        </IPInterface>
        <IPInterface>
          <Name i:nil="true"/>
          <AttachTo>etp2</AttachTo>
          <Prefix>192.168.3.1/31</Prefix>
        </IPInterface>
      </IPInterfaces>
      <VlanInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.NetMux"/>
      <PortChannelInterfaces/>
      <DataAcls/>
      <AclInterfaces/>
      <DownstreamSummaries/>
      <DownstreamSummarySet xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
    </DeviceDataPlaneInfo>
  </DpgDec>
  <PngDec>
    <DeviceInterfaceLinks>
      <!-- Test PAM4 port (port 1): 400G -> 100G should use 2 lanes -->
      <DeviceLinkBase i:type="DeviceInterfaceLink">
        <Bandwidth>100000</Bandwidth>
        <ElementType>DeviceInterfaceLink</ElementType>
        <EndDevice>NH-5010-F-O64-TEST</EndDevice>
        <EndPort>etp1</EndPort>
        <StartDevice>PEER-SWITCH-1</StartDevice>
        <StartPort>Ethernet1</StartPort>
      </DeviceLinkBase>
      <!-- Test NRZ port (port 33): 400G -> 100G should use 4 lanes -->
      <DeviceLinkBase i:type="DeviceInterfaceLink">
        <Bandwidth>100000</Bandwidth>
        <ElementType>DeviceInterfaceLink</ElementType>
        <EndDevice>NH-5010-F-O64-TEST</EndDevice>
        <EndPort>etp33</EndPort>
        <StartDevice>PEER-SWITCH-2</StartDevice>
        <StartPort>Ethernet1</StartPort>
      </DeviceLinkBase>
      <!-- Test another PAM4 port (port 2): Keep at 400G -->
      <DeviceLinkBase i:type="DeviceInterfaceLink">
        <Bandwidth>400000</Bandwidth>
        <ElementType>DeviceInterfaceLink</ElementType>
        <EndDevice>NH-5010-F-O64-TEST</EndDevice>
        <EndPort>etp2</EndPort>
        <StartDevice>PEER-SWITCH-3</StartDevice>
        <StartPort>Ethernet1</StartPort>
      </DeviceLinkBase>
    </DeviceInterfaceLinks>
    <Devices>
      <Device i:type="LeafRouter">
        <Hostname>NH-5010-F-O64-TEST</Hostname>
        <HwSku>NH-5010-F-O64</HwSku>
      </Device>
    </Devices>
  </PngDec>
  <DeviceInfos>
    <DeviceInfo>
      <EthernetInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
        <!-- Port 1 (etp1) - PAM4, default 400G -->
        <a:EthernetInterface>
          <ElementType>DeviceInterface</ElementType>
          <AlternateSpeeds i:nil="true"/>
          <Index>1</Index>
          <InterfaceName>etp1</InterfaceName>
          <MultiPortsInterface>false</MultiPortsInterface>
          <Speed>400000</Speed>
        </a:EthernetInterface>
        <!-- Port 2 (etp2) - PAM4, default 400G -->
        <a:EthernetInterface>
          <ElementType>DeviceInterface</ElementType>
          <AlternateSpeeds i:nil="true"/>
          <Index>2</Index>
          <InterfaceName>etp2</InterfaceName>
          <MultiPortsInterface>false</MultiPortsInterface>
          <Speed>400000</Speed>
        </a:EthernetInterface>
        <!-- Port 33 (etp33) - NRZ, default 400G -->
        <a:EthernetInterface>
          <ElementType>DeviceInterface</ElementType>
          <AlternateSpeeds i:nil="true"/>
          <Index>33</Index>
          <InterfaceName>etp33</InterfaceName>
          <MultiPortsInterface>false</MultiPortsInterface>
          <Speed>400000</Speed>
        </a:EthernetInterface>
      </EthernetInterfaces>
      <HwSku>NH-5010-F-O64</HwSku>
      <ManagementInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
        <a:ManagementInterface>
          <ElementType>DeviceInterface</ElementType>
          <AlternateSpeeds i:nil="true"/>
          <Index>1</Index>
          <InterfaceName>eth0</InterfaceName>
          <MultiPortsInterface>false</MultiPortsInterface>
          <Speed>1000</Speed>
        </a:ManagementInterface>
      </ManagementInterfaces>
    </DeviceInfo>
  </DeviceInfos>
  <Hostname>NH-5010-F-O64-TEST</Hostname>
  <HwSku>NH-5010-F-O64</HwSku>
</DeviceMiniGraph>

and validated the generated config_db using:

sonic-cfggen -H -p platform.json -S NH-5010-F-O64/hwsku.json  -m /home/admin/test_minigraph_100G.xml  --print-data

Further testing in progress

Which release branch to backport (provide reason below if selected)

  • 202505
  • 202511

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

1. Migrated NH-5010 to use platform.json and hwsku.json instead of port_config.ini
2. Enhanced portconfig.py to accept parameters for the voq platforms
3. Enhanced minigraph.py to read the platform.json for number of lanes

Signed-off-by: arpit-nexthop <arpit@nexthop.ai>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants