diff --git a/neutron/extensions/port_hint_ovs_tx_steering.py b/neutron/extensions/port_hint_ovs_tx_steering.py new file mode 100644 index 00000000000..402d13511d0 --- /dev/null +++ b/neutron/extensions/port_hint_ovs_tx_steering.py @@ -0,0 +1,21 @@ +# 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 \ + as phint_txs_def +from neutron_lib.api import extensions as api_extensions + + +class Port_hint_ovs_tx_steering(api_extensions.APIExtensionDescriptor): + api_definition = phint_txs_def diff --git a/neutron/plugins/ml2/extensions/port_hint_ovs_tx_steering.py b/neutron/plugins/ml2/extensions/port_hint_ovs_tx_steering.py new file mode 100644 index 00000000000..7dcff594844 --- /dev/null +++ b/neutron/plugins/ml2/extensions/port_hint_ovs_tx_steering.py @@ -0,0 +1,35 @@ +# 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.plugins.ml2 import api +from oslo_log import log as logging + +from neutron_lib.api.definitions import port_hint_ovs_tx_steering \ + as phint_txs_def + + +LOG = logging.getLogger(__name__) + + +class PortHintOvsTxSteeringExtensionDriver(api.ExtensionDriver): + + _supported_extension_alias = phint_txs_def.ALIAS + + def initialize(self): + LOG.info( + 'PortHintOvsTxSteeringExtensionDriver initialization complete') + + @property + def extension_alias(self): + return self._supported_extension_alias diff --git a/releasenotes/notes/port-hint-ovs-tx-steering-277a411933ed372b.yaml b/releasenotes/notes/port-hint-ovs-tx-steering-277a411933ed372b.yaml new file mode 100644 index 00000000000..8ceb2e2a4c8 --- /dev/null +++ b/releasenotes/notes/port-hint-ovs-tx-steering-277a411933ed372b.yaml @@ -0,0 +1,13 @@ +--- +features: + - | + The first hint using the new ``hints`` port attribute is the + ``ovs-tx-steering`` hint. The availability of this is marked + by the extension: ``port-hint-ovs-tx-steering``. This hint is + specific to the ``openvswitch`` mechanism driver. It enables + the control of Open vSwitch's Userspace Tx packet steering + feature. For details about the Open vSwitch feature please see: + https://docs.openvswitch.org/en/latest/topics/userspace-tx-steering/ + The valid values for the ``hints`` attribute introduced by the 2nd + extension are: + ``{"openvswitch": {"other_config": {"tx-steering": "hash|thread"}}}`` diff --git a/releasenotes/notes/port-hints-d465bb2fa144537c.yaml b/releasenotes/notes/port-hints-d465bb2fa144537c.yaml new file mode 100644 index 00000000000..29dee4bf89f --- /dev/null +++ b/releasenotes/notes/port-hints-d465bb2fa144537c.yaml @@ -0,0 +1,12 @@ +--- +features: + - | + Ports now have a ``hints`` attribute, in which backend specific + tuning options can be passed to Neutron. The availability of the + ``hints`` attribute is signaled by the ``port-hints`` extension. + The ``hints`` attribute is admin-only by default. Its value is a + dict, keyed by mechanism driver aliases. The possible values are + defined by the mechanism drivers. An admin user can ask for a + hint in a port create or update request. As the name suggests a + hint is not a demand - Neutron applies the hint when it can, but + it is free to ignore it, when it can't. diff --git a/setup.cfg b/setup.cfg index 66edcd4575e..7af2ff6eb64 100644 --- a/setup.cfg +++ b/setup.cfg @@ -126,6 +126,7 @@ neutron.ml2.extension_drivers = subnet_dns_publish_fixed_ip = neutron.plugins.ml2.extensions.subnet_dns_publish_fixed_ip:SubnetDNSPublishFixedIPExtensionDriver dns_domain_keywords = neutron.plugins.ml2.extensions.dns_domain_keywords:DnsDomainKeywordsExtensionDriver port_hints = neutron.plugins.ml2.extensions.port_hints:PortHintsExtensionDriver + port_hint_ovs_tx_steering = neutron.plugins.ml2.extensions.port_hint_ovs_tx_steering:PortHintOvsTxSteeringExtensionDriver neutron.ipam_drivers = fake = neutron.tests.unit.ipam.fake_driver:FakeDriver internal = neutron.ipam.drivers.neutrondb_ipam.driver:NeutronDbPool