FIX: NF_density MAC addresses 18/26618/6
authorPeter Mikus <pmikus@cisco.com>
Tue, 21 Apr 2020 15:25:49 +0000 (15:25 +0000)
committerPeter Mikus <pmikus@cisco.com>
Wed, 22 Apr 2020 09:25:14 +0000 (09:25 +0000)
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I0e773060c344fda7b06937a81a53863a96a4373a

resources/libraries/python/ContainerUtils.py
resources/libraries/python/QemuManager.py
resources/libraries/robot/shared/container.robot
resources/libraries/robot/shared/vm.robot
resources/templates/container/memif_create_chain_ip4.exec
resources/templates/container/memif_create_pipeline_ip4.exec
resources/templates/vm/vpp_chain_ip4.exec

index 111861a..77e139f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -297,10 +297,10 @@ class ContainerManager:
         """
         self.engine.create_vpp_startup_config()
 
-        vif1_mac = kwargs[u"tg_if1_mac"] \
+        vif1_mac = kwargs[u"tg_pf1_mac"] \
             if (kwargs[u"mid1"] - 1) % kwargs[u"nodes"] + 1 == 1 \
             else f"52:54:00:00:{(kwargs[u'mid1'] - 1):02X}:02"
-        vif2_mac = kwargs[u"tg_if2_mac"] \
+        vif2_mac = kwargs[u"tg_pf2_mac"] \
             if (kwargs[u"mid2"] - 1) % kwargs[u"nodes"] + 1 == kwargs[u"nodes"]\
             else f"52:54:00:00:{(kwargs['mid2'] + 1):02X}:01"
         self.engine.create_vpp_exec_config(
@@ -332,11 +332,11 @@ class ContainerManager:
                 self.engine.container.node, kwargs[u"dut1_if2"])
             if_black_name = Topology.get_interface_name(
                 self.engine.container.node, kwargs[u"dut1_if1"])
-            tg_if_ip4 = kwargs[u"tg_if2_ip4"]
-            tg_if_mac = kwargs[u"tg_if2_mac"]
+            tg_pf_ip4 = kwargs[u"tg_pf2_ip4"]
+            tg_pf_mac = kwargs[u"tg_pf2_mac"]
         else:
-            tg_if_ip4 = kwargs[u"tg_if1_ip4"]
-            tg_if_mac = kwargs[u"tg_if1_mac"]
+            tg_pf_ip4 = kwargs[u"tg_pf1_ip4"]
+            tg_pf_mac = kwargs[u"tg_pf1_mac"]
             if1_pci = Topology.get_interface_pci_addr(
                 self.engine.container.node, kwargs[u"dut2_if1"])
             if2_pci = Topology.get_interface_pci_addr(
@@ -368,7 +368,7 @@ class ContainerManager:
                 f"create interface memif id {i} socket-id 2 master\n"
                 f"set interface state memif2/{i} up\n"
                 f"set interface l2 bridge memif2/{i} 2\n"
-                f"set ip neighbor memif2/{i} {tg_if_ip4} {tg_if_mac} "
+                f"set ip neighbor memif2/{i} {tg_pf_ip4} {tg_pf_mac} "
                 f"static\n\n"
             )
 
@@ -401,8 +401,8 @@ class ContainerManager:
             tnl_local_ip = f"{local_ip_base}.{nf_instance + 100}"
             tnl_remote_ip = f"{local_ip_base}.{nf_instance}"
             remote_ip_base = kwargs[u"dut1_if1_ip4"].rsplit(u".", 1)[0]
-            tg_if_ip4 = kwargs[u"tg_if1_ip4"]
-            tg_if_mac = kwargs[u"tg_if1_mac"]
+            tg_pf_ip4 = kwargs[u"tg_pf1_ip4"]
+            tg_pf_mac = kwargs[u"tg_pf1_mac"]
             raddr_ip4 = kwargs[u"laddr_ip4"]
             l_mac1 = 17
             l_mac2 = 18
@@ -411,8 +411,8 @@ class ContainerManager:
             tnl_local_ip = f"{local_ip_base}.{nf_instance}"
             tnl_remote_ip = f"{local_ip_base}.{nf_instance + 100}"
             remote_ip_base = kwargs[u"dut2_if2_ip4"].rsplit(u".", 1)[0]
-            tg_if_ip4 = kwargs[u"tg_if2_ip4"]
-            tg_if_mac = kwargs[u"tg_if2_mac"]
+            tg_pf_ip4 = kwargs[u"tg_pf2_ip4"]
+            tg_pf_mac = kwargs[u"tg_pf2_mac"]
             raddr_ip4 = kwargs[u"raddr_ip4"]
             l_mac1 = 1
             l_mac2 = 2
@@ -428,8 +428,8 @@ class ContainerManager:
             sid2=u"2",
             mac1=f"02:02:00:00:{l_mac1:02X}:{(nf_instance - 1):02X}",
             mac2=f"02:02:00:00:{l_mac2:02X}:{(nf_instance - 1):02X}",
-            tg_if2_ip4=tg_if_ip4,
-            tg_if2_mac=tg_if_mac,
+            tg_pf2_ip4=tg_pf_ip4,
+            tg_pf2_mac=tg_pf_mac,
             raddr_ip4=raddr_ip4,
             tnl_local_ip=tnl_local_ip,
             tnl_remote_ip=tnl_remote_ip,
@@ -455,10 +455,10 @@ class ContainerManager:
         role2 = u"master" if node == kwargs[u"nodes"] else u"slave"
         kwargs[u"mid2"] = kwargs[u"mid2"] \
             if node == kwargs[u"nodes"] else kwargs[u"mid2"] + 1
-        vif1_mac = kwargs[u"tg_if1_mac"] \
+        vif1_mac = kwargs[u"tg_pf1_mac"] \
             if (kwargs[u"mid1"] - 1) % kwargs[u"nodes"] + 1 == 1 \
             else f"52:54:00:00:{(kwargs[u'mid1'] - 1):02X}:02"
-        vif2_mac = kwargs[u"tg_if2_mac"] \
+        vif2_mac = kwargs[u"tg_pf2_mac"] \
             if (kwargs[u"mid2"] - 1) % kwargs[u"nodes"] + 1 == kwargs[u"nodes"]\
             else f"52:54:00:00:{(kwargs[u'mid2'] + 1):02X}:01"
         socket1 = f"{kwargs[u'guest_dir']}/memif-{self.engine.container.name}-"\
index a9b1b64..ce55be0 100644 (file)
@@ -68,13 +68,13 @@ class QemuManager:
                 vif1_mac = Topology.get_interface_mac(
                     self.nodes[node], f"vhost{idx1}"
                 ) if kwargs[u"vnf"] == u"testpmd_mac" \
-                    else kwargs[u"tg_if1_mac"] if nf_node == 1 \
+                    else kwargs[u"tg_pf1_mac"] if nf_node == 1 \
                     else f"52:54:00:00:{(qemu_id - 1):02x}:02"
                 idx2 = (nf_chain - 1) * nf_nodes * 2 + nf_node * 2
                 vif2_mac = Topology.get_interface_mac(
                     self.nodes[node], f"vhost{idx2}"
                 ) if kwargs[u"vnf"] == u"testpmd_mac" \
-                    else kwargs[u"tg_if2_mac"] if nf_node == nf_nodes \
+                    else kwargs[u"tg_pf2_mac"] if nf_node == nf_nodes \
                     else f"52:54:00:00:{(qemu_id + 1):02x}:01"
 
                 self.machines_affinity[name] = CpuUtils.get_affinity_nf(
index b2b3d01..9cd54e8 100644 (file)
 | | Run Keyword If | '${container_chain_topology}' == 'chain_ip4'
 | | ... | ${group}.Configure VPP In All Containers
 | | ... | ${container_chain_topology}
-| | ... | tg_if1_mac=${TG_pf1_mac}
-| | ... | tg_if2_mac=${TG_pf2_mac}
+| | ... | tg_pf1_mac=${TG_pf1_mac}
+| | ... | tg_pf2_mac=${TG_pf2_mac}
 | | ... | nodes=${nf_nodes}
 | | ... | ELSE IF | '${container_chain_topology}' == 'chain_ipsec'
 | | ... | ${group}.Configure VPP In All Containers
 | | ... | ${container_chain_topology}
-| | ... | tg_if1_ip4=${tg_if1_ip4}
-| | ... | tg_if1_mac=${TG_pf1_mac}[0]
-| | ... | tg_if2_ip4=${tg_if2_ip4}
-| | ... | tg_if2_mac=${TG_pf2_mac}[0]
+| | ... | tg_pf1_ip4=${tg_if1_ip4}
+| | ... | tg_pf1_mac=${TG_pf1_mac}[0]
+| | ... | tg_pf2_ip4=${tg_if2_ip4}
+| | ... | tg_pf2_mac=${TG_pf2_mac}[0]
 | | ... | dut1_if1_ip4=${dut1_if1_ip4}
 | | ... | dut1_if2_ip4=${dut1_if2_ip4}
 | | ... | dut2_if1_ip4=${dut2_if1_ip4}
 | | ... | ELSE IF | '${container_chain_topology}' == 'pipeline_ip4'
 | | ... | ${group}.Configure VPP In All Containers
 | | ... | ${container_chain_topology}
-| | ... | tg_if1_mac=${TG_pf1_mac}[0]
-| | ... | tg_if2_mac=${TG_pf2_mac}[0]
+| | ... | tg_pf1_mac=${TG_pf1_mac}[0]
+| | ... | tg_pf2_mac=${TG_pf2_mac}[0]
 | | ... | nodes=${nf_nodes}
 | | ... | ELSE IF | '${container_chain_topology}' == 'cross_horiz'
 | | ... | ${group}.Configure VPP In All Containers
 | | ... | dut1_if1=${DUT1_${int}1}[0] | dut1_if2=${DUT1_${int}2}[0]
 | | ... | dut2_if1=${DUT2_${int}1}[0] | dut2_if2=${DUT2_${int}2}[0]
 | | ... | dut2_if2_ip4=${dut2_if2_ip4}
-| | ... | tg_if1_ip4=${tg_if1_ip4} | tg_if1_mac=${TG_pf1_mac}[0]
-| | ... | tg_if2_ip4=${tgi_f2_ip4} | tg_if2_mac=${TG_pf2_mac}[0]
+| | ... | tg_pf1_ip4=${tg_if1_ip4} | tg_pf1_mac=${TG_pf1_mac}[0]
+| | ... | tg_pf2_ip4=${tgi_f2_ip4} | tg_pf2_mac=${TG_pf2_mac}[0]
 | | ... | nodes=${nodes}
 | | Start VPP in all '${container_group}' containers
 
index 5963287..21fce77 100644 (file)
@@ -50,7 +50,7 @@
 | | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo}
 | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
 | | ... | auto_scale=${auto_scale} | vnf=${vnf}
-| | ... | tg_if1_mac=${TG_pf1_mac} | tg_if2_mac=${TG_pf2_mac}
+| | ... | tg_pf1_mac=${TG_pf1_mac}[0] | tg_pf2_mac=${TG_pf2_mac}[0]
 | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr}
 | | ... | rxq_count_int=${rxq_count_int} | enable_csum=${False}
 | | ... | enable_gso=${False}
@@ -96,7 +96,7 @@
 | | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo}
 | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
 | | ... | auto_scale=${auto_scale} | vnf=${vnf}
-| | ... | tg_if1_mac=${TG_pf1_mac} | tg_if2_mac=${TG_pf2_mac}
+| | ... | tg_pf1_mac=${TG_pf1_mac}[0] | tg_pf2_mac=${TG_pf2_mac}[0]
 | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr}
 | | ... | rxq_count_int=${rxq_count_int} | enable_csum=${False}
 | | ... | enable_gso=${False}
index 879da8f..1751d58 100644 (file)
@@ -8,8 +8,8 @@ create interface memif id $mid2 socket-id $sid2 hw-addr $mac2 master
 set interface ip address memif$sid2/$mid2 1.1.$sid2.1/24
 set interface state memif$sid2/$mid2 up
 
-set ip neighbor static memif$sid1/$mid1 1.1.$sid1.2 $vif1_mac[0]
-set ip neighbor static memif$sid2/$mid2 1.1.$sid2.2 $vif2_mac[0]
+set ip neighbor static memif$sid1/$mid1 1.1.$sid1.2 $vif1_mac
+set ip neighbor static memif$sid2/$mid2 1.1.$sid2.2 $vif2_mac
 
 ip route add 10.0.0.0/8 via 1.1.$sid1.2
 ip route add 20.0.0.0/8 via 1.1.$sid2.2
index d612603..d45eb5e 100644 (file)
@@ -8,8 +8,8 @@ create interface memif id $mid2 socket-id $sid2 hw-addr $mac2 $role2
 set interface ip address memif$sid2/$mid2 1.1.$sid2.1/24
 set interface state memif$sid2/$mid2 up
 
-set ip neighbor static memif$sid1/$mid1 1.1.$sid1.2 $vif1_mac[0]
-set ip neighbor static memif$sid2/$mid2 1.1.$sid2.2 $vif2_mac[0]
+set ip neighbor static memif$sid1/$mid1 1.1.$sid1.2 $vif1_mac
+set ip neighbor static memif$sid2/$mid2 1.1.$sid2.2 $vif2_mac
 
 ip route add 10.0.0.0/8 via 1.1.$sid1.2
 ip route add 20.0.0.0/8 via 1.1.$sid2.2
index 8fe0753..3c5f076 100644 (file)
@@ -9,8 +9,8 @@ set interface mac address GigabitEthernet0/7/0 $mac2
 set interface ip address GigabitEthernet0/7/0 1.1.2.1/24
 set interface state GigabitEthernet0/7/0 up
 
-set ip neighbor static GigabitEthernet0/6/0 1.1.1.2 $vif1_mac[0]
-set ip neighbor static GigabitEthernet0/7/0 1.1.2.2 $vif2_mac[0]
+set ip neighbor static GigabitEthernet0/6/0 1.1.1.2 $vif1_mac
+set ip neighbor static GigabitEthernet0/7/0 1.1.2.2 $vif2_mac
 
 ip route add 10.0.0.0/8 via 1.1.1.2
 ip route add 20.0.0.0/8 via 1.1.2.2