Enable QoS minimum packet rate rule for OVS backend
This patch does *not* implement dataplane enforcement. QoS minimum packet rate rule is enabled in OVS backend driver and create/delete/update empty methods are added to enable placement enforcement. Partial-Bug: #1922237 See-Also: https://review.opendev.org/785236 Change-Id: Ie283ad3a4ec433c88ac23f798908cd143159394b
This commit is contained in:
parent
d699a955cd
commit
aada855f6d
@ -84,12 +84,20 @@ traffic directions (from the VM point of view).
|
|||||||
|
|
||||||
.. table:: **Neutron backends, supported directions and enforcement types for Minimum Packet Rate rule**
|
.. table:: **Neutron backends, supported directions and enforcement types for Minimum Packet Rate rule**
|
||||||
|
|
||||||
============================ ==================== ==================== ============== =====
|
============================ ========================== ==================== ============== =====
|
||||||
Enforcement type \ Backend Open vSwitch SR-IOV Linux Bridge OVN
|
Enforcement type \ Backend Open vSwitch SR-IOV Linux Bridge OVN
|
||||||
============================ ==================== ==================== ============== =====
|
============================ ========================== ==================== ============== =====
|
||||||
Dataplane - - - -
|
Dataplane - - - -
|
||||||
Placement - - - -
|
Placement Any(1)/Egress/Ingress (2) - - -
|
||||||
============================ ==================== ==================== ============== =====
|
============================ ========================== ==================== ============== =====
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
(1) Minimum packet rate rule supports ``any`` direction that can be used
|
||||||
|
with non-hardware-offloaded OVS deployments, where packets processed
|
||||||
|
from both ingress and egress directions are handled by the same set of
|
||||||
|
CPU cores.
|
||||||
|
(2) Since Yoga.
|
||||||
|
|
||||||
For an ml2 plug-in, the list of supported QoS rule types and parameters is
|
For an ml2 plug-in, the list of supported QoS rule types and parameters is
|
||||||
defined as a common subset of rules supported by all active mechanism drivers.
|
defined as a common subset of rules supported by all active mechanism drivers.
|
||||||
|
@ -214,3 +214,22 @@ class QosOVSAgentDriver(qos.QosLinuxAgentDriver):
|
|||||||
return
|
return
|
||||||
LOG.debug("Minimum bandwidth rule for ingress direction was deleted "
|
LOG.debug("Minimum bandwidth rule for ingress direction was deleted "
|
||||||
"for port %s", port['port_id'])
|
"for port %s", port['port_id'])
|
||||||
|
|
||||||
|
# NOTE(przszc): Even though dataplane enforcement is not yet implemented
|
||||||
|
# for minimum packet rate rule, we need dummy methods to support placement
|
||||||
|
# enforcement.
|
||||||
|
def create_minimum_packet_rate(self, port, rule):
|
||||||
|
LOG.debug("Minimum packet rate rule was created for port %s and "
|
||||||
|
"rule %s.", port['port_id'], rule.id)
|
||||||
|
|
||||||
|
def update_minimum_packet_rate(self, port, rule):
|
||||||
|
LOG.debug("Minimum packet rate rule was updated for port %s and "
|
||||||
|
"rule %s.", port['port_id'], rule.id)
|
||||||
|
|
||||||
|
def delete_minimum_packet_rate(self, port):
|
||||||
|
LOG.debug("Minimum packet rate rule was deleted for port %s",
|
||||||
|
port['port_id'])
|
||||||
|
|
||||||
|
def delete_minimum_packet_rate_ingress(self, port):
|
||||||
|
LOG.debug("Minimum packet rate rule for ingress direction was deleted "
|
||||||
|
"for port %s", port['port_id'])
|
||||||
|
@ -21,6 +21,7 @@ from neutron_lib.services.qos import constants as qos_consts
|
|||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from neutron.objects import network as network_object
|
from neutron.objects import network as network_object
|
||||||
|
from neutron.services.qos import constants as neutron_qos_consts
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
@ -43,7 +44,13 @@ SUPPORTED_RULES = {
|
|||||||
qos_consts.MIN_KBPS: {
|
qos_consts.MIN_KBPS: {
|
||||||
'type:range': [0, db_consts.DB_INTEGER_MAX_VALUE]},
|
'type:range': [0, db_consts.DB_INTEGER_MAX_VALUE]},
|
||||||
qos_consts.DIRECTION: {'type:values': constants.VALID_DIRECTIONS}
|
qos_consts.DIRECTION: {'type:values': constants.VALID_DIRECTIONS}
|
||||||
}
|
},
|
||||||
|
neutron_qos_consts.RULE_TYPE_MINIMUM_PACKET_RATE: {
|
||||||
|
qos_consts.MIN_KPPS: {
|
||||||
|
'type:range': [0, db_consts.DB_INTEGER_MAX_VALUE]},
|
||||||
|
qos_consts.DIRECTION: {
|
||||||
|
'type:values': constants.VALID_DIRECTIONS_AND_ANY},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -260,3 +260,35 @@ class QosOVSAgentDriverTestCase(ovs_test_base.OVSAgentConfigTestBase):
|
|||||||
self.qos_driver.update_minimum_bandwidth(port, rule)
|
self.qos_driver.update_minimum_bandwidth(port, rule)
|
||||||
mock_delete_minimum_bandwidth_queue.assert_called_once_with(
|
mock_delete_minimum_bandwidth_queue.assert_called_once_with(
|
||||||
'port_id', ['port1', 'port2'], 'ofport', 1500)
|
'port_id', ['port1', 'port2'], 'ofport', 1500)
|
||||||
|
|
||||||
|
# TODO(przszc): Update tests when dataplane enforcement is implemented for
|
||||||
|
# minimum packet rate rule
|
||||||
|
def test_create_minimum_packet_rate(self):
|
||||||
|
try:
|
||||||
|
port = {'port_id': 'p_id'}
|
||||||
|
rule = mock.MagicMock(id='rule_id')
|
||||||
|
self.qos_driver.create_minimum_packet_rate(port, rule)
|
||||||
|
except Exception:
|
||||||
|
self.fail('create_minimum_packet_rate failed')
|
||||||
|
|
||||||
|
def test_update_minimum_packet_rate(self):
|
||||||
|
try:
|
||||||
|
port = {'port_id': 'p_id'}
|
||||||
|
rule = mock.MagicMock(id='rule_id')
|
||||||
|
self.qos_driver.update_minimum_packet_rate(port, rule)
|
||||||
|
except Exception:
|
||||||
|
self.fail('update_minimum_packet_rate failed')
|
||||||
|
|
||||||
|
def test_delete_minimum_packet_rate(self):
|
||||||
|
try:
|
||||||
|
port = {'port_id': 'p_id'}
|
||||||
|
self.qos_driver.delete_minimum_packet_rate(port)
|
||||||
|
except Exception:
|
||||||
|
self.fail('delete_minimum_packet_rate failed')
|
||||||
|
|
||||||
|
def test_delete_minimum_packet_rate_ingress(self):
|
||||||
|
try:
|
||||||
|
port = {'port_id': 'p_id'}
|
||||||
|
self.qos_driver.delete_minimum_packet_rate_ingress(port)
|
||||||
|
except Exception:
|
||||||
|
self.fail('delete_minimum_packet_rate_ingress failed')
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Enabled placement enforcement for QoS minimum packet rate rule in OVS
|
||||||
|
backend.
|
Loading…
x
Reference in New Issue
Block a user