From ec1b0d7f2115d6f2909cd5d067090dfe453cfac5 Mon Sep 17 00:00:00 2001 From: Austin Pham Date: Tue, 4 Mar 2025 00:02:58 +1100 Subject: [PATCH 1/2] chore: disable fec on minigraph for ixia Signed-off-by: Austin Pham --- ansible/library/conn_graph_facts.py | 3 +++ ansible/templates/minigraph_link_meta.j2 | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ansible/library/conn_graph_facts.py b/ansible/library/conn_graph_facts.py index 159d956fc7c..66608306505 100755 --- a/ansible/library/conn_graph_facts.py +++ b/ansible/library/conn_graph_facts.py @@ -300,6 +300,7 @@ def csv_to_graph_facts(self): vlan_ID = link["VlanID"] vlan_mode = link["VlanMode"] autoneg_mode = link.get("AutoNeg") + force_fec = link.get("ForceFEC", False) if start_device not in links: links[start_device] = {} @@ -314,11 +315,13 @@ def csv_to_graph_facts(self): "peerdevice": end_device, "peerport": end_port, "speed": band_width, + "force_fec": force_fec } links[end_device][end_port] = { "peerdevice": start_device, "peerport": start_port, "speed": band_width, + "force_fec": force_fec } if autoneg_mode: diff --git a/ansible/templates/minigraph_link_meta.j2 b/ansible/templates/minigraph_link_meta.j2 index 47526c3706a..78744673097 100644 --- a/ansible/templates/minigraph_link_meta.j2 +++ b/ansible/templates/minigraph_link_meta.j2 @@ -1,7 +1,6 @@ {%- set ns = namespace(link_metadata_defined=False) -%} -{%- if 'dualtor' in topo or - (macsec_card is defined and enable_macsec is defined and macsec_card == True and 't2' in topo) -%} +{%- if 'dualtor' in topo or (macsec_card is defined and enable_macsec is defined and macsec_card == True and 't2' in topo) or ("ixia" in topo) -%} {% set ns.link_metadata_defined = True %} {%- endif -%} @@ -82,6 +81,19 @@ {% endif %} {% endif %} +{% if device_conn[inventory_hostname][iface_name]["force_fec"] %} + + + + + FECDisabled + + True + + + {{ device_conn[inventory_hostname][iface_name]["peerdevice"] }}:{{ device_conn[inventory_hostname][iface_name]["peerport"]}};{{ inventory_hostname }}:{{ port_name_map[iface_name] }} + +{% endif %} {% endfor %} {% endif %} {% if ns.link_metadata_defined %} From 1b98c9b28b227e420aae7468b7e191e03ddfa5f6 Mon Sep 17 00:00:00 2001 From: Austin Pham Date: Fri, 21 Mar 2025 20:51:32 +1100 Subject: [PATCH 2/2] chore: change variable naming Signed-off-by: Austin Pham --- ansible/library/conn_graph_facts.py | 6 +++--- ansible/templates/minigraph_link_meta.j2 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/library/conn_graph_facts.py b/ansible/library/conn_graph_facts.py index 66608306505..40c65b5f71f 100755 --- a/ansible/library/conn_graph_facts.py +++ b/ansible/library/conn_graph_facts.py @@ -300,7 +300,7 @@ def csv_to_graph_facts(self): vlan_ID = link["VlanID"] vlan_mode = link["VlanMode"] autoneg_mode = link.get("AutoNeg") - force_fec = link.get("ForceFEC", False) + fec_disable = link.get("FECDisable", False) if start_device not in links: links[start_device] = {} @@ -315,13 +315,13 @@ def csv_to_graph_facts(self): "peerdevice": end_device, "peerport": end_port, "speed": band_width, - "force_fec": force_fec + "fec_disable": fec_disable } links[end_device][end_port] = { "peerdevice": start_device, "peerport": start_port, "speed": band_width, - "force_fec": force_fec + "fec_disable": fec_disable } if autoneg_mode: diff --git a/ansible/templates/minigraph_link_meta.j2 b/ansible/templates/minigraph_link_meta.j2 index 78744673097..d7895e47a6a 100644 --- a/ansible/templates/minigraph_link_meta.j2 +++ b/ansible/templates/minigraph_link_meta.j2 @@ -81,7 +81,7 @@ {% endif %} {% endif %} -{% if device_conn[inventory_hostname][iface_name]["force_fec"] %} +{% if device_conn[inventory_hostname][iface_name]["fec_disable"] %}