| 2461 | } |
| 2462 | |
| 2463 | static int |
| 2464 | rack_bw_can_be_raised(struct tcp_rack *rack, uint64_t cur_bw, uint64_t last_bw_est, uint16_t mult) |
| 2465 | { |
| 2466 | /* |
| 2467 | * Before we increase we need to know if |
| 2468 | * the estimate just made was less than |
| 2469 | * our pacing goal (i.e. (cur_bw * mult) > last_bw_est) |
| 2470 | * |
| 2471 | * If we already are pacing at a fast enough |
| 2472 | * rate to push us faster there is no sense of |
| 2473 | * increasing. |
| 2474 | * |
| 2475 | * We first caculate our actual pacing rate (ss or ca multipler |
| 2476 | * times our cur_bw). |
| 2477 | * |
| 2478 | * Then we take the last measured rate and multipy by our |
| 2479 | * maximum pacing overage to give us a max allowable rate. |
| 2480 | * |
| 2481 | * If our act_rate is smaller than our max_allowable rate |
| 2482 | * then we should increase. Else we should hold steady. |
| 2483 | * |
| 2484 | */ |
| 2485 | uint64_t act_rate, max_allow_rate; |
| 2486 | |
| 2487 | if (rack_timely_no_stopping) |
| 2488 | return (1); |
| 2489 | |
| 2490 | if ((cur_bw == 0) || (last_bw_est == 0)) { |
| 2491 | /* |
| 2492 | * Initial startup case or |
| 2493 | * everything is acked case. |
| 2494 | */ |
| 2495 | rack_log_timely(rack, mult, cur_bw, 0, 0, |
| 2496 | __LINE__, 9); |
| 2497 | return (1); |
| 2498 | } |
| 2499 | if (mult <= 100) { |
| 2500 | /* |
| 2501 | * We can always pace at or slightly above our rate. |
| 2502 | */ |
| 2503 | rack_log_timely(rack, mult, cur_bw, 0, 0, |
| 2504 | __LINE__, 9); |
| 2505 | return (1); |
| 2506 | } |
| 2507 | act_rate = cur_bw * (uint64_t)mult; |
| 2508 | act_rate /= 100; |
| 2509 | max_allow_rate = last_bw_est * ((uint64_t)rack_max_per_above + (uint64_t)100); |
| 2510 | max_allow_rate /= 100; |
| 2511 | if (act_rate < max_allow_rate) { |
| 2512 | /* |
| 2513 | * Here the rate we are actually pacing at |
| 2514 | * is smaller than 10% above our last measurement. |
| 2515 | * This means we are pacing below what we would |
| 2516 | * like to try to achieve (plus some wiggle room). |
| 2517 | */ |
| 2518 | rack_log_timely(rack, mult, cur_bw, act_rate, max_allow_rate, |
| 2519 | __LINE__, 9); |
| 2520 | return (1); |
no test coverage detected