summaryrefslogtreecommitdiffstats
path: root/config/installers
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-12-27 18:35:36 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-12-27 19:36:04 +0100
commite3708019f62d303d0c24cd6af5d4a3924bd1a797 (patch)
tree4a052712a8ff5c76e319c9fb2a7e1352d3e51dc5 /config/installers
parent8f43c9af3ca49498659fb3caa08162504b50ab07 (diff)
[PDF] Fix link speed for virtual PODs
ethtool reports the link speed as 'unknown' for said devices. The only (current) consumer of this information is Fuel's new VPP support, which detects all these interfaces as 'Gigabit', so align our definitions in order to be able to dynamically construct the VPP interface names based on PDF (link speed) + IDF (PCI bus). While at it, add a new j2 macro helper to be used by Fuel installer. Change-Id: Id6a52bbb7b86bbe3db2a81bb91ac378c6876ffc0 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'config/installers')
-rw-r--r--config/installers/fuel/net_macros.j28
1 files changed, 8 insertions, 0 deletions
diff --git a/config/installers/fuel/net_macros.j2 b/config/installers/fuel/net_macros.j2
index 7ff3166c..a7cf3e57 100644
--- a/config/installers/fuel/net_macros.j2
+++ b/config/installers/fuel/net_macros.j2
@@ -35,3 +35,11 @@
{%- macro interface_str(nic, vlan = 0) -%}
{{ nic }}{% if vlan | int > 0 %}.{{ vlan }}{% endif %}
{%- endmacro -%}
+
+{%- macro vpp_interface_str(speed, pci_addr) -%}
+ {%- set p = pci_addr.replace('.', ':').split(':') -%}
+ {%- set s = 'GigabitEthernet%d/%d/%d' | format(p[-3] | int(0, 16),
+ p[-2] | int(0, 16),
+ p[-1] | int(0, 16)) -%}
+ {% if '40g' in speed %}Forty{% elif '10g' in speed %}Ten{% endif %}{{ s }}
+{%- endmacro -%}