From 7e0c1e9e23788fc60b2bf19659a7b513ba330dea Mon Sep 17 00:00:00 2001 From: Bernard Cafarelli Date: Fri, 20 Jul 2018 10:06:21 +0200 Subject: [PATCH] [QoS] Clear rate limits when default null values are used In that case before, tc was called with zero rate and burst values. Newer iproute versions (>= 4.9) do not allow that anymore, so we send a clear command instead This also fixes QoS L3 agent extension functional tests run with such an iproute version (CentOS 7.5, Ubuntu 18.04) Change-Id: Idf16e2460bd434f5eab79745558c55c6579e81e8 Closes-Bug: #1782141 --- neutron/agent/l3/extensions/qos/fip.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/neutron/agent/l3/extensions/qos/fip.py b/neutron/agent/l3/extensions/qos/fip.py index 9b79bd9f7c3..fab8726a4ce 100644 --- a/neutron/agent/l3/extensions/qos/fip.py +++ b/neutron/agent/l3/extensions/qos/fip.py @@ -188,8 +188,13 @@ class FipQosAgentExtension(qos_base.L3QosAgentExtensionBase, rate['rate'], rate['burst']) else: tc_wrapper = self._get_tc_wrapper(device) - tc_wrapper.set_ip_rate_limit(direction, fip, - rate['rate'], rate['burst']) + if (rate['rate'] == qos_base.IP_DEFAULT_RATE and + rate['burst'] == qos_base.IP_DEFAULT_BURST): + # Default value is no limit + tc_wrapper.clear_ip_rate_limit(direction, fip) + else: + tc_wrapper.set_ip_rate_limit(direction, fip, + rate['rate'], rate['burst']) def _get_dvr_fip_device(self, router_info): is_distributed_router = router_info.router.get('distributed')