[PDF] Fix link speed for virtual PODs 97/66097/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 27 Dec 2018 17:35:36 +0000 (18:35 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 27 Dec 2018 18:36:04 +0000 (19:36 +0100)
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>
config/installers/fuel/net_macros.j2
labs/arm/virtual2.yaml
labs/ericsson/virtual-pod1bl01.yaml
labs/ericsson/virtual1.yaml
labs/ericsson/virtual2.yaml
labs/ericsson/virtual3.yaml
labs/ericsson/virtual4.yaml
labs/ericsson/virtual5.yaml

index 7ff3166..a7cf3e5 100644 (file)
 {%- 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 -%}
index 3c2b3b1..fda336c 100644 (file)
@@ -92,22 +92,22 @@ nodes:
       address: 'qemu:///system'
     interfaces: &interfaces
       - name: 'nic1'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"  # MACs will be assigned by libvirt
         vlan: native
       - name: 'nic2'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic3'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic4'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
index 9edebee..996a330 100644 (file)
@@ -115,22 +115,22 @@ nodes:
       address: 'qemu:///system'
     interfaces: &interfaces
       - name: 'nic1'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"  # MACs will be assigned by libvirt
         vlan: native
       - name: 'nic2'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic3'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic4'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
index c19d9c7..c7519bf 100644 (file)
@@ -115,22 +115,22 @@ nodes:
       address: 'qemu:///system'
     interfaces: &interfaces
       - name: 'nic1'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"  # MACs will be assigned by libvirt
         vlan: native
       - name: 'nic2'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic3'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic4'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
index 7298b78..ca3f42e 100644 (file)
@@ -115,22 +115,22 @@ nodes:
       address: 'qemu:///system'
     interfaces: &interfaces
       - name: 'nic1'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"  # MACs will be assigned by libvirt
         vlan: native
       - name: 'nic2'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic3'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic4'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
index 33f2e09..5c4f6ba 100644 (file)
@@ -115,22 +115,22 @@ nodes:
       address: 'qemu:///system'
     interfaces: &interfaces
       - name: 'nic1'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"  # MACs will be assigned by libvirt
         vlan: native
       - name: 'nic2'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic3'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic4'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
index cbf50f0..de6c5ee 100644 (file)
@@ -115,22 +115,22 @@ nodes:
       address: 'qemu:///system'
     interfaces: &interfaces
       - name: 'nic1'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"  # MACs will be assigned by libvirt
         vlan: native
       - name: 'nic2'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic3'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic4'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
index 4826044..0a9e602 100644 (file)
@@ -107,22 +107,22 @@ nodes:
       address: 'qemu:///system'
     interfaces: &interfaces
       - name: 'nic1'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"  # MACs will be assigned by libvirt
         vlan: native
       - name: 'nic2'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic3'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native
       - name: 'nic4'
-        speed: 10gb
+        speed: 1gb
         features: 'dpdk|sriov'
         mac_address: "00:00:00:00:00:00"
         vlan: native