net-next-2.6 [PATCH 1/1] dccp: ccids whitespace-cleanup / CodingStyle
No code change, cosmetical changes only: * whitespace cleanup via scripts/cleanfile, * remove self-references to filename at top of files, * fix coding style (extraneous brackets), * fix documentation style (kernel-doc-nano-HOWTO). Thanks are due to Ivo Augusto Calado who raised these issues by submitting good-quality patches. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
d136f1bd36
commit
aa1b1ff099
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* net/dccp/ccids/lib/tfrc_equation.c
|
||||
*
|
||||
* Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand.
|
||||
* Copyright (c) 2005 Ian McDonald <ian.mcdonald@jandi.co.nz>
|
||||
* Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
|
||||
@@ -79,10 +77,10 @@
|
||||
}
|
||||
|
||||
With the given configuration, we have, with M = TFRC_CALC_X_ARRSIZE-1,
|
||||
lookup[0][0] = g(1000000/(M+1)) = 1000000 * f(0.2%)
|
||||
lookup[M][0] = g(1000000) = 1000000 * f(100%)
|
||||
lookup[0][1] = g(TFRC_SMALLEST_P) = 1000000 * f(0.01%)
|
||||
lookup[M][1] = g(TFRC_CALC_X_SPLIT) = 1000000 * f(5%)
|
||||
lookup[0][0] = g(1000000/(M+1)) = 1000000 * f(0.2%)
|
||||
lookup[M][0] = g(1000000) = 1000000 * f(100%)
|
||||
lookup[0][1] = g(TFRC_SMALLEST_P) = 1000000 * f(0.01%)
|
||||
lookup[M][1] = g(TFRC_CALC_X_SPLIT) = 1000000 * f(5%)
|
||||
|
||||
In summary, the two columns represent f(p) for the following ranges:
|
||||
* The first column is for 0.002 <= p <= 1.0
|
||||
@@ -610,11 +608,10 @@ static inline u32 tfrc_binsearch(u32 fval, u8 small)
|
||||
|
||||
/**
|
||||
* tfrc_calc_x - Calculate the send rate as per section 3.1 of RFC3448
|
||||
*
|
||||
* @s: packet size in bytes
|
||||
* @R: RTT scaled by 1000000 (i.e., microseconds)
|
||||
* @p: loss ratio estimate scaled by 1000000
|
||||
* Returns X_calc in bytes per second (not scaled).
|
||||
* @s: packet size in bytes
|
||||
* @R: RTT scaled by 1000000 (i.e., microseconds)
|
||||
* @p: loss ratio estimate scaled by 1000000
|
||||
* Returns X_calc in bytes per second (not scaled).
|
||||
*/
|
||||
u32 tfrc_calc_x(u16 s, u32 R, u32 p)
|
||||
{
|
||||
@@ -630,17 +627,17 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p)
|
||||
return ~0U;
|
||||
}
|
||||
|
||||
if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */
|
||||
if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */
|
||||
if (p < TFRC_SMALLEST_P) { /* 0.0000 < p < 0.0001 */
|
||||
DCCP_WARN("Value of p (%d) below resolution. "
|
||||
"Substituting %d\n", p, TFRC_SMALLEST_P);
|
||||
index = 0;
|
||||
} else /* 0.0001 <= p <= 0.05 */
|
||||
} else /* 0.0001 <= p <= 0.05 */
|
||||
index = p/TFRC_SMALLEST_P - 1;
|
||||
|
||||
f = tfrc_calc_x_lookup[index][1];
|
||||
|
||||
} else { /* 0.05 < p <= 1.00 */
|
||||
} else { /* 0.05 < p <= 1.00 */
|
||||
index = p/(1000000/TFRC_CALC_X_ARRSIZE) - 1;
|
||||
|
||||
f = tfrc_calc_x_lookup[index][0];
|
||||
@@ -661,7 +658,6 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p)
|
||||
|
||||
/**
|
||||
* tfrc_calc_x_reverse_lookup - try to find p given f(p)
|
||||
*
|
||||
* @fvalue: function value to match, scaled by 1000000
|
||||
* Returns closest match for p, also scaled by 1000000
|
||||
*/
|
||||
|
Reference in New Issue
Block a user