MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rack_increase_bw_mul

Function rack_increase_bw_mul

freebsd/netinet/tcp_stacks/rack.c:2567–2656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2565}
2566
2567static void
2568rack_increase_bw_mul(struct tcp_rack *rack, int timely_says, uint64_t cur_bw, uint64_t last_bw_est, int override)
2569{
2570 int32_t calc, logged, plus;
2571
2572 logged = 0;
2573
2574 if (override) {
2575 /*
2576 * override is passed when we are
2577 * loosing b/w and making one last
2578 * gasp at trying to not loose out
2579 * to a new-reno flow.
2580 */
2581 goto extra_boost;
2582 }
2583 /* In classic timely we boost by 5x if we have 5 increases in a row, lets not */
2584 if (rack->rc_gp_incr &&
2585 ((rack->rc_gp_timely_inc_cnt + 1) >= RACK_TIMELY_CNT_BOOST)) {
2586 /*
2587 * Reset and get 5 strokes more before the boost. Note
2588 * that the count is 0 based so we have to add one.
2589 */
2590extra_boost:
2591 plus = (uint32_t)rack_gp_increase_per * RACK_TIMELY_CNT_BOOST;
2592 rack->rc_gp_timely_inc_cnt = 0;
2593 } else
2594 plus = (uint32_t)rack_gp_increase_per;
2595 /* Must be at least 1% increase for true timely increases */
2596 if ((plus < 1) &&
2597 ((rack->r_ctl.rc_rtt_diff <= 0) || (timely_says <= 0)))
2598 plus = 1;
2599 if (rack->rc_gp_saw_rec &&
2600 (rack->rc_gp_no_rec_chg == 0) &&
2601 rack_bw_can_be_raised(rack, cur_bw, last_bw_est,
2602 rack->r_ctl.rack_per_of_gp_rec)) {
2603 /* We have been in recovery ding it too */
2604 calc = rack->r_ctl.rack_per_of_gp_rec + plus;
2605 if (calc > 0xffff)
2606 calc = 0xffff;
2607 logged |= 1;
2608 rack->r_ctl.rack_per_of_gp_rec = (uint16_t)calc;
2609 if (rack_per_upper_bound_ss &&
2610 (rack->rc_dragged_bottom == 0) &&
2611 (rack->r_ctl.rack_per_of_gp_rec > rack_per_upper_bound_ss))
2612 rack->r_ctl.rack_per_of_gp_rec = rack_per_upper_bound_ss;
2613 }
2614 if (rack->rc_gp_saw_ca &&
2615 (rack->rc_gp_saw_ss == 0) &&
2616 rack_bw_can_be_raised(rack, cur_bw, last_bw_est,
2617 rack->r_ctl.rack_per_of_gp_ca)) {
2618 /* In CA */
2619 calc = rack->r_ctl.rack_per_of_gp_ca + plus;
2620 if (calc > 0xffff)
2621 calc = 0xffff;
2622 logged |= 2;
2623 rack->r_ctl.rack_per_of_gp_ca = (uint16_t)calc;
2624 if (rack_per_upper_bound_ca &&

Callers 2

rack_update_multiplierFunction · 0.85
rack_check_bottom_dragFunction · 0.85

Calls 2

rack_bw_can_be_raisedFunction · 0.85
rack_log_timelyFunction · 0.85

Tested by

no test coverage detected