numam-dpdk/lib/librte_sched
Alan Dewar 83415d4fd8 sched: fix port time rounding
The QoS scheduler works off port time that is computed from the number
of CPU cycles that have elapsed since the last time the port was
polled.   It divides the number of elapsed cycles to calculate how
many bytes can be sent, however this division can generate rounding
errors, where some fraction of a byte sent may be lost.

Lose enough of these fractional bytes and the QoS scheduler
underperforms.  The problem is worse with low bandwidths.

To compensate for this rounding error this fix doesn't advance the
port's time_cpu_cycles by the number of cycles that have elapsed,
but by multiplying the computed number of bytes that can be sent
(which has been rounded down) by number of cycles per byte.
This will mean that port's time_cpu_cycles will lag behind the CPU
cycles momentarily.  At the next poll, the lag will be taken into
account.

Fixes: de3cfa2c98 ("sched: initial import")
Cc: stable@dpdk.org

Signed-off-by: Alan Dewar <alan.dewar@att.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2020-07-07 00:58:31 +02:00
..
Makefile build: remove individual library versions 2019-11-20 23:05:39 +01:00
meson.build build: remove individual library versions 2019-11-20 23:05:39 +01:00
rte_approx.c sched: support 64-bit values 2019-10-25 18:07:37 +02:00
rte_approx.h sched: support 64-bit values 2019-10-25 18:07:37 +02:00
rte_red.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
rte_red.h lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
rte_sched_common.h replace alignment attributes 2020-04-16 18:16:18 +02:00
rte_sched_version.map build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
rte_sched.c sched: fix port time rounding 2020-07-07 00:58:31 +02:00
rte_sched.h sched: add 64-bit values 2019-10-25 18:07:26 +02:00