diff options
author | Peter Mikus <pmikus@cisco.com> | 2020-04-21 15:25:49 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2020-04-22 09:25:14 +0000 |
commit | 5dc176ab31af5dff73be6dd5266169a7be19dd13 (patch) | |
tree | eeac66943aa3372a37fa0c49f2160bf0425b1b1e /resources/libraries/python | |
parent | 12d5c9afe45ed1333e6117ef3a8d036240e80acd (diff) |
FIX: NF_density MAC addresses
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I0e773060c344fda7b06937a81a53863a96a4373a
Diffstat (limited to 'resources/libraries/python')
-rw-r--r-- | resources/libraries/python/ContainerUtils.py | 32 | ||||
-rw-r--r-- | resources/libraries/python/QemuManager.py | 4 |
2 files changed, 18 insertions, 18 deletions
diff --git a/resources/libraries/python/ContainerUtils.py b/resources/libraries/python/ContainerUtils.py index 111861ab33..77e139f80f 100644 --- a/resources/libraries/python/ContainerUtils.py +++ b/resources/libraries/python/ContainerUtils.py @@ -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}-"\ diff --git a/resources/libraries/python/QemuManager.py b/resources/libraries/python/QemuManager.py index a9b1b6423e..ce55be0a51 100644 --- a/resources/libraries/python/QemuManager.py +++ b/resources/libraries/python/QemuManager.py @@ -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( |