From 6b6c0421bb6658b475bddb68f766b395945e1b46 Mon Sep 17 00:00:00 2001 From: Nate Johnston Date: Fri, 1 Apr 2016 15:53:20 -0400 Subject: [PATCH] QoS DSCP use mod_flow instead of mod_flows In the implementation of DSCP QoS rule, the QosOVSAgentDriver uses the wrong method to modify br-int flows. It uses br_int.mod_flows() whilst it should use br_int.mod_flow(). This patch fixes this and also adds verification of the updates of DSCP, as we have for bandwidth here to trigger that code path and avoid regressions. Change-Id: I685ac373701ff8407fd7fbf649e17a2f7dfc0008 Closes-Bug: #1564820 --- .../openvswitch/agent/extension_drivers/qos_driver.py | 4 ++-- .../agent/l2/extensions/test_ovs_agent_qos_extension.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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 eadb05238c5..3d4bdbeed53 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 @@ -86,8 +86,8 @@ class QosOVSAgentDriver(qos.QosAgentDriver): actions = "mod_nw_tos:" + mark + "," actions += ','.join([act for act in acts if "mod_nw_tos:" not in act]) - self.br_int.mod_flows(reg2=0, in_port=port, table=0, - actions=actions) + self.br_int.mod_flow(reg2=0, in_port=port, table=0, + actions=actions) def delete_dscp_marking(self, port): port_name = port['vif_port'].port_name diff --git a/neutron/tests/functional/agent/l2/extensions/test_ovs_agent_qos_extension.py b/neutron/tests/functional/agent/l2/extensions/test_ovs_agent_qos_extension.py index 580395cf3ff..cb2237dfcbe 100644 --- a/neutron/tests/functional/agent/l2/extensions/test_ovs_agent_qos_extension.py +++ b/neutron/tests/functional/agent/l2/extensions/test_ovs_agent_qos_extension.py @@ -223,14 +223,19 @@ class TestOVSAgentQosExtension(OVSAgentQoSExtensionTestFramework): port_dicts=self.create_test_ports(amount=1, policy_id=TEST_POLICY_ID1)) self.wait_until_ports_state(self.ports, up=True) + self._assert_dscp_marking_rule_is_set(self.ports[0], + TEST_DSCP_MARKING_RULE_1) policy_copy = copy.deepcopy(self.qos_policies[TEST_POLICY_ID1]) policy_copy.rules[0].max_kbps = 500 policy_copy.rules[0].max_burst_kbps = 5 + policy_copy.rules[1].dscp_mark = TEST_DSCP_MARK_2 consumer_reg.push(resources.QOS_POLICY, policy_copy, events.UPDATED) self.wait_until_bandwidth_limit_rule_applied(self.ports[0], policy_copy.rules[0]) self._assert_bandwidth_limit_rule_is_set(self.ports[0], policy_copy.rules[0]) + self._assert_dscp_marking_rule_is_set(self.ports[0], + TEST_DSCP_MARKING_RULE_2) def test_port_qos_disassociation(self): """Test that qos_policy_id set to None will remove all qos rules from