From 944523e14720956402e1904f9838abe7a020d581 Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Tue, 26 Sep 2017 16:43:12 -0700 Subject: vpe: convert DPKD_PORT to LINK ID http://dpdk.org/doc/guides/sample_app_ug/ip_pipeline.html#application-resources-present-in-the-configuration-file LINK instances are created implicitly based on the PORT_MASK application startup argument. LINK0 is the first port enabled in the PORT_MASK, port 1 is the next one, etc. The LINK ID is different than the DPDK PMD-level NIC port ID, which is the actual position in the bitmask mentioned above. For example, if bit 5 is the first bit set in the bitmask, then LINK0 is having the PMD ID of 5. This mechanism creates a contiguous LINK ID space and isolates the configuration file against changes in the board PCIe slots where NICs are plugged in. Change-Id: I6e449272cfcfb2b2a75c246f7f569e3f923da245 Signed-off-by: Ross Brattain --- tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py index 1abc53688..6dc6df0d8 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py @@ -163,6 +163,11 @@ class TestConfigCreate(unittest.TestCase): self.assertEqual(config_create.downlink_ports, ['xe1']) self.assertEqual(config_create.socket, 2) + def test_dpdk_port_to_link_id(self): + vnfd_helper = VnfdHelper(self.VNFD_0) + config_create = ConfigCreate(vnfd_helper, 2) + self.assertEqual(config_create.dpdk_port_to_link_id_map, {'xe0': 0, 'xe1': 1}) + def test_vpe_initialize(self): vnfd_helper = VnfdHelper(self.VNFD_0) config_create = ConfigCreate(vnfd_helper, 2) -- cgit 1.2.3-korg