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

Function bbr_timer_audit

freebsd/netinet/tcp_stacks/bbr.c:960–1093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

958}
959
960static void
961bbr_timer_audit(struct tcpcb *tp, struct tcp_bbr *bbr, uint32_t cts, struct sockbuf *sb)
962{
963 /*
964 * We received an ack, and then did not call send or were bounced
965 * out due to the hpts was running. Now a timer is up as well, is it
966 * the right timer?
967 */
968 struct inpcb *inp;
969 struct bbr_sendmap *rsm;
970 uint32_t hpts_timeout;
971 int tmr_up;
972
973 tmr_up = bbr->r_ctl.rc_hpts_flags & PACE_TMR_MASK;
974 if (bbr->rc_in_persist && (tmr_up == PACE_TMR_PERSIT))
975 return;
976 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_tmap);
977 if (((rsm == NULL) || (tp->t_state < TCPS_ESTABLISHED)) &&
978 (tmr_up == PACE_TMR_RXT)) {
979 /* Should be an RXT */
980 return;
981 }
982 inp = bbr->rc_inp;
983 if (rsm == NULL) {
984 /* Nothing outstanding? */
985 if (tp->t_flags & TF_DELACK) {
986 if (tmr_up == PACE_TMR_DELACK)
987 /*
988 * We are supposed to have delayed ack up
989 * and we do
990 */
991 return;
992 } else if (sbavail(&inp->inp_socket->so_snd) &&
993 (tmr_up == PACE_TMR_RXT)) {
994 /*
995 * if we hit enobufs then we would expect the
996 * possiblity of nothing outstanding and the RXT up
997 * (and the hptsi timer).
998 */
999 return;
1000 } else if (((V_tcp_always_keepalive ||
1001 inp->inp_socket->so_options & SO_KEEPALIVE) &&
1002 (tp->t_state <= TCPS_CLOSING)) &&
1003 (tmr_up == PACE_TMR_KEEP) &&
1004 (tp->snd_max == tp->snd_una)) {
1005 /* We should have keep alive up and we do */
1006 return;
1007 }
1008 }
1009 if (rsm && (rsm->r_flags & BBR_SACK_PASSED)) {
1010 if ((tp->t_flags & TF_SENTFIN) &&
1011 ((tp->snd_max - tp->snd_una) == 1) &&
1012 (rsm->r_flags & BBR_HAS_FIN)) {
1013 /* needs to be a RXT */
1014 if (tmr_up == PACE_TMR_RXT)
1015 return;
1016 else
1017 goto wrong_timer;

Callers 1

bbr_do_segment_nounlockFunction · 0.85

Calls 4

bbr_timer_cancelFunction · 0.85
bbr_start_hpts_timerFunction · 0.85
bbr_timer_startFunction · 0.85
sbavailFunction · 0.50

Tested by

no test coverage detected