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

Function rack_timer_audit

freebsd/netinet/tcp_stacks/rack.c:10664–10745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10662}
10663
10664static void
10665rack_timer_audit(struct tcpcb *tp, struct tcp_rack *rack, struct sockbuf *sb)
10666{
10667 /*
10668 * We received an ack, and then did not
10669 * call send or were bounced out due to the
10670 * hpts was running. Now a timer is up as well, is
10671 * it the right timer?
10672 */
10673 struct rack_sendmap *rsm;
10674 int tmr_up;
10675
10676 tmr_up = rack->r_ctl.rc_hpts_flags & PACE_TMR_MASK;
10677 if (rack->rc_in_persist && (tmr_up == PACE_TMR_PERSIT))
10678 return;
10679 rsm = TAILQ_FIRST(&rack->r_ctl.rc_tmap);
10680 if (((rsm == NULL) || (tp->t_state < TCPS_ESTABLISHED)) &&
10681 (tmr_up == PACE_TMR_RXT)) {
10682 /* Should be an RXT */
10683 return;
10684 }
10685 if (rsm == NULL) {
10686 /* Nothing outstanding? */
10687 if (tp->t_flags & TF_DELACK) {
10688 if (tmr_up == PACE_TMR_DELACK)
10689 /* We are supposed to have delayed ack up and we do */
10690 return;
10691 } else if (sbavail(&tp->t_inpcb->inp_socket->so_snd) && (tmr_up == PACE_TMR_RXT)) {
10692 /*
10693 * if we hit enobufs then we would expect the possiblity
10694 * of nothing outstanding and the RXT up (and the hptsi timer).
10695 */
10696 return;
10697 } else if (((V_tcp_always_keepalive ||
10698 rack->rc_inp->inp_socket->so_options & SO_KEEPALIVE) &&
10699 (tp->t_state <= TCPS_CLOSING)) &&
10700 (tmr_up == PACE_TMR_KEEP) &&
10701 (tp->snd_max == tp->snd_una)) {
10702 /* We should have keep alive up and we do */
10703 return;
10704 }
10705 }
10706 if (SEQ_GT(tp->snd_max, tp->snd_una) &&
10707 ((tmr_up == PACE_TMR_TLP) ||
10708 (tmr_up == PACE_TMR_RACK) ||
10709 (tmr_up == PACE_TMR_RXT))) {
10710 /*
10711 * Either a Rack, TLP or RXT is fine if we
10712 * have outstanding data.
10713 */
10714 return;
10715 } else if (tmr_up == PACE_TMR_DELACK) {
10716 /*
10717 * If the delayed ack was going to go off
10718 * before the rtx/tlp/rack timer were going to
10719 * expire, then that would be the timer in control.
10720 * Note we don't check the time here trusting the
10721 * code is correct.

Callers 1

rack_do_segment_nounlockFunction · 0.85

Calls 5

tcp_get_usecsFunction · 0.85
rack_timer_cancelFunction · 0.85
rack_start_hpts_timerFunction · 0.85
sbavailFunction · 0.50
tcp_ts_getticksFunction · 0.50

Tested by

no test coverage detected