* Return the initial cwnd. */
| 3407 | * Return the initial cwnd. |
| 3408 | */ |
| 3409 | static uint32_t |
| 3410 | bbr_initial_cwnd(struct tcp_bbr *bbr, struct tcpcb *tp) |
| 3411 | { |
| 3412 | uint32_t i_cwnd; |
| 3413 | |
| 3414 | if (bbr->rc_init_win) { |
| 3415 | i_cwnd = bbr->rc_init_win * tp->t_maxseg; |
| 3416 | } else if (V_tcp_initcwnd_segments) |
| 3417 | i_cwnd = min((V_tcp_initcwnd_segments * tp->t_maxseg), |
| 3418 | max(2 * tp->t_maxseg, 14600)); |
| 3419 | else if (V_tcp_do_rfc3390) |
| 3420 | i_cwnd = min(4 * tp->t_maxseg, |
| 3421 | max(2 * tp->t_maxseg, 4380)); |
| 3422 | else { |
| 3423 | /* Per RFC5681 Section 3.1 */ |
| 3424 | if (tp->t_maxseg > 2190) |
| 3425 | i_cwnd = 2 * tp->t_maxseg; |
| 3426 | else if (tp->t_maxseg > 1095) |
| 3427 | i_cwnd = 3 * tp->t_maxseg; |
| 3428 | else |
| 3429 | i_cwnd = 4 * tp->t_maxseg; |
| 3430 | } |
| 3431 | return (i_cwnd); |
| 3432 | } |
| 3433 | |
| 3434 | /* |
| 3435 | * Given a specified gain, return the target |
no test coverage detected