-
Notifications
You must be signed in to change notification settings - Fork 1k
Enhance minigraph link template for autonegotiation and remove requirement to add autoneg interfaces in topo file #16956
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
405a181
Remove msft_an_enabled check for generating minigraph link template
vdahiya12 af5c82c
add suggestions
vdahiya12 ffd1339
fix build
vdahiya12 82d789a
add changes
vdahiya12 57c7b36
fix all
vdahiya12 0c9e4e2
add more changes
vdahiya12 661a717
fix
vdahiya12 83d5522
add
vdahiya12 b50f53f
add h
vdahiya12 245d999
add cg
vdahiya12 c07ee90
remove break
vdahiya12 84ccd61
fix
vdahiya12 94b0fa9
fix kvm
vdahiya12 a3ec466
fix
vdahiya12 ec38a62
change var name
vdahiya12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,25 @@ | ||
| {% if 'dualtor' in topo %} | ||
| {% set link_metadata_defined = False %} | ||
|
|
||
| {% if 'dualtor' in topo or | ||
| (macsec_card is defined and macsec_card == True and 't2' in topo) %} | ||
| {% set link_metadata_defined = True %} | ||
| {% endif %} | ||
|
|
||
| {% if device_conn is defined and inventory_hostname in device_conn %} | ||
| {% for iface in device_conn[inventory_hostname] %} | ||
| {% if 'autoneg' in device_conn[inventory_hostname][iface] and | ||
| 'on' in device_conn[inventory_hostname][iface]['autoneg'] %} | ||
| {% set link_metadata_defined = True %} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% endif %} | ||
|
|
||
| {% if link_metadata_defined %} | ||
| <LinkMetadataDeclaration> | ||
| <Link xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"> | ||
| {% endif %} | ||
|
|
||
| {% if 'dualtor' in topo %} | ||
| {% for tunnel in tunnel_configs %} | ||
| <a:LinkMetadata> | ||
| <a:Name i:nil="true" /> | ||
|
|
@@ -24,13 +43,9 @@ | |
| <a:Key>{{ dual_tor_facts['positions']['lower'] }}:{{ tunnel }};{{ dual_tor_facts['positions']['upper'] }}:{{ tunnel }}</a:Key> | ||
| </a:LinkMetadata> | ||
| {% endfor %} | ||
| </Link> | ||
| </LinkMetadataDeclaration> | ||
| {% endif %} | ||
|
|
||
| {% if macsec_card is defined and macsec_card == True and 't2' in topo %} | ||
| <LinkMetadataDeclaration> | ||
| <Link xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"> | ||
| {% for index in range(vms_number) %} | ||
| {% set vm_intfs=vm_topo_config['vm'][vms[index]]['intfs'][dut_index|int]|sort %} | ||
| {% set dut_intfs=vm_topo_config['vm'][vms[index]]['interface_indexes'][dut_index|int]|sort %} | ||
|
|
@@ -49,38 +64,35 @@ | |
| {% endif %} | ||
| {% endfor %} | ||
| {% endfor %} | ||
| </Link> | ||
| </LinkMetadataDeclaration> | ||
| {% endif %} | ||
|
|
||
| {% if msft_an_enabled is defined and vm_topo_config.get('autoneg_interfaces') is not none %} | ||
| <LinkMetadataDeclaration> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part is probably needed |
||
| <Link xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"> | ||
| {% for if_index in vm_topo_config['autoneg_interfaces']['intfs'] %} | ||
|
|
||
| {% if "mellanox" in device_info[inventory_hostname]['HwSku']|lower %} | ||
| {% set autoneg_intf = "etp" ~ if_index %} | ||
| {% else %} | ||
| {% set autoneg_intf = "Ethernet" ~ if_index ~ "/1" %} | ||
| {% endif %} | ||
| {% if port_alias_map[autoneg_intf] in device_conn[inventory_hostname] and device_conn[inventory_hostname][port_alias_map[autoneg_intf]]['autoneg']|lower == "on" %} | ||
| {% if device_conn is defined and inventory_hostname in device_conn %} | ||
| {% for iface_name in device_conn[inventory_hostname].keys() %} | ||
| {% if iface_name in device_conn[inventory_hostname] and 'autoneg' in device_conn[inventory_hostname][iface_name] %} | ||
| {% if 'on' in device_conn[inventory_hostname][iface_name]['autoneg'] %} | ||
| <a:LinkMetadata> | ||
| <a:Name i:nil="true"/> | ||
| <a:Properties> | ||
| <a:DeviceProperty> | ||
| <a:Name>AutoNegotiation</a:Name> | ||
| <a:Value>True</a:Value> | ||
| </a:DeviceProperty> | ||
| <a:DeviceProperty> | ||
| <a:Name>FECDisabled</a:Name> | ||
| <a:Reference i:nil="true"/> | ||
| <a:Value>True</a:Value> | ||
| </a:DeviceProperty> | ||
| <a:DeviceProperty> | ||
| <a:Name>AutoNegotiation</a:Name> | ||
| <a:Value>True</a:Value> | ||
| </a:DeviceProperty> | ||
| {% if msft_an_enabled is defined %} | ||
| <a:DeviceProperty> | ||
| <a:Name>FECDisabled</a:Name> | ||
| <a:Reference i:nil="true"/> | ||
| <a:Value>True</a:Value> | ||
| </a:DeviceProperty> | ||
| {% endif %} | ||
| </a:Properties> | ||
| <a:Key>{{ device_conn[inventory_hostname][port_alias_map[autoneg_intf]]['peerdevice'] }}:{{ device_conn[inventory_hostname][port_alias_map[autoneg_intf]]['peerport'] }};{{ inventory_hostname }}:{{ autoneg_intf }}</a:Key> | ||
| </a:LinkMetadata> | ||
| {% endif %} | ||
| <a:Key>{{ device_conn[inventory_hostname][iface_name]['peerdevice'] }}:{{ device_conn[inventory_hostname][iface_name]['peerport'] }};{{ inventory_hostname }}:{{ port_name_map[iface_name] }}</a:Key> | ||
| </a:LinkMetadata> | ||
| {% endif %} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% endif %} | ||
|
|
||
| {% if link_metadata_defined %} | ||
| </Link> | ||
| </LinkMetadataDeclaration> | ||
| {% endif %} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.