[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
This commit is contained in:
Bernard Cafarelli 2018-07-20 10:06:21 +02:00
parent d8a58b96ff
commit 7e0c1e9e23
No known key found for this signature in database
GPG Key ID: D148244A3C2462BD
1 changed files with 7 additions and 2 deletions

View File

@ -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')