From 5627c8713723c6f25ac836f4a03a00741eb809fd Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 3 Nov 2021 16:01:31 +0000 Subject: [PATCH] [OVS][QOS] Dataplane enforcement is limited to min-bw egress direction OVS QoS extension only enforces dataplane traffic shapping for minimum bandwidth rules with egress direction. Change-Id: I57b274387505f42778f1d9d3ec2aa9feb5ae929d Closes-Bug: #1949607 --- doc/source/admin/config-qos.rst | 5 ++++- .../openvswitch/agent/extension_drivers/qos_driver.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/source/admin/config-qos.rst b/doc/source/admin/config-qos.rst index 4f1dc09a951..d147d3965c8 100644 --- a/doc/source/admin/config-qos.rst +++ b/doc/source/admin/config-qos.rst @@ -73,7 +73,7 @@ traffic directions (from the VM point of view). ============================ ==================== ==================== ============== ===== Enforcement type \ Backend Open vSwitch SR-IOV Linux Bridge OVN ============================ ==================== ==================== ============== ===== - Dataplane - Egress (1) - - + Dataplane Egress (3) Egress (1) - - Placement Egress/Ingress (2) Egress/Ingress (2) - - ============================ ==================== ==================== ============== ===== @@ -81,6 +81,9 @@ traffic directions (from the VM point of view). (1) Since Newton (2) Since Stein + (3) Open vSwitch minimum bandwidth support is only implemented for egress + direction and only for networks without tunneled traffic (only VLAN and + flat network types). .. table:: **Neutron backends, supported directions and enforcement types for Minimum Packet Rate rule** diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py b/neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py index bda3b29f4dd..7357e3186e2 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py @@ -171,6 +171,10 @@ class QosOVSAgentDriver(qos.QosLinuxAgentDriver): self.ports[port['port_id']][(qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH, rule.direction)] = port + if rule.direction == constants.INGRESS_DIRECTION: + LOG.debug('Minimum bandwidth ingress rule was updated/created for ' + 'port %s and rule %s.', port['port_id'], rule.id) + return # queue_num is used to identify the port which traffic come from, # it needs to be unique across br-int. It is convenient to use ofport @@ -184,7 +188,7 @@ class QosOVSAgentDriver(qos.QosLinuxAgentDriver): egress_port_names.extend(ports) qos_id = self.br_int.update_minimum_bandwidth_queue( port['port_id'], egress_port_names, vif_port.ofport, rule.min_kbps) - LOG.debug('Minimum bandwidth rule was updated/created for port ' + LOG.debug('Minimum bandwidth egress rule was updated/created for port ' '%(port_id)s and rule %(rule_id)s. QoS ID: %(qos_id)s. ' 'Egress ports with QoS applied: %(ports)s', {'port_id': port['port_id'], 'rule_id': rule.id,