| 10845 | } |
| 10846 | |
| 10847 | static void |
| 10848 | bbr_check_probe_rtt_limits(struct tcp_bbr *bbr, uint32_t cts) |
| 10849 | { |
| 10850 | /* |
| 10851 | * Sanity check on probe-rtt intervals. |
| 10852 | * In crazy situations where we are competing |
| 10853 | * against new-reno flows with huge buffers |
| 10854 | * our rtt-prop interval could come to dominate |
| 10855 | * things if we can't get through a full set |
| 10856 | * of cycles, we need to adjust it. |
| 10857 | */ |
| 10858 | if (bbr_can_adjust_probertt && |
| 10859 | (bbr->rc_use_google == 0)) { |
| 10860 | uint16_t val = 0; |
| 10861 | uint32_t cur_rttp, fval, newval, baseval; |
| 10862 | |
| 10863 | /* Are we to small and go into probe-rtt to often? */ |
| 10864 | baseval = (bbr_get_rtt(bbr, BBR_RTT_PROP) * (BBR_SUBSTATE_COUNT + 1)); |
| 10865 | cur_rttp = roundup(baseval, USECS_IN_SECOND); |
| 10866 | fval = bbr_filter_len_sec * USECS_IN_SECOND; |
| 10867 | if (bbr_is_ratio == 0) { |
| 10868 | if (fval > bbr_rtt_probe_limit) |
| 10869 | newval = cur_rttp + (fval - bbr_rtt_probe_limit); |
| 10870 | else |
| 10871 | newval = cur_rttp; |
| 10872 | } else { |
| 10873 | int mul; |
| 10874 | |
| 10875 | mul = fval / bbr_rtt_probe_limit; |
| 10876 | newval = cur_rttp * mul; |
| 10877 | } |
| 10878 | if (cur_rttp > bbr->r_ctl.rc_probertt_int) { |
| 10879 | bbr->r_ctl.rc_probertt_int = cur_rttp; |
| 10880 | reset_time_small(&bbr->r_ctl.rc_rttprop, newval); |
| 10881 | val = 1; |
| 10882 | } else { |
| 10883 | /* |
| 10884 | * No adjustments were made |
| 10885 | * do we need to shrink it? |
| 10886 | */ |
| 10887 | if (bbr->r_ctl.rc_probertt_int > bbr_rtt_probe_limit) { |
| 10888 | if (cur_rttp <= bbr_rtt_probe_limit) { |
| 10889 | /* |
| 10890 | * Things have calmed down lets |
| 10891 | * shrink all the way to default |
| 10892 | */ |
| 10893 | bbr->r_ctl.rc_probertt_int = bbr_rtt_probe_limit; |
| 10894 | reset_time_small(&bbr->r_ctl.rc_rttprop, |
| 10895 | (bbr_filter_len_sec * USECS_IN_SECOND)); |
| 10896 | cur_rttp = bbr_rtt_probe_limit; |
| 10897 | newval = (bbr_filter_len_sec * USECS_IN_SECOND); |
| 10898 | val = 2; |
| 10899 | } else { |
| 10900 | /* |
| 10901 | * Well does some adjustment make sense? |
| 10902 | */ |
| 10903 | if (cur_rttp < bbr->r_ctl.rc_probertt_int) { |
| 10904 | /* We can reduce interval time some */ |
no test coverage detected