diff options
Diffstat (limited to 'net/dccp/ccids/ccid2.c')
-rw-r--r-- | net/dccp/ccids/ccid2.c | 23 |
1 files changed, 21 insertions, 2 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)) |