* Window increase function * This window increase function is independent of the initial window size * to ensure small window flows are not discriminated against (i.e. fairness). * It increases at 1pkt/rtt like Reno for alpha_inc rtts, and then 2pkts/rtt for * the next alpha_inc rtts, etc. */
| 404 | * the next alpha_inc rtts, etc. |
| 405 | */ |
| 406 | static void |
| 407 | cdg_window_increase(struct cc_var *ccv, int new_measurement) |
| 408 | { |
| 409 | struct cdg *cdg_data; |
| 410 | int incr, s_w_incr; |
| 411 | |
| 412 | cdg_data = ccv->cc_data; |
| 413 | incr = s_w_incr = 0; |
| 414 | |
| 415 | if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)) { |
| 416 | /* Slow start. */ |
| 417 | incr = CCV(ccv, t_maxseg); |
| 418 | s_w_incr = incr; |
| 419 | cdg_data->window_incr = cdg_data->rtt_count = 0; |
| 420 | } else { |
| 421 | /* Congestion avoidance. */ |
| 422 | if (new_measurement) { |
| 423 | s_w_incr = CCV(ccv, t_maxseg); |
| 424 | if (V_cdg_alpha_inc == 0) { |
| 425 | incr = CCV(ccv, t_maxseg); |
| 426 | } else { |
| 427 | if (++cdg_data->rtt_count >= V_cdg_alpha_inc) { |
| 428 | cdg_data->window_incr++; |
| 429 | cdg_data->rtt_count = 0; |
| 430 | } |
| 431 | incr = CCV(ccv, t_maxseg) * |
| 432 | cdg_data->window_incr; |
| 433 | } |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | if (cdg_data->shadow_w > 0) |
| 438 | cdg_data->shadow_w = ulmin(cdg_data->shadow_w + s_w_incr, |
| 439 | TCP_MAXWIN << CCV(ccv, snd_scale)); |
| 440 | |
| 441 | CCV(ccv, snd_cwnd) = ulmin(CCV(ccv, snd_cwnd) + incr, |
| 442 | TCP_MAXWIN << CCV(ccv, snd_scale)); |
| 443 | } |
| 444 | |
| 445 | static void |
| 446 | cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type) |
no test coverage detected