Browse Source

Merge "[OVN] External ports (SR-IOV) QoS is handled by SR-IOV agent"

changes/52/784552/1
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
4155070309
3 changed files with 18 additions and 5 deletions
  1. +8
    -3
      neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/extensions/qos.py
  2. +3
    -2
      neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py
  3. +7
    -0
      neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb/extensions/test_qos.py

+ 8
- 3
neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/extensions/qos.py View File

@ -216,14 +216,19 @@ class OVNClientQosExtension(object):
if ovn_rule:
txn.add(self._driver._nb_idl.qos_add(**ovn_rule))
def create_port(self, txn, port):
self.update_port(txn, port, None, reset=True)
def create_port(self, txn, port, port_type=None):
self.update_port(txn, port, None, reset=True, port_type=port_type)
def delete_port(self, txn, port):
self.update_port(txn, port, None, delete=True)
def update_port(self, txn, port, original_port, reset=False, delete=False,
qos_rules=None):
qos_rules=None, port_type=None):
if port_type == ovn_const.LSP_TYPE_EXTERNAL:
# External ports (SR-IOV) QoS is handled the SR-IOV agent QoS
# extension.
return
if (not reset and not original_port) and not delete:
# If there is no information about the previous QoS policy, do not
# make any change, unless the port is new or the QoS information


+ 3
- 2
neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py View File

@ -419,7 +419,7 @@ class OVNClient(object):
if self.is_dns_required_for_port(port):
self.add_txns_to_sync_port_dns_records(txn, port)
self._qos_driver.create_port(txn, port)
self._qos_driver.create_port(txn, port, port_type=port_info.type)
db_rev.bump_revision(context, port, ovn_const.TYPE_PORTS)
@ -564,7 +564,8 @@ class OVNClient(object):
utils.is_lsp_trusted(port)):
self._del_port_from_drop_port_group(port['id'], txn)
self._qos_driver.update_port(txn, port, port_object)
self._qos_driver.update_port(txn, port, port_object,
port_type=port_info.type)
if self.is_dns_required_for_port(port):
self.add_txns_to_sync_port_dns_records(


+ 7
- 0
neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb/extensions/test_qos.py View File

@ -314,6 +314,13 @@ class TestOVNClientQosExtension(test_plugin.Ml2PluginV2TestCase):
self.mock_rules.assert_called_once_with(
mock.ANY, port.id, port.network_id, self.qos_policies[0].id, None)
# External port, OVN QoS extension does not apply.
self.mock_rules.reset_mock()
port.qos_policy_id = self.qos_policies[0].id
self.qos_driver.update_port(mock.ANY, port, original_port,
port_type=ovn_const.LSP_TYPE_EXTERNAL)
self.mock_rules.assert_not_called()
def test_delete_port(self):
self.mock_rules.reset_mock()
self.qos_driver.delete_port(mock.ANY, self.ports[1])


Loading…
Cancel
Save