Skip to content

[ansible][minigraph] add support for adding autonegotiation in minigraph templates and fanout EOS#13990

Merged
wangxin merged 18 commits intosonic-net:masterfrom
vdahiya12:dev/vdahiya/add-template-autoneg
Oct 8, 2024
Merged

[ansible][minigraph] add support for adding autonegotiation in minigraph templates and fanout EOS#13990
wangxin merged 18 commits intosonic-net:masterfrom
vdahiya12:dev/vdahiya/add-template-autoneg

Conversation

@vdahiya12
Copy link
Contributor

@vdahiya12 vdahiya12 commented Aug 5, 2024

Description of PR

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

  1. autoneg_enabled : True
    must be enabled in inventory files
  2. to topo file must have a port list for autoneg
    Example:
    intfs : [1, 2, 3, 4, 5, 6, 7, 8]

With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

Any platform specific information?

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

Documentation

minigraph templates

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
@prgeor prgeor requested a review from wangxin August 6, 2024 23:32
Copy link
Contributor

@prgeor prgeor left a comment

Choose a reason for hiding this comment

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

@vdahiya12 do we need more changes to enable AN on EOS?

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
vm_offset: 3
DUT:
autoneg_interfaces:
intfs: [13, 14, 15, 16, 17, 18, 19, 20]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since auto negotiation needs to be matched between DUT and fanout ports. This definition means that both DUT and fanout configuration need to be updated while deploying minigraph. An extra step needs to be added to after deploy minigraph to configure fanout ports accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

discussed offline, resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

why 8 interfaces? i thought we said half of them an/lt, and half of none an/lt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed it to 4 ports

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

ansible/TestbedProcessing.py:334:21: F841 local variable 'AutoNeg' is assigned to but never used

flake8...............................................(no files to check)Skipped
check conditional mark sort..............................................Passed

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 changed the title [ansible][minigraph] add support for adding autonegotiation in minigraph templates [ansible][minigraph] add support for adding autonegotiation in minigraph templates and fanout EOS Sep 5, 2024
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
wangxin
wangxin previously approved these changes Sep 10, 2024
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Comment on lines +69 to +71
<a:Name>FECDisabled</a:Name>
<a:Reference i:nil="true"/>
<a:Value>True</a:Value>
Copy link
Contributor

Choose a reason for hiding this comment

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

@vdahiya12 disabling FEC when AN is enabled, I would suggest to use msft_an_enabled. Also keep autoneg_enabled for only enabling AN which can be used in future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

@vdahiya12 In future each SKU needs to be updated to parse the device connection if onboarded for AN testbed?

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, every template will need to be enhanced

switchport mode dot1q-tunnel
switchport access vlan {{ device_port_vlans[inventory_hostname][intf]['vlanids'] }}
{% if device_conn[inventory_hostname][intf]['speed'] == "100000" %}
{% if device_conn[inventory_hostname][intf]['speed'] == "100000" and device_conn[inventory_hostname][intf]['autoneg']|lower == "off" %}
Copy link
Contributor

Choose a reason for hiding this comment

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

@vdahiya12 Why are we restricting to 100G only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no restriction here, only if speed is 100000 and autoneg is off, then we keep fec as reed-solomon

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add the peer device check

Copy link
Contributor

Choose a reason for hiding this comment

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

@vdahiya12 prevent configuration of RS FEC if msft_an_lt is enabled?

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
@wangxin wangxin merged commit f3364fa into sonic-net:master Oct 8, 2024
hdwhdw pushed a commit to hdwhdw/sonic-mgmt that referenced this pull request Oct 10, 2024
…aph templates and fanout EOS (sonic-net#13990)

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

1. autoneg_enabled : True
must be enabled in inventory files
2. t0 topo file must have a port list for autoneg
Example:
intfs : [1, 2, 3, 4, 5, 6, 7, 8]
With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
vikshaw-Nokia pushed a commit to vikshaw-Nokia/sonic-mgmt that referenced this pull request Oct 23, 2024
…aph templates and fanout EOS (sonic-net#13990)

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

1. autoneg_enabled : True
must be enabled in inventory files
2. t0 topo file must have a port list for autoneg
Example:
intfs : [1, 2, 3, 4, 5, 6, 7, 8]
With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Oct 25, 2024
…aph templates and fanout EOS (sonic-net#13990)

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

1. autoneg_enabled : True
must be enabled in inventory files
2. t0 topo file must have a port list for autoneg
Example:
intfs : [1, 2, 3, 4, 5, 6, 7, 8]
With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
@mssonicbld
Copy link
Collaborator

@vdahiya12 PR conflicts with 202305 branch

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #15172

@mssonicbld
Copy link
Collaborator

@vdahiya12 PR conflicts with 202311 branch

mssonicbld pushed a commit that referenced this pull request Oct 25, 2024
…aph templates and fanout EOS (#13990)

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

1. autoneg_enabled : True
must be enabled in inventory files
2. t0 topo file must have a port list for autoneg
Example:
intfs : [1, 2, 3, 4, 5, 6, 7, 8]
With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
vdahiya12 added a commit to vdahiya12/sonic-mgmt that referenced this pull request Oct 25, 2024
…aph templates and fanout EOS (sonic-net#13990)

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

1. autoneg_enabled : True
must be enabled in inventory files
2. t0 topo file must have a port list for autoneg
Example:
intfs : [1, 2, 3, 4, 5, 6, 7, 8]
With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
vdahiya12 added a commit to vdahiya12/sonic-mgmt that referenced this pull request Oct 25, 2024
…aph templates and fanout EOS (sonic-net#13990)

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

1. autoneg_enabled : True
must be enabled in inventory files
2. t0 topo file must have a port list for autoneg
Example:
intfs : [1, 2, 3, 4, 5, 6, 7, 8]
With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
vdahiya12 added a commit to vdahiya12/sonic-mgmt that referenced this pull request Oct 26, 2024
…aph templates and fanout EOS (sonic-net#13990)

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

1. autoneg_enabled : True
must be enabled in inventory files
2. t0 topo file must have a port list for autoneg
Example:
intfs : [1, 2, 3, 4, 5, 6, 7, 8]
With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
vdahiya12 added a commit to vdahiya12/sonic-mgmt that referenced this pull request Oct 26, 2024
…aph templates and fanout EOS (sonic-net#13990)

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

1. autoneg_enabled : True
must be enabled in inventory files
2. t0 topo file must have a port list for autoneg
Example:
intfs : [1, 2, 3, 4, 5, 6, 7, 8]
With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
wangxin pushed a commit that referenced this pull request Oct 29, 2024
…aph templates and fanout EOS (#13990) (#15196)

* [ansible][minigraph] add support for adding autonegotiation in minigraph templates and fanout EOS (#13990)

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

1. autoneg_enabled : True
must be enabled in inventory files
2. t0 topo file must have a port list for autoneg
Example:
intfs : [1, 2, 3, 4, 5, 6, 7, 8]
With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>

* [ansible][minigraph] enhance template for adding autonegotiation in Mellanox and add EOS 7260 template changes (#15004)

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>

* [ansible][minigraph] Fix minigraph template for devices which have autoneg enabled but the topo file does not contain autoneg interfaces (#15134)

This pull request updates the Jinja2 template minigraph_link_meta.j2 by modifying the generation of the section.

Key Changes:
* The condition has been changed from simply checking if msft_an_enabled is defined to also checking if vm_topo_config.get('autoneg_interfaces') is not None.
* This ensures that the section is only included if both msft_an_enabled is defined and the autoneg_interfaces attribute in vm_topo_config exists and is not None.

This ensures if some testbeds/devices have msft_an_enabled they do not end up treated as autoneg devices unless the topo file contains the AN interface list

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
wangxin pushed a commit that referenced this pull request Oct 29, 2024
…ph templates and fanout EOS (#13990) (#15197)

* [ansible][minigraph] add support for adding autonegotiation in minigraph templates and fanout EOS (#13990)

These changes add a support for adding auto negotiation to specific testbed based on variables defined in ansible

Two things are required for autoneg support

1. autoneg_enabled : True
must be enabled in inventory files
2. t0 topo file must have a port list for autoneg
Example:
intfs : [1, 2, 3, 4, 5, 6, 7, 8]
With these changes the PR includes changes to pick the port numbering from topo file and apply minigraph parsing changes such that during deploy-mg or gen-mg the required ports have autoneg and deployment is clean with link up

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>

* [ansible][minigraph] enhance template for adding autonegotiation in Mellanox and add EOS 7260 template changes (#15004)

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>

* [ansible][minigraph] Fix minigraph template for devices which have autoneg enabled but the topo file does not contain autoneg interfaces (#15134)

This pull request updates the Jinja2 template minigraph_link_meta.j2 by modifying the generation of the section.

Key Changes:
* The condition has been changed from simply checking if msft_an_enabled is defined to also checking if vm_topo_config.get('autoneg_interfaces') is not None.
* This ensures that the section is only included if both msft_an_enabled is defined and the autoneg_interfaces attribute in vm_topo_config exists and is not None.

This ensures if some testbeds/devices have msft_an_enabled they do not end up treated as autoneg devices unless the topo file contains the AN interface list

Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants