Assorted cleanups from numa-aware-vswitches series

Resolve open issues from preceding patches.

Part of blueprint numa-aware-vswitches

Change-Id: I0c35109b67aa94cf19a4d20a97bf5ab15cf3db4e
This commit is contained in:
Stephen Finucane 2018-07-13 17:41:34 +01:00 committed by Dan Smith
parent 803f85d7e6
commit 24c016ed6c
7 changed files with 12 additions and 14 deletions

View File

@ -31,13 +31,13 @@ Simultaneous Multi-Threading (SMT)
CPUs on the system and can execute workloads in parallel. However, as with
NUMA, threads compete for shared resources.
Non Uniform I/O Access (NUMA I/O)
Non-Uniform I/O Access (NUMA I/O)
In a NUMA system, I/O to a device mapped to a local memory region is more
efficient than I/O to a remote device. A device connected to the same socket
providing the CPU and memory offers lower latencies for I/O operations due to
its physical proximity. This generally manifests itself in devices connected
to the PCIe bus, such as NICs or vGPUs, but applies to any device support
memory mapped I/O.
memory-mapped I/O.
In OpenStack, SMP CPUs are known as *cores*, NUMA cells or nodes are known as
*sockets*, and SMT CPUs are known as *threads*. For example, a quad-socket,

View File

@ -818,9 +818,8 @@ class API(base.Base):
# InstancePCIRequests object
pci_request_info = pci_request.get_pci_requests_from_flavor(
instance_type)
network_metadata = self.network_api.create_resource_requests(context,
requested_networks, pci_request_info)
network_metadata = self.network_api.create_resource_requests(
context, requested_networks, pci_request_info)
base_options = {
'reservation_id': reservation_id,

View File

@ -1753,9 +1753,6 @@ class API(base_api.NetworkAPI):
segments, the first segment that defines a physnet value will be
used for the physnet name.
"""
def is_tunneled(net):
return net.get('provider:network_type') in L3_NETWORK_TYPES
if self._has_multi_provider_extension(context, neutron=neutron):
network = neutron.show_network(net_id,
fields='segments').get('network')
@ -1772,7 +1769,7 @@ class API(base_api.NetworkAPI):
# physical networks.
physnet_name = net.get('provider:physical_network')
if physnet_name:
return physnet_name, is_tunneled(net)
return physnet_name, False
# Raising here as at least one segment should
# have a physical network provided.
@ -1784,7 +1781,8 @@ class API(base_api.NetworkAPI):
net = neutron.show_network(
net_id, fields=['provider:physical_network',
'provider:network_type']).get('network')
return net.get('provider:physical_network'), is_tunneled(net)
return (net.get('provider:physical_network'),
net.get('provider:network_type') in L3_NETWORK_TYPES)
@staticmethod
def _get_trusted_mode_from_port(port):

View File

@ -78,7 +78,6 @@ PCIAddressField = fields.PCIAddressField
Enum = fields.Enum
Field = fields.Field
FieldType = fields.FieldType
String = fields.String
Set = fields.Set
Dict = fields.Dict
List = fields.List
@ -92,7 +91,7 @@ IPV6Network = fields.IPV6Network
class SetOfStringsField(AutoTypedField):
AUTO_TYPE = Set(String())
AUTO_TYPE = Set(fields.String())
class BaseNovaEnum(Enum):

View File

@ -18,7 +18,7 @@ from nova.objects import fields
@base.NovaObjectRegistry.register
class NetworkMetadata(base.NovaObject):
"""Hold aggregate metadata for a collection on networks.
"""Hold aggregate metadata for a collection of networks.
This object holds aggregate information for a collection of neutron
networks. There are two types of network collections we care about and use

View File

@ -31,3 +31,5 @@ class NeutronConfTestCase(test.NoDBTestCase):
self.assertIn('neutron_physnet_foo', CONF)
self.assertIn('neutron_physnet_bar', CONF)
self.assertIn('neutron_tunnel', CONF)
self.assertIn('numa_nodes', CONF.neutron_tunnel)

View File

@ -3451,7 +3451,7 @@ class NetworkRequestSupportTestCase(test.NoDBTestCase):
def test_multiple_networks(self):
"""Validate behavior with multiple networks.
If a we request multiple networks that are spread across host NUMA
If we request multiple networks that are spread across host NUMA
nodes, we're going to need to use multiple host instances.
"""
network_metadata = objects.NetworkMetadata(