Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

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 <[email protected]>
@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 <[email protected]>
Signed-off-by: Vaibhav Dahiya <[email protected]>
ansible/templates/minigraph_link_meta.j2 Outdated Show resolved Hide resolved
@@ -134,6 +134,8 @@ topology:
- 31
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 <[email protected]>
@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 <[email protected]>
Signed-off-by: Vaibhav Dahiya <[email protected]>
@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 <[email protected]>
wangxin
wangxin previously approved these changes Sep 10, 2024
Signed-off-by: Vaibhav Dahiya <[email protected]>
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

{% if device_port_vlans[inventory_hostname][intf]['mode'] == 'Trunk' %}
switchport mode trunk
switchport trunk allowed vlan {{ device_port_vlans[inventory_hostname][intf]['vlanids'] }}
{% else %}
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 <[email protected]>
Signed-off-by: Vaibhav Dahiya <[email protected]>
Signed-off-by: Vaibhav Dahiya <[email protected]>
Signed-off-by: Vaibhav Dahiya <[email protected]>
Signed-off-by: Vaibhav Dahiya <[email protected]>
Signed-off-by: Vaibhav Dahiya <[email protected]>
Signed-off-by: Vaibhav Dahiya <[email protected]>
<Link xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
{% for if_index in vm_topo_config['autoneg_interfaces']['intfs'] %}
{% set autoneg_intf = "Ethernet" ~ if_index ~ "/1" %}
{% if device_conn[inventory_hostname][port_alias_map[autoneg_intf]]['autoneg']|lower == "on" %}
Copy link
Contributor

Choose a reason for hiding this comment

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

@vdahiya12 please add a comment this is for peer/link
device AN check

Signed-off-by: Vaibhav Dahiya <[email protected]>
Signed-off-by: Vaibhav Dahiya <[email protected]>
Signed-off-by: Vaibhav Dahiya <[email protected]>
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.

6 participants