← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1884273] Re: tc_lib (QoS; tc qdisc tbf) uses wrong value for byte/s conversion

 

Reviewed:  https://review.opendev.org/737044
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=94d6e38fa08f8a52b6f18077c2a05a05b89b42b5
Submitter: Zuul
Branch:    master

commit 94d6e38fa08f8a52b6f18077c2a05a05b89b42b5
Author: Weronika Sikora <weronika.sikora@xxxxxxxxxxxx>
Date:   Fri Jun 19 17:16:29 2020 +0200

    Fix the wrong value for QoS rate conversion to bytes/s
    
    The rate value is converted to bytes per second before being
    sent to Pyroute2, but it used the wrong value for the calculations.
    This resulted in incorrect rates.
    It should be multiplied by 1000 (kbit), not 1024 (Kibit).
    The same applies to the burst value (kb).
    
    Change-Id: I70cb1fe651a50b2f6495d7a365a6beb2ba111c6d
    Closes-Bug: #1884273


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1884273

Title:
  tc_lib (QoS; tc qdisc tbf) uses wrong value for byte/s conversion

Status in neutron:
  Fix Released

Bug description:
  Hi.
  I have noticed that the value used for kbit -> bytes/s conversion inside add_tc_qdisc() method is wrong. The code is using 1024 instead of 1000. 1024 would be used if the max_kbps variable was in Kibit, but it's not - it's in kbit, which would use 1000.

  File:
  neutron/neutron/agent/linux/tc_lib.py

  Code:

  def add_tc_qdisc(device, qdisc_type, parent=None, handle=None, latency_ms=None,
                   max_kbps=None, burst_kb=None, kernel_hz=None,
                   namespace=None):
      """Add/replace a TC qdisc on a device
  (...)
          args['burst'] = int(
              _get_tbf_burst_value(max_kbps, burst_kb, kernel_hz) * 1024 / 8)
          args['rate'] = int(max_kbps * 1024 / 8)
  (...)

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1884273/+subscriptions


References