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

Function bbr_update_rsm

freebsd/netinet/tcp_stacks/bbr.c:5339–5426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5337}
5338
5339static void
5340bbr_update_rsm(struct tcpcb *tp, struct tcp_bbr *bbr,
5341 struct bbr_sendmap *rsm, uint32_t cts, uint32_t pacing_time)
5342{
5343 int32_t idx;
5344
5345 rsm->r_rtr_cnt++;
5346 rsm->r_dupack = 0;
5347 if (rsm->r_rtr_cnt > BBR_NUM_OF_RETRANS) {
5348 rsm->r_rtr_cnt = BBR_NUM_OF_RETRANS;
5349 rsm->r_flags |= BBR_OVERMAX;
5350 }
5351 if (rsm->r_flags & BBR_RWND_COLLAPSED) {
5352 /* Take off the collapsed flag at rxt */
5353 rsm->r_flags &= ~BBR_RWND_COLLAPSED;
5354 }
5355 if (rsm->r_flags & BBR_MARKED_LOST) {
5356 /* We have retransmitted, its no longer lost */
5357 rsm->r_flags &= ~BBR_MARKED_LOST;
5358 bbr->r_ctl.rc_lost_bytes -= rsm->r_end - rsm->r_start;
5359 }
5360 if (rsm->r_flags & BBR_RXT_CLEARED) {
5361 /*
5362 * We hit a RXT timer on it and
5363 * we cleared the "acked" flag.
5364 * We now have it going back into
5365 * flight, we can remove the cleared
5366 * flag and possibly do accounting on
5367 * this piece.
5368 */
5369 rsm->r_flags &= ~BBR_RXT_CLEARED;
5370 }
5371 if ((rsm->r_rtr_cnt > 1) && ((rsm->r_flags & BBR_TLP) == 0)) {
5372 bbr->r_ctl.rc_holes_rxt += (rsm->r_end - rsm->r_start);
5373 rsm->r_rtr_bytes += (rsm->r_end - rsm->r_start);
5374 }
5375 idx = rsm->r_rtr_cnt - 1;
5376 rsm->r_tim_lastsent[idx] = cts;
5377 rsm->r_pacing_delay = pacing_time;
5378 rsm->r_delivered = bbr->r_ctl.rc_delivered;
5379 rsm->r_ts_valid = bbr->rc_ts_valid;
5380 if (bbr->rc_ts_valid)
5381 rsm->r_del_ack_ts = bbr->r_ctl.last_inbound_ts;
5382 if (bbr->r_ctl.r_app_limited_until)
5383 rsm->r_app_limited = 1;
5384 else
5385 rsm->r_app_limited = 0;
5386 if (bbr->rc_bbr_state == BBR_STATE_PROBE_BW)
5387 rsm->r_bbr_state = bbr_state_val(bbr);
5388 else
5389 rsm->r_bbr_state = 8;
5390 if (rsm->r_flags & BBR_ACKED) {
5391 /* Problably MTU discovery messing with us */
5392 uint32_t old_flags;
5393
5394 old_flags = rsm->r_flags;
5395 rsm->r_flags &= ~BBR_ACKED;
5396 bbr_log_type_rsmclear(bbr, cts, rsm, old_flags, __LINE__);

Callers 2

bbr_update_entryFunction · 0.85
bbr_log_outputFunction · 0.85

Calls 4

bbr_state_valFunction · 0.85
bbr_log_type_rsmclearFunction · 0.85
ctf_flight_sizeFunction · 0.85

Tested by

no test coverage detected