[OVN][Placement] Add support for minimum bandwidth QoS rules

In order to be able to schedule a port bound to OVN backend and a
minimum bandwidth rule, this type of QoS rule should be supported
in the mechanism QoS driver ``OVNQosDriver``.

This new QoS rule has no driver enforcement; it is used only for
Placement scheduling.

Partial-Bug: #1578989

Change-Id: Ia10aae1820f13bb28956d9ef45eced2dba71be98
This commit is contained in:
Rodolfo Alonso Hernandez 2021-04-15 13:38:25 +00:00
parent 2a3f7aac7f
commit 1248b36ddc
3 changed files with 11 additions and 6 deletions

View File

@ -82,6 +82,10 @@ class OVNClientQosExtension(object):
elif isinstance(rule, qos_rule.QosDscpMarkingRule):
r = {rule.rule_type: {'dscp_mark': rule.dscp_mark}}
qos_rules[constants.EGRESS_DIRECTION].update(r)
elif isinstance(rule, qos_rule.QosMinimumBandwidthRule):
# Rule supported for Placement scheduling but not enforced in
# the driver.
pass
else:
LOG.warning('Rule type %(rule_type)s from QoS policy '
'%(policy_id)s is not supported in OVN',

View File

@ -33,7 +33,12 @@ SUPPORTED_RULES = {
},
qos_consts.RULE_TYPE_DSCP_MARKING: {
qos_consts.DSCP_MARK: {'type:values': constants.VALID_DSCP_MARKS},
}
},
qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH: {
qos_consts.MIN_KBPS: {
'type:range': [0, db_consts.DB_INTEGER_MAX_VALUE]},
qos_consts.DIRECTION: {'type:values': constants.VALID_DIRECTIONS}
},
}
VIF_TYPES = [portbindings.VIF_TYPE_OVS, portbindings.VIF_TYPE_VHOST_USER]

View File

@ -173,11 +173,7 @@ class TestOVNClientQosExtension(test_plugin.Ml2PluginV2TestCase):
}
self.assertEqual(expected, self.qos_driver._qos_rules(mock.ANY,
'policy_id1'))
msg = ('Rule type %(rule_type)s from QoS policy %(policy_id)s is not '
'supported in OVN')
mock_warning.assert_called_once_with(
msg, {'rule_type': qos_constants.RULE_TYPE_MINIMUM_BANDWIDTH,
'policy_id': 'policy_id1'})
mock_warning.assert_not_called()
@mock.patch.object(rule_obj, 'get_rules')
def test__qos_rules_no_rules(self, mock_get_rules):