Skip to content

Commit 758a831

Browse files
authored
[LT2] [FT2] Topology and Port Updates (sonic-net#19131) (sonic-net#474)
Cherry: sonic-net#19131
2 parents d919392 + c365f0e commit 758a831

5 files changed

Lines changed: 203 additions & 3 deletions

File tree

ansible/generate_topo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def __contains__(self, key):
118118
"panel_port_step": 1},
119119
'p32o64lt2': {"ds_breakout": 2, "us_breakout": 2, "ds_link_step": 1, "us_link_step": 1,
120120
'uplink_ports': PortList(45, 49, 46, 50),
121-
'skip_ports': PortList(11, 12, 13, 14, 27, 28, 29, 30, 61, 62, 63),
121+
'skip_ports': PortList(11, 12, 13, 14, 27, 28, 29, 30),
122122
"fabric_breakout": 1,
123123
'fabric_ports': PortList(
124124
*[p for p in range(0, 32)]

ansible/library/generate_golden_config_db.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,44 @@ def safe_open_template(template_path):
290290

291291
return rendered_json
292292

293+
def update_dns_config(self, config):
294+
# Generate dns_server related configuration
295+
rc, out, err = self.module.run_command("cat {}".format(DNS_CONFIG_PATH))
296+
if rc != 0:
297+
self.module.fail_json(msg="Failed to get dns config: {}".format(err))
298+
try:
299+
dns_config_obj = json.loads(out)
300+
except json.JSONDecodeError:
301+
self.module.fail_json(msg="Invalid JSON in DNS config: {}".format(out))
302+
if "DNS_NAMESERVER" in dns_config_obj:
303+
ori_config_db = json.loads(config)
304+
if multi_asic.is_multi_asic():
305+
for key, value in ori_config_db.items():
306+
value.update(dns_config_obj)
307+
else:
308+
ori_config_db.update(dns_config_obj)
309+
return json.dumps(ori_config_db, indent=4)
310+
else:
311+
return config
312+
313+
def generate_lt2_ft2_golden_config_db(self):
314+
"""
315+
Generate golden_config for FT2 to enable FEC.
316+
**Only PORT table is updated**.
317+
"""
318+
SUPPORTED_TOPO = ["ft2-64", "lt2-p32o64", "lt2-o128"]
319+
if self.topo_name not in SUPPORTED_TOPO:
320+
return "{}"
321+
SUPPORTED_PORT_SPEED = ["200000", "400000", "800000"]
322+
ori_config = json.loads(self.get_config_from_minigraph())
323+
port_config = ori_config.get("PORT", {})
324+
for name, config in port_config.items():
325+
# Enable FEC for ports with supported speed
326+
if config["speed"] in SUPPORTED_PORT_SPEED and "fec" not in config:
327+
config["fec"] = "rs"
328+
329+
return json.dumps({"PORT": port_config}, indent=4)
330+
293331
def generate(self):
294332
module_msg = "Success to generate golden_config_db.json"
295333
# topo check

ansible/roles/fanout/tasks/fanout_sonic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@
7676
include_tasks:
7777
sonic/fanout_sonic_202405.yml
7878
when: dry_run is not defined and incremental is not defined
79-
when: "'2024' in fanout_sonic_version['build_version']"
79+
when: "'2024' in fanout_sonic_version['build_version'] or '2025' in fanout_sonic_version['build_version']"

ansible/roles/fanout/templates/sonic_deploy_202405.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{% if fanout_hwsku == "Arista-720DT-G48S4" and (fanout_port_config[port_name]['lanes'] | int) <= 24 %}
2020
"autoneg": "on",
2121
{% endif %}
22-
{% if fanout_port_config[port_name]['speed'] | default('100000') == "100000" %}
22+
{% if fanout_port_config[port_name]['speed'] | default('100000') in ["100000", "400000", "800000"] %}
2323
"fec" : "rs",
2424
{% endif %}
2525
{% if 'broadcom' in fanout_sonic_version["asic_type"] or 'marvell' in fanout_sonic_version["asic_type"] or 'mellanox' in fanout_sonic_version["asic_type"] %}

ansible/vars/topo_lt2-p32o64.yml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,30 @@ topology:
328328
vlans:
329329
- 89
330330
vm_offset: 81
331+
ARISTA51T1:
332+
vlans:
333+
- 90
334+
vm_offset: 82
335+
ARISTA52T1:
336+
vlans:
337+
- 91
338+
vm_offset: 83
339+
ARISTA53T1:
340+
vlans:
341+
- 92
342+
vm_offset: 84
343+
ARISTA54T1:
344+
vlans:
345+
- 93
346+
vm_offset: 85
347+
ARISTA55T1:
348+
vlans:
349+
- 94
350+
vm_offset: 86
351+
ARISTA56T1:
352+
vlans:
353+
- 95
354+
vm_offset: 87
331355

332356
configuration_properties:
333357
common:
@@ -2136,3 +2160,141 @@ configuration:
21362160
bp_interface:
21372161
ipv4: 10.10.246.91/24
21382162
ipv6: fc0a::5b/64
2163+
ARISTA51T1:
2164+
properties:
2165+
- common
2166+
- leaf
2167+
tornum: 51
2168+
bgp:
2169+
asn: 4200000000
2170+
peers:
2171+
4200100000:
2172+
- 10.0.0.180
2173+
- fc00::169
2174+
interfaces:
2175+
Loopback0:
2176+
ipv4: 100.1.0.91/32
2177+
ipv6: 2064:100:0:5b::/128
2178+
Ethernet1:
2179+
lacp: 1
2180+
Port-Channel1:
2181+
ipv4: 10.0.0.181/31
2182+
ipv6: fc00::16a/126
2183+
bp_interface:
2184+
ipv4: 10.10.246.92/24
2185+
ipv6: fc0a::5c/64
2186+
ARISTA52T1:
2187+
properties:
2188+
- common
2189+
- leaf
2190+
tornum: 52
2191+
bgp:
2192+
asn: 4200000000
2193+
peers:
2194+
4200100000:
2195+
- 10.0.0.182
2196+
- fc00::16d
2197+
interfaces:
2198+
Loopback0:
2199+
ipv4: 100.1.0.92/32
2200+
ipv6: 2064:100:0:5c::/128
2201+
Ethernet1:
2202+
lacp: 1
2203+
Port-Channel1:
2204+
ipv4: 10.0.0.183/31
2205+
ipv6: fc00::16e/126
2206+
bp_interface:
2207+
ipv4: 10.10.246.93/24
2208+
ipv6: fc0a::5d/64
2209+
ARISTA53T1:
2210+
properties:
2211+
- common
2212+
- leaf
2213+
tornum: 53
2214+
bgp:
2215+
asn: 4200000000
2216+
peers:
2217+
4200100000:
2218+
- 10.0.0.184
2219+
- fc00::171
2220+
interfaces:
2221+
Loopback0:
2222+
ipv4: 100.1.0.93/32
2223+
ipv6: 2064:100:0:5d::/128
2224+
Ethernet1:
2225+
lacp: 1
2226+
Port-Channel1:
2227+
ipv4: 10.0.0.185/31
2228+
ipv6: fc00::172/126
2229+
bp_interface:
2230+
ipv4: 10.10.246.94/24
2231+
ipv6: fc0a::5e/64
2232+
ARISTA54T1:
2233+
properties:
2234+
- common
2235+
- leaf
2236+
tornum: 54
2237+
bgp:
2238+
asn: 4200000000
2239+
peers:
2240+
4200100000:
2241+
- 10.0.0.186
2242+
- fc00::175
2243+
interfaces:
2244+
Loopback0:
2245+
ipv4: 100.1.0.94/32
2246+
ipv6: 2064:100:0:5e::/128
2247+
Ethernet1:
2248+
lacp: 1
2249+
Port-Channel1:
2250+
ipv4: 10.0.0.187/31
2251+
ipv6: fc00::176/126
2252+
bp_interface:
2253+
ipv4: 10.10.246.95/24
2254+
ipv6: fc0a::5f/64
2255+
ARISTA55T1:
2256+
properties:
2257+
- common
2258+
- leaf
2259+
tornum: 55
2260+
bgp:
2261+
asn: 4200000000
2262+
peers:
2263+
4200100000:
2264+
- 10.0.0.188
2265+
- fc00::179
2266+
interfaces:
2267+
Loopback0:
2268+
ipv4: 100.1.0.95/32
2269+
ipv6: 2064:100:0:5f::/128
2270+
Ethernet1:
2271+
lacp: 1
2272+
Port-Channel1:
2273+
ipv4: 10.0.0.189/31
2274+
ipv6: fc00::17a/126
2275+
bp_interface:
2276+
ipv4: 10.10.246.96/24
2277+
ipv6: fc0a::60/64
2278+
ARISTA56T1:
2279+
properties:
2280+
- common
2281+
- leaf
2282+
tornum: 56
2283+
bgp:
2284+
asn: 4200000000
2285+
peers:
2286+
4200100000:
2287+
- 10.0.0.190
2288+
- fc00::17d
2289+
interfaces:
2290+
Loopback0:
2291+
ipv4: 100.1.0.96/32
2292+
ipv6: 2064:100:0:60::/128
2293+
Ethernet1:
2294+
lacp: 1
2295+
Port-Channel1:
2296+
ipv4: 10.0.0.191/31
2297+
ipv6: fc00::17e/126
2298+
bp_interface:
2299+
ipv4: 10.10.246.97/24
2300+
ipv6: fc0a::61/64

0 commit comments

Comments
 (0)