Commit Graph

9 Commits

Author SHA1 Message Date
Jakub Kicinski
33021752cd tc: move RED flag printing to helper
Number of qdiscs use the same set of flags to control shared RED
implementation.  Add a helper for printing those flags.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
2018-11-24 07:10:58 -08:00
Jakub Kicinski
e0850bdedc tc: red: allow setting th_min and th_max to the same value
Setting th_min and th_max to the same value may be useful for DCTCP
deployments.  The original DCTCP paper describes it as a simplest way
of achieving simple ECN threshold marking.  Indeed, there doesn't seem
to be any simpler qdisc in Linux which would allow such a setup today.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
2018-01-19 12:35:23 -08:00
Stephen Hemminger
913352fe54 drop unneeded include of syslog.h
Only arpd uses syslog

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-11-12 16:22:36 -08:00
Stephen Hemminger
32a121cba2 tc: code cleanup
Use checkpatch to fix whitespace and other style issues.
2016-03-21 11:48:36 -07:00
Eric Dumazet
0cf67ead7b red: give a hint about burst value
Check for burst values that are too small.

Reported-by: Dave Taht <dave.taht@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
2011-12-01 09:23:43 -08:00
Stephen Hemminger
bf808cbf84 tc: fix set never used warning in red 2011-06-20 14:34:30 -07:00
Patrick McHardy
476daa7278 Use tc_calc_xmittime() where appropriate
[IPROUTE]: Use tc_calc_xmittime() where appropriate

Replace expressions of the form "tc_core_usec2tick(1000000 * size/rate)"
by tc_calc_xmittime().

The CBQ case deserves an extra comment: when called with bnwd=rate,
tc_cbq_calc_maxidle() behaves identical to tc_calc_xmittime():

unsigned tc_cbq_calc_maxidle(...)
{
	double g = 1.0 - 1.0/(1<<ewma_log);
	double xmt = (double)avpkt/bndw;

	maxidle = xmt*(1-g);
	if (bndw != rate && maxburst) {
		...
	}
	return tc_core_usec2tick(maxidle*(1<<ewma_log)*1000000);
}

which comes down to:

maxidle	= xmt * (1 - g)
	= xmt * (1 - (1.0 - 1.0/(1 << ewma_log))
	= xmt * (1.0/(1 << ewma_log))

so:

maxidle * (1 << ewma_log) * 1000000
	= xmt * (1.0/(1 << ewma_log)) * (1 << ewma_log) * 1000000
	= xmt * 1000000
	= avpkt/bndw * 1000000

Which means tc_core_usec2tick(maxidle*(1<<ewma_log)*1000000) is identical
to tc_calc_xmittime(bndw, avpkt). Use it directly since its a lot easier
to understand its limits.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
2007-03-13 14:42:14 -07:00
osdl.org!shemminger
aba5acdfdb (Logical change 1.3) 2004-04-15 20:56:59 +00:00
osdl.org!shemminger
86fdf0e47b Initial revision 2004-04-15 20:56:59 +00:00