Add "socket" NUMA affinity policy
The "socket" NUMA affinity policy has been supported in Nova since [1]. [1]https://review.opendev.org/c/openstack/nova/+/773792 Related-Bug: #2052786 Change-Id: Id84f3f5c83a1452875f2d7adf4611db319c240ce
This commit is contained in:
parent
35455d101b
commit
7eeb1b87ac
@ -107,7 +107,8 @@ NUMA affinity policy
|
||||
|
||||
The NUMA affinity policy extension (``port-numa-affinity-policy``) defines
|
||||
the Nova scheduling strategy according to the network backend NUMA topology.
|
||||
This parameter could be ``required``, ``preferred``, ``legacy`` or ``None``.
|
||||
This parameter could be ``required``, ``preferred``, ``legacy``, ``socket`` or
|
||||
``None``.
|
||||
|
||||
Port binding extended attributes
|
||||
================================
|
||||
|
@ -96,6 +96,7 @@ from neutron_lib.api.definitions import port_hints
|
||||
from neutron_lib.api.definitions import port_mac_address_override
|
||||
from neutron_lib.api.definitions import port_mac_address_regenerate
|
||||
from neutron_lib.api.definitions import port_numa_affinity_policy
|
||||
from neutron_lib.api.definitions import port_numa_affinity_policy_socket
|
||||
from neutron_lib.api.definitions import port_resource_request
|
||||
from neutron_lib.api.definitions import port_resource_request_groups
|
||||
from neutron_lib.api.definitions import port_security
|
||||
@ -252,6 +253,7 @@ _ALL_API_DEFINITIONS = {
|
||||
port_mac_address_override,
|
||||
port_mac_address_regenerate,
|
||||
port_numa_affinity_policy,
|
||||
port_numa_affinity_policy_socket,
|
||||
port_resource_request,
|
||||
port_resource_request_groups,
|
||||
port_security,
|
||||
|
@ -147,6 +147,8 @@ KNOWN_EXTENSIONS = (
|
||||
'quota-check-limit',
|
||||
'port-hints',
|
||||
'port-hint-ovs-tx-steering',
|
||||
'port-numa-affinity-policy',
|
||||
'port-numa-affinity-policy-socket',
|
||||
'rbac-address-group',
|
||||
'rbac-address-scope',
|
||||
'rbac-bgpvpn',
|
||||
|
@ -32,7 +32,10 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'validate': {
|
||||
'type:values': constants.PORT_NUMA_POLICIES + (None, )},
|
||||
'type:values': (constants.PORT_NUMA_POLICY_REQUIRED,
|
||||
constants.PORT_NUMA_POLICY_PREFERRED,
|
||||
constants.PORT_NUMA_POLICY_LEGACY,
|
||||
None)},
|
||||
'default': None,
|
||||
'is_visible': True}
|
||||
},
|
||||
|
@ -0,0 +1,46 @@
|
||||
# Copyright (c) 2024 Red Hat, Inc.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron_lib.api.definitions import port
|
||||
from neutron_lib.api.definitions import port_numa_affinity_policy
|
||||
from neutron_lib import constants
|
||||
|
||||
|
||||
ALIAS = 'port-numa-affinity-policy-socket'
|
||||
IS_SHIM_EXTENSION = False
|
||||
IS_STANDARD_ATTR_EXTENSION = False
|
||||
NAME = 'Port NUMA affinity policy "socket"'
|
||||
DESCRIPTION = 'Adds "socket" to the supported port NUMA affinity policies'
|
||||
UPDATED_TIMESTAMP = "2024-02-09T10:00:00-00:00"
|
||||
RESOURCE_NAME = port.RESOURCE_NAME
|
||||
COLLECTION_NAME = port.COLLECTION_NAME
|
||||
NUMA_AFFINITY_POLICY = port_numa_affinity_policy.NUMA_AFFINITY_POLICY
|
||||
|
||||
RESOURCE_ATTRIBUTE_MAP = {
|
||||
COLLECTION_NAME: {
|
||||
NUMA_AFFINITY_POLICY: {
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'validate': {
|
||||
'type:values': constants.PORT_NUMA_POLICIES + (None,)},
|
||||
'default': None,
|
||||
'is_visible': True}
|
||||
},
|
||||
}
|
||||
|
||||
SUB_RESOURCE_ATTRIBUTE_MAP = None
|
||||
ACTION_MAP = {}
|
||||
ACTION_STATUS = {}
|
||||
REQUIRED_EXTENSIONS = [port_numa_affinity_policy.ALIAS]
|
||||
OPTIONAL_EXTENSIONS = []
|
@ -703,8 +703,12 @@ RP_PP_INVENTORY_DEFAULTS = (
|
||||
PORT_NUMA_POLICY_REQUIRED = 'required'
|
||||
PORT_NUMA_POLICY_PREFERRED = 'preferred'
|
||||
PORT_NUMA_POLICY_LEGACY = 'legacy'
|
||||
PORT_NUMA_POLICIES = (PORT_NUMA_POLICY_REQUIRED, PORT_NUMA_POLICY_PREFERRED,
|
||||
PORT_NUMA_POLICY_LEGACY)
|
||||
PORT_NUMA_POLICY_SOCKET = 'socket'
|
||||
PORT_NUMA_POLICIES = (PORT_NUMA_POLICY_REQUIRED,
|
||||
PORT_NUMA_POLICY_PREFERRED,
|
||||
PORT_NUMA_POLICY_LEGACY,
|
||||
PORT_NUMA_POLICY_SOCKET,
|
||||
)
|
||||
|
||||
# RBAC Sharing Actions
|
||||
ACCESS_SHARED = 'access_as_shared'
|
||||
|
@ -0,0 +1,24 @@
|
||||
# Copyright 2024 Red Hat, Inc.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron_lib.api.definitions import port_numa_affinity_policy_socket
|
||||
from neutron_lib.tests.unit.api.definitions import base
|
||||
|
||||
|
||||
class PortNumaAffinityPolicySocketDefinitionTestCase(
|
||||
base.DefinitionBaseTestCase):
|
||||
extension_module = port_numa_affinity_policy_socket
|
||||
extension_resources = (port_numa_affinity_policy_socket.COLLECTION_NAME,)
|
||||
extension_attributes = (
|
||||
port_numa_affinity_policy_socket.NUMA_AFFINITY_POLICY,)
|
@ -337,7 +337,8 @@ class NumaAffinityPoliciesEnumFieldTest(test_base.BaseTestCase, TestField):
|
||||
self.field = common_types.NumaAffinityPoliciesEnumField()
|
||||
good_values = [const.PORT_NUMA_POLICY_REQUIRED,
|
||||
const.PORT_NUMA_POLICY_PREFERRED,
|
||||
const.PORT_NUMA_POLICY_LEGACY]
|
||||
const.PORT_NUMA_POLICY_LEGACY,
|
||||
const.PORT_NUMA_POLICY_SOCKET]
|
||||
self.coerce_good_values = [(val, val) for val in good_values]
|
||||
self.coerce_bad_values = ['foo-invalid-policy']
|
||||
self.to_primitive_values = self.coerce_good_values
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
New API definition: ``port-numa-affinity-policy-socket``. This extension
|
||||
adds a new field, "socket", to the parent API extension
|
||||
``port-numa-affinity-policy``. Now the valid values are: None, "required",
|
||||
"preferred", "legacy" and "socket".
|
Loading…
Reference in New Issue
Block a user