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
5 changes: 3 additions & 2 deletions ansible/library/conn_graph_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,15 @@ def parse_graph(self):
for link in allinks:
start_dev = link.attrib['StartDevice']
end_dev = link.attrib['EndDevice']
autoneg_mode = link.attrib.get('AutoNeg', 'off')
if start_dev:
self.links[start_dev][link.attrib['StartPort']] = {
'peerdevice': link.attrib['EndDevice'], 'peerport': link.attrib['EndPort'],
'speed': link.attrib['BandWidth']}
'speed': link.attrib['BandWidth'], 'autoneg': autoneg_mode}
if end_dev:
self.links[end_dev][link.attrib['EndPort']] = {
'peerdevice': link.attrib['StartDevice'], 'peerport': link.attrib['StartPort'],
'speed': link.attrib['BandWidth']}
'speed': link.attrib['BandWidth'], 'autoneg': autoneg_mode}
console_root = self.root.find(self.csgtag)
if console_root:
devicecsgroot = console_root.find('DevicesConsoleInfo')
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
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" %}
error-correction encoding reed-solomon
{% else %}
no error-correction encoding
Expand Down
5 changes: 5 additions & 0 deletions ansible/roles/fanout/templates/arista_7260cx3_deploy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ vrf definition management
switchport access vlan {{ device_port_vlans[inventory_hostname][intf]['vlanids'] }}
switchport mode dot1q-tunnel
spanning-tree portfast
{% if device_conn[inventory_hostname][intf]['autoneg']|lower == "on" %}
speed auto {{ device_conn[inventory_hostname][intf]['speed'] }}full
no error-correction encoding
{% else %}
speed forced 100gfull
error-correction encoding reed-solomon
{% endif %}
no shutdown
{% elif device_conn[inventory_hostname][intf]['speed'] == "40000" %}
interface {{ intf }}
Expand Down
32 changes: 32 additions & 0 deletions ansible/templates/minigraph_link_meta.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,35 @@
</Link>
</LinkMetadataDeclaration>
{% endif %}

{% if msft_an_enabled is defined and vm_topo_config.get('autoneg_interfaces') is not none %}
<LinkMetadataDeclaration>
<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 device_conn[inventory_hostname][port_alias_map[autoneg_intf]]['autoneg']|lower == "on" %}
<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: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