https://github.com/torvalds/linux
Revision 0564bf0afae443deeb16f36e2c39fefff89d05f2 authored by Konstantin Khlebnikov on 16 July 2016, 14:08:56 UTC, committed by David S. Miller on 19 July 2016, 05:44:31 UTC
In kernel HTB keeps tokens in signed 64-bit in nanoseconds. In netlink
protocol these values are converted into pshed ticks (64ns for now) and
truncated to 32-bit. In struct tc_htb_xstats fields "tokens" and "ctokens"
are declared as unsigned 32-bit but they could be negative thus tool 'tc'
prints them as signed. Big values loose higher bits and/or become negative.

This patch clamps tokens in xstat into range from INT_MIN to INT_MAX.
In this way it's easier to understand what's going on here.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8e6ce7e
History
Tip revision: 0564bf0afae443deeb16f36e2c39fefff89d05f2 authored by Konstantin Khlebnikov on 16 July 2016, 14:08:56 UTC
net/sched/sch_htb: clamp xstats tokens to fit into 32-bit int
Tip revision: 0564bf0
File Mode Size
Documentation
arch
block
certs
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.get_maintainer.ignore -rw-r--r-- 31 bytes
.gitignore -rw-r--r-- 1.2 KB
.mailmap -rw-r--r-- 6.4 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 95.5 KB
Kbuild -rw-r--r-- 2.8 KB
Kconfig -rw-r--r-- 252 bytes
MAINTAINERS -rw-r--r-- 353.8 KB
Makefile -rw-r--r-- 56.0 KB
README -rw-r--r-- 18.1 KB
REPORTING-BUGS -rw-r--r-- 7.3 KB

README

back to top