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

Function bbr_get_target_cwnd

freebsd/netinet/tcp_stacks/bbr.c:3462–3496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3460}
3461
3462static uint32_t
3463bbr_get_target_cwnd(struct tcp_bbr *bbr, uint64_t bw, uint32_t gain)
3464{
3465 uint32_t cwnd, mss;
3466
3467 mss = min((bbr->rc_tp->t_maxseg - bbr->rc_last_options), bbr->r_ctl.rc_pace_max_segs);
3468 /* Get the base cwnd with gain rounded to a mss */
3469 cwnd = roundup(bbr_get_raw_target_cwnd(bbr, bw, gain), mss);
3470 /*
3471 * Add in N (2 default since we do not have a
3472 * fq layer to trap packets in) quanta's per the I-D
3473 * section 4.2.3.2 quanta adjust.
3474 */
3475 cwnd += (bbr_quanta * bbr->r_ctl.rc_pace_max_segs);
3476 if (bbr->rc_use_google) {
3477 if((bbr->rc_bbr_state == BBR_STATE_PROBE_BW) &&
3478 (bbr_state_val(bbr) == BBR_SUB_GAIN)) {
3479 /*
3480 * The linux implementation adds
3481 * an extra 2 x mss in gain cycle which
3482 * is documented no-where except in the code.
3483 * so we add more for Neal undocumented feature
3484 */
3485 cwnd += 2 * mss;
3486 }
3487 if ((cwnd / mss) & 0x1) {
3488 /* Round up for odd num mss */
3489 cwnd += mss;
3490 }
3491 }
3492 /* Are we below the min cwnd? */
3493 if (cwnd < get_min_cwnd(bbr))
3494 return (get_min_cwnd(bbr));
3495 return (cwnd);
3496}
3497
3498static uint16_t
3499bbr_gain_adjust(struct tcp_bbr *bbr, uint16_t gain)

Callers 3

bbr_ack_receivedFunction · 0.85
bbr_get_a_state_targetFunction · 0.85
bbr_cwnd_limitingFunction · 0.85

Calls 4

minFunction · 0.85
bbr_get_raw_target_cwndFunction · 0.85
bbr_state_valFunction · 0.85
get_min_cwndFunction · 0.85

Tested by

no test coverage detected