port-hint-ovs-tx-steering: api definition

The ``port-hint-ovs-tx-steering`` extension allows new values (i.e. a
hint) in the ``hints`` port attribute. It allows the control of Open
vSwitch's Userspace Tx packet steering options. For Open vSwitch details
please see:
https://docs.openvswitch.org/en/latest/topics/userspace-tx-steering/

Change-Id: I150e5b5660164a8f6fcc9c9161cf69e721a435ed
Partially-Implements: #1990842
Related-Change (spec): https://review.opendev.org/c/openstack/neutron-specs/+/862133
This commit is contained in:
Bence Romsics 2023-02-08 14:37:23 +01:00
parent 23fa6b3c2f
commit ec6a39c463
9 changed files with 104 additions and 1 deletions

View File

@ -3871,6 +3871,28 @@ heartbeat_timestamp:
in: body
required: true
type: string
hints:
description: |
Admin-only. The following values control Open vSwitch's Userspace Tx
packet steering feature:
- ``{"openvswitch": {"other_config": {"tx-steering": "hash|thread"}}}``
in: body
required: true
type: object
hints-request:
description: |
Admin-only. A dict, at the top level keyed by mechanism driver
aliases (as defined in setup.cfg). To following values can be used to
control Open vSwitch's Userspace Tx packet steering feature:
- ``{"openvswitch": {"other_config": {"tx-steering": "hash"}}}``
- ``{"openvswitch": {"other_config": {"tx-steering": "thread"}}}``
If omitted the default is defined by Open vSwitch.
in: body
required: false
type: object
host:
description: |
The hostname of the system the agent is running on.

View File

@ -122,6 +122,15 @@ introducing concrete hints and signals the presence of the ``hints``
port attribute to the API user. By default policy, use of the ``hints``
attribute is restricted to admininstrative users.
Port hint: Open vSwitch Tx steering
===================================
The ``port-hint-ovs-tx-steering`` extension allows new values (i.e. a
hint) in the ``hints`` port attribute. It allows the control of Open
vSwitch's Userspace Tx packet steering options. For Open vSwitch details
please see:
https://docs.openvswitch.org/en/latest/topics/userspace-tx-steering/
Port resource request
=====================
@ -251,6 +260,7 @@ Response Parameters
- dns_name: dns_name
- extra_dhcp_opts: extra_dhcp_opts
- fixed_ips: fixed_ips
- hints: hints
- id: id
- ip_allocation: ip_allocation
- mac_address: mac_address
@ -338,6 +348,7 @@ Request
- dns_name: dns_name-request
- extra_dhcp_opts: extra_dhcp_opts-request
- fixed_ips: fixed_ips-request
- hints: hints-request
- mac_address: mac_address-request-put
- name: name-request
- numa_affinity_policy: numa_affinity_policy-request
@ -381,6 +392,7 @@ Response Parameters
- dns_name: dns_name
- extra_dhcp_opts: extra_dhcp_opts
- fixed_ips: fixed_ips
- hints: hints
- id: id
- ip_allocation: ip_allocation
- mac_address: mac_address
@ -518,6 +530,7 @@ Response Parameters
- dns_name: dns_name
- extra_dhcp_opts: extra_dhcp_opts
- fixed_ips: fixed_ips
- hints: hints
- id: id
- ip_allocation: ip_allocation
- mac_address: mac_address
@ -582,6 +595,7 @@ Request
- dns_name: dns_name-request
- extra_dhcp_opts: extra_dhcp_opts-request
- fixed_ips: fixed_ips-request
- hints: hints-request
- mac_address: mac_address-request
- name: name-request
- network_id: network_id
@ -629,6 +643,7 @@ Response Parameters
- dns_name: dns_name
- extra_dhcp_opts: extra_dhcp_opts
- fixed_ips: fixed_ips
- hints: hints
- id: id
- ip_allocation: ip_allocation
- mac_address: mac_address

View File

@ -15,6 +15,7 @@
"device_owner": "baremetal:none",
"dns_domain": "my-domain.org.",
"dns_name": "myport",
"hints": {"openvswitch": {"other_config": {"tx-steering": "hash"}}},
"qos_policy_id": "29d5e02e-d5ab-4929-bee4-4a9fc12e22ae",
"propagate_uplink_status": false
}

View File

@ -84,6 +84,7 @@ from neutron_lib.api.definitions import network_segment_range
from neutron_lib.api.definitions import pagination
from neutron_lib.api.definitions import port
from neutron_lib.api.definitions import port_device_profile
from neutron_lib.api.definitions import port_hint_ovs_tx_steering
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
@ -229,6 +230,7 @@ _ALL_API_DEFINITIONS = {
port,
port_device_profile,
port_hints,
port_hint_ovs_tx_steering,
port_mac_address_override,
port_mac_address_regenerate,
port_numa_affinity_policy,

View File

@ -140,6 +140,8 @@ KNOWN_EXTENSIONS = (
'qos-rules-alias',
'quotas',
'quota-check-limit',
'port-hints',
'port-hint-ovs-tx-steering',
'rbac-address-group',
'rbac-address-scope',
'rbac-bgpvpn',

View File

@ -0,0 +1,28 @@
# Copyright (c) 2023 Ericsson Software Technology
#
# 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.
ALIAS = 'port-hint-ovs-tx-steering'
IS_SHIM_EXTENSION = True
IS_STANDARD_ATTR_EXTENSION = False
NAME = 'Port hint: Open vSwitch Tx steering'
DESCRIPTION = 'Enable Port hint: Open vSwitch Tx steering'
UPDATED_TIMESTAMP = '2023-01-01T00:00:00-00:00'
RESOURCE_ATTRIBUTE_MAP = {}
SUB_RESOURCE_ATTRIBUTE_MAP = {}
ACTION_MAP = {}
ACTION_STATUS = {}
REQUIRED_EXTENSIONS = ['port-hints']
OPTIONAL_EXTENSIONS = []
ACTION_STATUS = {}

View File

@ -24,6 +24,11 @@ UPDATED_TIMESTAMP = '2023-01-01T00:00:00-00:00'
RESOURCE_NAME = port.RESOURCE_NAME
COLLECTION_NAME = port.COLLECTION_NAME
HINTS = 'hints'
HINTS_SPEC = {
'type:dict_or_none': {'openvswitch': {
'type:dict': {'other_config': {
'type:dict': {'tx-steering': {
'type:values': ['thread', 'hash']}}}}}}}
RESOURCE_ATTRIBUTE_MAP = {
COLLECTION_NAME: {
@ -33,7 +38,7 @@ RESOURCE_ATTRIBUTE_MAP = {
'default': None,
'enforce_policy': True,
'is_visible': True,
'validate': {'type:dict_or_none': None},
'validate': HINTS_SPEC,
},
},
}

View File

@ -0,0 +1,20 @@
# Copyright 2023 Ericsson Software Technology
#
# 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_hint_ovs_tx_steering
from neutron_lib.tests.unit.api.definitions import base
class PortHintOvsTxSteeringDefinitionTestCase(base.DefinitionBaseTestCase):
extension_module = port_hint_ovs_tx_steering

View File

@ -0,0 +1,8 @@
---
features:
- |
The ``port-hint-ovs-tx-steering`` extension allows new values (i.e. a
hint) in the ``hints`` port attribute. It allows the control of Open
vSwitch's Userspace Tx packet steering options. For Open vSwitch details
please see:
https://docs.openvswitch.org/en/latest/topics/userspace-tx-steering/