diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2007-11-24 18:58:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:54:55 -0500 |
commit | 900bfed4718126e6c32244903b6f43e0990d04ad (patch) | |
tree | d4644ea4770657046d762d9997d7a8e1d794ff94 /net/dccp/ccids | |
parent | b00d2bbc45a287c9a72374582ce42205f3412419 (diff) |
[CCID2]: Disable broken Ack Ratio adaptation algorithm
This comments out a problematic section comprising a half-finished algorithm:
- The variable `ccid2hctx_ackloss' is never initialised to a value different from 0 and
hence in fact is a read-only constant.
- The `arsent' variable counts packets other than Acks (it is incremented for every packet),
and there is no test for Ack Loss.
- The concept of counting Acks as such leads to a complex calculation, and the calculation
at the moment is inconsistent with this concept.
The problem is that the number of Acks - rather than the number of windows - is counted,
which leads to a complex (cubic/quadratic) expression - this is not even implemented.
In its current state, the commented-out algorithm interfers with normal processing by
changing Ack Ratio incorrectly, and at the wrong times.
A new algorithm is necessary, which will not necessarily use the same variables as used by
the unfinished one; hence the old variables have been removed.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccids')
-rw-r--r-- | net/dccp/ccids/ccid2.c | 23 | ||||
-rw-r--r-- | net/dccp/ccids/ccid2.h | 4 |
2 files changed, 21 insertions, 6 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index 9c5b6c73f7c9..a901202ada64 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
@@ -224,8 +224,6 @@ static void ccid2_hc_tx_rto_expire(unsigned long data) | |||
224 | hctx->ccid2hctx_sent = 0; | 224 | hctx->ccid2hctx_sent = 0; |
225 | 225 | ||
226 | /* clear ack ratio state. */ | 226 | /* clear ack ratio state. */ |
227 | hctx->ccid2hctx_arsent = 0; | ||
228 | hctx->ccid2hctx_ackloss = 0; | ||
229 | hctx->ccid2hctx_rpseq = 0; | 227 | hctx->ccid2hctx_rpseq = 0; |
230 | hctx->ccid2hctx_rpdupack = -1; | 228 | hctx->ccid2hctx_rpdupack = -1; |
231 | ccid2_change_l_ack_ratio(sk, 1); | 229 | ccid2_change_l_ack_ratio(sk, 1); |
@@ -289,6 +287,26 @@ static void ccid2_hc_tx_packet_sent(struct sock *sk, int more, unsigned int len) | |||
289 | 287 | ||
290 | hctx->ccid2hctx_sent++; | 288 | hctx->ccid2hctx_sent++; |
291 | 289 | ||
290 | /* | ||
291 | * FIXME: The code below is broken and the variables have been removed | ||
292 | * from the socket struct. The `ackloss' variable was always set to 0, | ||
293 | * and with arsent there are several problems: | ||
294 | * (i) it doesn't just count the number of Acks, but all sent packets; | ||
295 | * (ii) it is expressed in # of packets, not # of windows, so the | ||
296 | * comparison below uses the wrong formula: Appendix A of RFC 4341 | ||
297 | * comes up with the number K = cwnd / (R^2 - R) of consecutive windows | ||
298 | * of data with no lost or marked Ack packets. If arsent were the # of | ||
299 | * consecutive Acks received without loss, then Ack Ratio needs to be | ||
300 | * decreased by 1 when | ||
301 | * arsent >= K * cwnd / R = cwnd^2 / (R^3 - R^2) | ||
302 | * where cwnd / R is the number of Acks received per window of data | ||
303 | * (cf. RFC 4341, App. A). The problems are that | ||
304 | * - arsent counts other packets as well; | ||
305 | * - the comparison uses a formula different from RFC 4341; | ||
306 | * - computing a cubic/quadratic equation each time is too complicated. | ||
307 | * Hence a different algorithm is needed. | ||
308 | */ | ||
309 | #if 0 | ||
292 | /* Ack Ratio. Need to maintain a concept of how many windows we sent */ | 310 | /* Ack Ratio. Need to maintain a concept of how many windows we sent */ |
293 | hctx->ccid2hctx_arsent++; | 311 | hctx->ccid2hctx_arsent++; |
294 | /* We had an ack loss in this window... */ | 312 | /* We had an ack loss in this window... */ |
@@ -316,6 +334,7 @@ static void ccid2_hc_tx_packet_sent(struct sock *sk, int more, unsigned int len) | |||
316 | hctx->ccid2hctx_arsent = 0; /* or maybe set it to cwnd*/ | 334 | hctx->ccid2hctx_arsent = 0; /* or maybe set it to cwnd*/ |
317 | } | 335 | } |
318 | } | 336 | } |
337 | #endif | ||
319 | 338 | ||
320 | /* setup RTO timer */ | 339 | /* setup RTO timer */ |
321 | if (!timer_pending(&hctx->ccid2hctx_rtotimer)) | 340 | if (!timer_pending(&hctx->ccid2hctx_rtotimer)) |
diff --git a/net/dccp/ccids/ccid2.h b/net/dccp/ccids/ccid2.h index d9daa534c9be..ed95f8f0cc4a 100644 --- a/net/dccp/ccids/ccid2.h +++ b/net/dccp/ccids/ccid2.h | |||
@@ -44,8 +44,6 @@ struct ccid2_seq { | |||
44 | * @ccid2hctx_acks - ACKS recv in AI phase | 44 | * @ccid2hctx_acks - ACKS recv in AI phase |
45 | * @ccid2hctx_sent - packets sent in this window | 45 | * @ccid2hctx_sent - packets sent in this window |
46 | * @ccid2hctx_lastrtt -time RTT was last measured | 46 | * @ccid2hctx_lastrtt -time RTT was last measured |
47 | * @ccid2hctx_arsent - packets sent [ack ratio] | ||
48 | * @ccid2hctx_ackloss - ack was lost in this win | ||
49 | * @ccid2hctx_rpseq - last consecutive seqno | 47 | * @ccid2hctx_rpseq - last consecutive seqno |
50 | * @ccid2hctx_rpdupack - dupacks since rpseq | 48 | * @ccid2hctx_rpdupack - dupacks since rpseq |
51 | */ | 49 | */ |
@@ -66,8 +64,6 @@ struct ccid2_hc_tx_sock { | |||
66 | int ccid2hctx_sent; | 64 | int ccid2hctx_sent; |
67 | unsigned long ccid2hctx_lastrtt; | 65 | unsigned long ccid2hctx_lastrtt; |
68 | struct timer_list ccid2hctx_rtotimer; | 66 | struct timer_list ccid2hctx_rtotimer; |
69 | unsigned long ccid2hctx_arsent; | ||
70 | int ccid2hctx_ackloss; | ||
71 | u64 ccid2hctx_rpseq; | 67 | u64 ccid2hctx_rpseq; |
72 | int ccid2hctx_rpdupack; | 68 | int ccid2hctx_rpdupack; |
73 | int ccid2hctx_sendwait; | 69 | int ccid2hctx_sendwait; |