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

Function tcp_rack_xmit_timer

freebsd/netinet/tcp_stacks/rack.c:6316–6379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6314 */
6315
6316static void
6317tcp_rack_xmit_timer(struct tcp_rack *rack, int32_t rtt, uint32_t len, uint32_t us_rtt,
6318 int confidence, struct rack_sendmap *rsm, uint16_t rtrcnt)
6319{
6320 if ((rack->r_ctl.rack_rs.rs_flags & RACK_RTT_EMPTY) ||
6321 (rack->r_ctl.rack_rs.rs_rtt_lowest > rtt)) {
6322 rack->r_ctl.rack_rs.rs_rtt_lowest = rtt;
6323 }
6324 if ((rack->r_ctl.rack_rs.rs_flags & RACK_RTT_EMPTY) ||
6325 (rack->r_ctl.rack_rs.rs_rtt_highest < rtt)) {
6326 rack->r_ctl.rack_rs.rs_rtt_highest = rtt;
6327 }
6328 if (rack->rc_tp->t_flags & TF_GPUTINPROG) {
6329 if (us_rtt < rack->r_ctl.rc_gp_lowrtt)
6330 rack->r_ctl.rc_gp_lowrtt = us_rtt;
6331 if (rack->rc_tp->snd_wnd > rack->r_ctl.rc_gp_high_rwnd)
6332 rack->r_ctl.rc_gp_high_rwnd = rack->rc_tp->snd_wnd;
6333 }
6334 if ((confidence == 1) &&
6335 ((rsm == NULL) ||
6336 (rsm->r_just_ret) ||
6337 (rsm->r_one_out_nr &&
6338 len < (ctf_fixed_maxseg(rack->rc_tp) * 2)))) {
6339 /*
6340 * If the rsm had a just return
6341 * hit it then we can't trust the
6342 * rtt measurement for buffer deterimination
6343 * Note that a confidence of 2, indicates
6344 * SACK'd which overrides the r_just_ret or
6345 * the r_one_out_nr. If it was a CUM-ACK and
6346 * we had only two outstanding, but get an
6347 * ack for only 1. Then that also lowers our
6348 * confidence.
6349 */
6350 confidence = 0;
6351 }
6352 if ((rack->r_ctl.rack_rs.rs_flags & RACK_RTT_EMPTY) ||
6353 (rack->r_ctl.rack_rs.rs_us_rtt > us_rtt)) {
6354 if (rack->r_ctl.rack_rs.confidence == 0) {
6355 /*
6356 * We take anything with no current confidence
6357 * saved.
6358 */
6359 rack->r_ctl.rack_rs.rs_us_rtt = us_rtt;
6360 rack->r_ctl.rack_rs.confidence = confidence;
6361 rack->r_ctl.rack_rs.rs_us_rtrcnt = rtrcnt;
6362 } else if (confidence || rack->r_ctl.rack_rs.confidence) {
6363 /*
6364 * Once we have a confident number,
6365 * we can update it with a smaller
6366 * value since this confident number
6367 * may include the DSACK time until
6368 * the next segment (the second one) arrived.
6369 */
6370 rack->r_ctl.rack_rs.rs_us_rtt = us_rtt;
6371 rack->r_ctl.rack_rs.confidence = confidence;
6372 rack->r_ctl.rack_rs.rs_us_rtrcnt = rtrcnt;
6373 }

Callers 3

rack_update_rttFunction · 0.85
rack_do_syn_sentFunction · 0.85
rack_do_syn_recvFunction · 0.85

Calls 2

ctf_fixed_maxsegFunction · 0.85
rack_log_rtt_updFunction · 0.85

Tested by

no test coverage detected