Skip to content

Fixes to minigraph generation for linecards in a VoQ Chassis#4699

Merged
arlakshm merged 3 commits intosonic-net:masterfrom
sanmalho-git:gen-mg
Dec 8, 2021
Merged

Fixes to minigraph generation for linecards in a VoQ Chassis#4699
arlakshm merged 3 commits intosonic-net:masterfrom
sanmalho-git:gen-mg

Conversation

@sanmalho-git
Copy link
Contributor

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911

Approach

What is the motivation for this PR?

PR# 4479 added support for minigraph generation for packet based chassis.

However, this broke the generated minigraph for linecards in a VoQ chassis.

There were two issues in the minigraph generated with this PR:

  • In Cpg
    • Missing BGPRouterDeclaration section for remote asics - <remote_linecard>-ASIC<#>
    • For multi-asic linecard, missing BGPRouterDeclaraion section for my asics - ASIC<#>
  • In Dpg, we are missing the DeviceDataPlaneInfo for my asics in a multi-asic linecard
    • This is generated in template_dpg_asic, which is dependent on asic_topo_config.
      For voq_chassis, asic_topo_config is empty dictionary - as the iBGP connections depend on the what linecards are present in the chassis, and also what asics are on each linecard.

How did you do it?

To fix the above issues:

  • create an almost empty asic topology file for our multi-asic linecard with slot0.
  • In config_sonic_basedon_testbed.yml, when dealing with voq switch_type, before running through the Jinja2 templates,
    change slot0 in the asic_topo_config to the slot_num that is defined in the inventory.

Below is the asic topology for a multi-asic linecard Nokia_IXR7250e_36x400G card (in vars/topo_Nokia_IXR7250e_36x400G.yml) that is added:

slot0:
    ASIC0:
      topology:
        NEIGH_ASIC:
      configuration_properties:
        common:
          asic_type: FrontEnd
      configuration:

    ASIC1:
      topology:
        NEIGH_ASIC:
      configuration_properties:
        common:
          asic_type: FrontEnd
      configuration:

How did you verify/test it?

Generated minigraph for single and multi-asic linecards in a VoQ chassis and validated with:

  • loading minigraph on the linecards
  • Running iface_naming mode and test_interfaces on the linecards that exercise minigraph_facts on host and asic level.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

PR# 4479 added support for minigraph generation for packet based chassis.

However, this broke the generated minigraph for linecards in a VoQ chassis.

There were two issues in the minigraph generated with PR sonic-net#4479:

- In Cpg
    - Missing BGPRouterDeclaration section for remote asics - <remote_linecard>-ASIC<#>
    - For multi-asic linecard, missing BGPRouterDeclaraion section for my asics - ASIC<#>
- In Dpg, we are missing the DeviceDataPlaneInfo for my asics in a multi-asic linecard
    - This is generated in template_dpg_asic, which is dependent on asic_topo_config.
      For voq_chassis, asic_topo_config is empty dictionary - as the iBGP connections depend on the what linecards are present in the chassis, and also what asics are on each linecard.

To fix the above issues:
- create an almost empty asic topology file for our multi-asic linecard with slot0.
- In config_sonic_basedon_testbed.yml, when dealing with voq switch_type, before running through the Jinja2 templates,
  change slot0 in the asic_topo_config to the slot_num that is defined in the inventory.

Below is the asic topology for our multi-asic linecard Nokia_IXR7250e_36x400G card (in vars/topo_Nokia_IXR7250e_36x400G.yml) that I prototyped with:

slot0:
    ASIC0:
      topology:
        NEIGH_ASIC:
      configuration_properties:
        common:
          asic_type: FrontEnd
      configuration:

    ASIC1:
      topology:
        NEIGH_ASIC:
      configuration_properties:
        common:
          asic_type: FrontEnd
      configuration:
In minigraph_dpg_asic.j2 we are making port channel names be zero padded with upto 2 zeros with 'zfill(2)' - example: PortChannel02
However, in minigraph_dpg.j2, the padded is upto 4 zeros with 'zfill(4)' - example: PortChannel0002

This causes mismatch in the minigraph for the port channels in the host DeviceDataPlaneInfo  vs asic DeviceDataPlaneInfo.

Fix is to use 'zfill(2)' in minigraph_dpg.j2 as well, instead of 'zfill(4)'.
{% set asic_name = "ASIC" + asic_id|string %}
<a:BGPRouterDeclaration>
<a:ASN>{{ vm_topo_config['dut_asn'] }}</a:ASN>
<a:Hostname>{{ asic_name }}</a:Hostname>
Copy link
Contributor

Choose a reason for hiding this comment

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

why this is removed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that we asic_topo_config defined for multi-asic line cards, this is covered by iterating over asic_topo_config at line 203.

<Name i:Name="true"/>
{% if 'port-channel' in vm_topo_config['vm'][vms[index]]['ip_intf'][dut_index|int]|lower %}
<AttachTo>PortChannel{{ ((index+1) |string).zfill(4) }}</AttachTo>
<AttachTo>PortChannel{{ ((index+1) |string).zfill(2) }}</AttachTo>
Copy link
Contributor

Choose a reason for hiding this comment

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

what is need of this change ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Two reasons:

  • For multi-asic, the asic DeviceDataPlanInfo defines port channels with 1 leading 0 (like PortChannel02), while the host level DeviceDataPlanInfo defines the port channels with 3 leading 0's (like PortChannel0002). So, this mismatch causes some tests to fail. Example:
    • iface_namingmode/test_iface_namingmode.py::TestShowInterfaces::test_show_interfaces_portchannel. In this test we get minigraph_facts for duthost with would be padded with 3 0's and check against 'show interfaces portchannel' which from the asic config_db.json generated from minigraph would be padded to only 1 0.
  • If we have a combination of single asic and multi-asic linecards, then in show commands on single asic we would have port channels padded with 3 0's, while on multi-asic they would be padded with only 1 0. So, did the change to have consistency across single and multi-asic line cards

Copy link
Contributor

Choose a reason for hiding this comment

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

@sanmalho-git i think you might not have this change #4576.
After above PR External Portchannel will always have 4 digit. Can you revert this particular change and then we can merge the PR. I have verified other change is good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - I missed that PR in my testing. I have reverted the commit that changed the PortChannels to have 2 digits instead of 4.

@arlakshm arlakshm merged commit 3f68c30 into sonic-net:master Dec 8, 2021
AntonHryshchuk pushed a commit to AntonHryshchuk/sonic-mgmt that referenced this pull request Jan 4, 2022
sonic-net#4699)

What is the motivation for this PR?
PR# 4479 added support for minigraph generation for packet based chassis.
However, this broke the generated minigraph for linecards in a VoQ chassis.

There were two issues in the minigraph generated with this PR:

In Cpg
Missing BGPRouterDeclaration section for remote asics - <remote_linecard>-ASIC<#>
For multi-asic linecard, missing BGPRouterDeclaraion section for my asics - ASIC<#>
In Dpg, we are missing the DeviceDataPlaneInfo for my asics in a multi-asic linecard
This is generated in template_dpg_asic, which is dependent on asic_topo_config.
For voq_chassis, asic_topo_config is empty dictionary - as the iBGP connections depend on the what linecards are present in the chassis, and also what asics are on each linecard.
How did you do it?
To fix the above issues:

create an almost empty asic topology file for our multi-asic linecard with slot0.
In config_sonic_basedon_testbed.yml, when dealing with voq switch_type, before running through the Jinja2 templates,
change slot0 in the asic_topo_config to the slot_num that is defined in the inventory.
@sanmalho-git sanmalho-git deleted the gen-mg branch April 15, 2022 15:39
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.

3 participants