Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ansible/TestbedProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def makeTestbed(data, outfile):


def makeSonicLabLinks(data, outfile):
csv_columns = "StartDevice,StartPort,EndDevice,EndPort,BandWidth,VlanID,VlanMode,SlotId"
csv_columns = "StartDevice,StartPort,EndDevice,EndPort,BandWidth,VlanID,VlanMode,AutoNeg,SlotId"
topology = data
csv_file = outfile

Expand All @@ -331,6 +331,7 @@ def makeSonicLabLinks(data, outfile):
bandWidth = element.get("Bandwidth")
vlanID = element.get("VlanID")
vlanMode = element.get("VlanMode")
AutoNeg = element.get("AutoNeg")
slotId = element.get("SlotId")

# catch empty values
Expand All @@ -346,10 +347,13 @@ def makeSonicLabLinks(data, outfile):
vlanMode = ""
if not slotId:
slotId = ""
if not AutoNeg:
AutoNeg = ""

row = startDevice + "," + startPort + "," + endDevice + "," + \
endPort + "," + str(bandWidth) + \
"," + str(vlanID) + "," + vlanMode + \
"," + str(AutoNeg) + \
"," + str(slotId)
f.write(row + "\n")
except IOError:
Expand Down
3 changes: 3 additions & 0 deletions ansible/library/conn_graph_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def csv_to_graph_facts(self):
band_width = link["BandWidth"]
vlan_ID = link["VlanID"]
vlan_mode = link["VlanMode"]
autoneg_mode = link.get("AutoNeg", "off")

if start_device not in links:
links[start_device] = {}
Expand All @@ -313,11 +314,13 @@ def csv_to_graph_facts(self):
"peerdevice": end_device,
"peerport": end_port,
"speed": band_width,
"autoneg": autoneg_mode,
}
links[end_device][end_port] = {
"peerdevice": start_device,
"peerport": start_port,
"speed": band_width,
"autoneg": autoneg_mode,
}

port_vlans[start_device][start_port] = {
Expand Down
2 changes: 2 additions & 0 deletions ansible/library/topo_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ def get_topo_config(self, topo_name, hwsku, testbed_name, asics_present, card_ty

if 'DUT' in topo_definition['topology']:
vm_topo_config['DUT'] = topo_definition['topology']['DUT']
if 'autoneg_interfaces' in vm_topo_config['DUT']:
vm_topo_config['autoneg_interfaces'] = topo_definition['topology']['DUT']['autoneg_interfaces']
else:
vm_topo_config['DUT'] = {}

Expand Down
8 changes: 7 additions & 1 deletion ansible/roles/fanout/templates/arista_7060_deploy.j2
Copy link
Copy Markdown
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
Copy Markdown
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

Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,20 @@ interface defaults
{% for intf in device_port_vlans[inventory_hostname] %}
interface {{ intf }}
description {{ device_conn[inventory_hostname][intf]['peerdevice'] }}-{{ device_conn[inventory_hostname][intf]['peerport'] }}
# TODO: Add an additional var/check in fanout devices if autoneg is enabled with the below check
{% if device_conn[inventory_hostname][intf]['autoneg']|lower == "on" %}
speed auto {{ device_conn[inventory_hostname][intf]['speed'] }}full
{% else %}
speed force {{ device_conn[inventory_hostname][intf]['speed'] }}full
{% endif %}
{% 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" %}
# TODO: Add an additional var/check in fanout devices if autoneg is enabled with the below check
{% if device_conn[inventory_hostname][intf]['speed'] == "100000" and device_conn[inventory_hostname][intf]['autoneg']|lower == "off" %}
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

error-correction encoding reed-solomon
{% else %}
no error-correction encoding
Expand Down
27 changes: 27 additions & 0 deletions ansible/templates/minigraph_link_meta.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,30 @@
</Link>
</LinkMetadataDeclaration>
{% endif %}

{% if msft_an_enabled is defined %}
<LinkMetadataDeclaration>
<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
Copy Markdown
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

<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>
Comment on lines +70 to +72
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

</a:DeviceProperty>
</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 %}
{% endfor %}
</Link>
</LinkMetadataDeclaration>
{% endif %}
7 changes: 7 additions & 0 deletions ansible/templates/minigraph_meta.j2
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@
<a:Value>{{ switch_type }}</a:Value>
</a:DeviceProperty>
{% endif %}
{% if msft_an_enabled is defined %}
<a:DeviceProperty>
<a:Name>AutoNegotiation</a:Name>
<a:Reference i:nil="true"/>
<a:Value>{{ msft_an_enabled }}</a:Value>
</a:DeviceProperty>
{% endif %}
{% if num_asics == 1 and switch_type is defined and switch_type == 'voq' %}
<a:DeviceProperty>
<a:Name>SwitchId</a:Name>
Expand Down
2 changes: 2 additions & 0 deletions ansible/vars/topo_t0-116.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ topology:
- 31
vm_offset: 3
DUT:
autoneg_interfaces:
intfs: [13, 14, 15, 16]
vlan_configs:
default_vlan_config: one_vlan_a
one_vlan_a:
Expand Down
2 changes: 2 additions & 0 deletions ansible/vars/topo_t0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ topology:
- 31
vm_offset: 3
DUT:
autoneg_interfaces:
intfs: [7, 8, 9, 10]
vlan_configs:
default_vlan_config: one_vlan_a
one_vlan_a:
Expand Down