Lines Matching refs:tp

141 #define TCP_XMIT_TIMER_ASSERT(tp, len, th_flags)			\  argument
143 tcp_timer_active((tp), TT_REXMT) || \
144 tcp_timer_active((tp), TT_PERSIST), \
152 hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th, in hhook_run_tcp_est_out() argument
158 hhook_data.tp = tp; in hhook_run_tcp_est_out()
165 &tp->t_osd); in hhook_run_tcp_est_out()
174 cc_after_idle(struct tcpcb *tp) in cc_after_idle() argument
176 INP_WLOCK_ASSERT(tptoinpcb(tp)); in cc_after_idle()
178 if (CC_ALGO(tp)->after_idle != NULL) in cc_after_idle()
179 CC_ALGO(tp)->after_idle(&tp->t_ccv); in cc_after_idle()
186 tcp_default_output(struct tcpcb *tp) in tcp_default_output() argument
188 struct socket *so = tptosocket(tp); in tcp_default_output()
189 struct inpcb *inp = tptoinpcb(tp); in tcp_default_output()
217 const bool hw_tls = tp->t_nic_ktls_xmit != 0; in tcp_default_output()
226 if (tp->t_flags & TF_TOE) in tcp_default_output()
227 return (tcp_offload_output(tp)); in tcp_default_output()
235 if ((tp->t_flags & TF_FASTOPEN) && in tcp_default_output()
236 ((tp->t_state == TCPS_SYN_SENT) || in tcp_default_output()
237 (tp->t_state == TCPS_SYN_RECEIVED)) && in tcp_default_output()
238 SEQ_GT(tp->snd_max, tp->snd_una) && /* SYN or SYN|ACK sent */ in tcp_default_output()
239 (tp->snd_nxt != tp->snd_una)) /* not a retransmit */ in tcp_default_output()
248 idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una); in tcp_default_output()
249 if (idle && (((ticks - tp->t_rcvtime) >= tp->t_rxtcur) || in tcp_default_output()
250 (tp->t_sndtime && ((ticks - tp->t_sndtime) >= tp->t_rxtcur)))) in tcp_default_output()
251 cc_after_idle(tp); in tcp_default_output()
252 tp->t_flags &= ~TF_LASTIDLE; in tcp_default_output()
254 if (tp->t_flags & TF_MORETOCOME) { in tcp_default_output()
255 tp->t_flags |= TF_LASTIDLE; in tcp_default_output()
266 if ((tp->t_flags & TF_SACK_PERMIT) && in tcp_default_output()
267 (tp->sackhint.nexthole != NULL) && in tcp_default_output()
268 !IN_FASTRECOVERY(tp->t_flags)) { in tcp_default_output()
269 sendwin = tcp_sack_adjust(tp); in tcp_default_output()
274 off = tp->snd_nxt - tp->snd_una; in tcp_default_output()
275 sendwin = min(tp->snd_wnd, tp->snd_cwnd + sendwin); in tcp_default_output()
277 flags = tcp_outflags[tp->t_state]; in tcp_default_output()
290 if ((tp->t_flags & TF_SACK_PERMIT) && in tcp_default_output()
291 (IN_FASTRECOVERY(tp->t_flags) || in tcp_default_output()
292 (SEQ_LT(tp->snd_nxt, tp->snd_max) && (tp->t_dupacks >= tcprexmtthresh))) && in tcp_default_output()
293 (p = tcp_sack_output(tp, &sack_bytes_rxmt))) { in tcp_default_output()
296 if (IN_FASTRECOVERY(tp->t_flags)) { in tcp_default_output()
297 cwin = imax(sendwin - tcp_compute_pipe(tp), 0); in tcp_default_output()
302 if (SEQ_GT(p->end, tp->snd_recover)) { in tcp_default_output()
308 if (SEQ_GEQ(p->rxmit, tp->snd_recover)) { in tcp_default_output()
320 len = SEQ_SUB(tp->snd_recover, p->rxmit); in tcp_default_output()
344 off = SEQ_SUB(p->rxmit, tp->snd_una); in tcp_default_output()
358 if (tp->t_flags & TF_NEEDFIN) in tcp_default_output()
360 if (tp->t_flags & TF_NEEDSYN) in tcp_default_output()
370 if (tp->t_flags & TF_FORCEDATA) { in tcp_default_output()
392 tcp_timer_activate(tp, TT_PERSIST, 0); in tcp_default_output()
393 tp->t_rxtshift = 0; in tcp_default_output()
413 if ((sack_bytes_rxmt == 0) || SEQ_LT(tp->snd_nxt, tp->snd_max)) { in tcp_default_output()
423 imax(tcp_compute_pipe(tp), off), 0); in tcp_default_output()
432 if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una)) { in tcp_default_output()
433 if (tp->t_state != TCPS_SYN_RECEIVED) in tcp_default_output()
439 if ((tp->t_flags & TF_FASTOPEN) && in tcp_default_output()
440 (tp->t_state == TCPS_SYN_RECEIVED)) in tcp_default_output()
450 if ((flags & TH_SYN) && (tp->t_flags & TF_NOOPT)) { in tcp_default_output()
467 if ((tp->t_flags & TF_FASTOPEN) && in tcp_default_output()
468 (((flags & TH_SYN) && (tp->t_rxtshift > 0)) || in tcp_default_output()
469 ((tp->t_state == TCPS_SYN_SENT) && in tcp_default_output()
470 (tp->t_tfo_client_cookie_len == 0)) || in tcp_default_output()
475 if ((flags & TH_SYN) && !(tp->t_flags & TF_FASTOPEN)) { in tcp_default_output()
497 if ((sendwin == 0) && (TCPS_HAVEESTABLISHED(tp->t_state)) && in tcp_default_output()
499 !tcp_timer_active(tp, TT_PERSIST)) { in tcp_default_output()
500 tcp_timer_activate(tp, TT_REXMT, 0); in tcp_default_output()
501 tp->t_rxtshift = 0; in tcp_default_output()
502 tp->snd_nxt = tp->snd_una; in tcp_default_output()
503 if (!tcp_timer_active(tp, TT_PERSIST)) in tcp_default_output()
504 tcp_setpersist(tp); in tcp_default_output()
511 tcp_sndbuf_autoscale(tp, so, sendwin); in tcp_default_output()
558 if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg && in tcp_default_output()
559 (tp->t_port == 0) && in tcp_default_output()
560 ((tp->t_flags & TF_SIGNATURE) == 0) && in tcp_default_output()
563 (tp->t_flags2 & TF2_IPSEC_TSO) != 0)) && in tcp_default_output()
567 if (SEQ_LT((sack_rxmit ? p->rxmit : tp->snd_nxt) + len, in tcp_default_output()
568 tp->snd_una + sbused(&so->so_snd))) { in tcp_default_output()
573 (long)TCP_MAXWIN << tp->rcv_scale); in tcp_default_output()
588 if (len >= tp->t_maxseg) in tcp_default_output()
598 if ((((tp->t_flags & TF_SIGNATURE) ? in tcp_default_output()
600 ((tp->t_flags & TF_RCVD_TSTMP) ? in tcp_default_output()
602 len) >= tp->t_maxseg) in tcp_default_output()
611 if (!(tp->t_flags & TF_MORETOCOME) && /* normal case */ in tcp_default_output()
612 (idle || (tp->t_flags & TF_NODELAY)) && in tcp_default_output()
614 (tp->t_flags & TF_NOPUSH) == 0) { in tcp_default_output()
617 if (tp->t_flags & TF_FORCEDATA) /* typ. timeout case */ in tcp_default_output()
619 if (len >= tp->max_sndwnd / 2 && tp->max_sndwnd > 0) in tcp_default_output()
621 if (SEQ_LT(tp->snd_nxt, tp->snd_max)) /* retransmit case */ in tcp_default_output()
655 if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) && in tcp_default_output()
656 !(tp->t_flags & TF_DELACK) && in tcp_default_output()
657 !TCPS_HAVERCVDFIN(tp->t_state)) { in tcp_default_output()
667 if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) { in tcp_default_output()
668 oldwin = (tp->rcv_adv - tp->rcv_nxt); in tcp_default_output()
681 if (oldwin >> tp->rcv_scale >= (adv + oldwin) >> tp->rcv_scale) in tcp_default_output()
684 if (adv >= (int32_t)(2 * tp->t_maxseg) && in tcp_default_output()
687 so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg || in tcp_default_output()
688 adv >= TCP_MAXWIN << tp->rcv_scale)) in tcp_default_output()
699 if (tp->t_flags & TF_ACKNOW) in tcp_default_output()
702 ((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0)) in tcp_default_output()
704 if (SEQ_GT(tp->snd_up, tp->snd_una)) in tcp_default_output()
711 ((tp->t_flags & TF_SENTFIN) == 0 || tp->snd_nxt == tp->snd_una)) in tcp_default_output()
718 if ((tp->t_flags & TF_SACK_PERMIT) && in tcp_default_output()
719 SEQ_GT(tp->snd_max, tp->snd_una) && in tcp_default_output()
720 !tcp_timer_active(tp, TT_REXMT) && in tcp_default_output()
721 !tcp_timer_active(tp, TT_PERSIST)) { in tcp_default_output()
722 tcp_timer_activate(tp, TT_REXMT, TP_RXTCUR(tp)); in tcp_default_output()
747 if (sbavail(&so->so_snd) && !tcp_timer_active(tp, TT_REXMT) && in tcp_default_output()
748 !tcp_timer_active(tp, TT_PERSIST)) { in tcp_default_output()
749 tp->t_rxtshift = 0; in tcp_default_output()
750 tcp_setpersist(tp); in tcp_default_output()
763 if (len >= tp->t_maxseg) in tcp_default_output()
764 tp->t_flags2 |= TF2_PLPMTU_MAXSEGSNT; in tcp_default_output()
766 tp->t_flags2 &= ~TF2_PLPMTU_MAXSEGSNT; in tcp_default_output()
785 tp->snd_nxt = tp->iss; in tcp_default_output()
795 if ((tp->t_flags & TF_NOOPT) == 0) { in tcp_default_output()
799 if (tp->t_port) in tcp_default_output()
810 if ((tp->t_flags & TF_FASTOPEN) && in tcp_default_output()
811 (tp->t_rxtshift == 0)) { in tcp_default_output()
812 if (tp->t_state == TCPS_SYN_RECEIVED) { in tcp_default_output()
815 (u_int8_t *)&tp->t_tfo_cookie.server; in tcp_default_output()
818 } else if (tp->t_state == TCPS_SYN_SENT) { in tcp_default_output()
820 tp->t_tfo_client_cookie_len; in tcp_default_output()
822 tp->t_tfo_cookie.client; in tcp_default_output()
837 if ((flags & TH_SYN) && (tp->t_flags & TF_REQ_SCALE)) { in tcp_default_output()
838 to.to_wscale = tp->request_r_scale; in tcp_default_output()
842 if ((tp->t_flags & TF_RCVD_TSTMP) || in tcp_default_output()
843 ((flags & TH_SYN) && (tp->t_flags & TF_REQ_TSTMP))) { in tcp_default_output()
845 to.to_tsval = curticks + tp->ts_offset; in tcp_default_output()
846 to.to_tsecr = tp->ts_recent; in tcp_default_output()
848 if (tp->t_rxtshift == 1) in tcp_default_output()
849 tp->t_badrxtwin = curticks; in tcp_default_output()
853 if (tp->rfbuf_ts == 0 && in tcp_default_output()
855 tp->rfbuf_ts = tcp_ts_getticks(); in tcp_default_output()
858 if (tp->t_flags & TF_SACK_PERMIT) { in tcp_default_output()
861 else if (TCPS_HAVEESTABLISHED(tp->t_state) && in tcp_default_output()
862 tp->rcv_numsacks > 0) { in tcp_default_output()
864 to.to_nsacks = tp->rcv_numsacks; in tcp_default_output()
865 to.to_sacks = (u_char *)tp->sackblks; in tcp_default_output()
874 if (tp->t_flags & TF_SIGNATURE) in tcp_default_output()
884 if ((tp->t_flags & TF_FASTOPEN) && wanted_cookie && in tcp_default_output()
888 if (tp->t_port) { in tcp_default_output()
902 if (len + optlen + ipoptlen > tp->t_maxseg) { in tcp_default_output()
911 if_hw_tsomax = tp->t_tsomax; in tcp_default_output()
912 if_hw_tsomaxsegcount = tp->t_tsomaxsegcount; in tcp_default_output()
913 if_hw_tsomaxsegsize = tp->t_tsomaxsegsize; in tcp_default_output()
944 max_len = tp->t_maxseg - optlen - ipsec_optlen; in tcp_default_output()
971 if (tp->t_flags & TF_NEEDFIN) in tcp_default_output()
974 if (optlen + ipoptlen >= tp->t_maxseg) { in tcp_default_output()
988 len = tp->t_maxseg - optlen - ipoptlen; in tcp_default_output()
1024 if ((tp->t_flags & TF_FORCEDATA) && len == 1) { in tcp_default_output()
1027 if (SEQ_LT(tp->snd_nxt, tp->snd_max)) in tcp_default_output()
1028 stats_voi_update_abs_u32(tp->t_stats, in tcp_default_output()
1031 stats_voi_update_abs_u64(tp->t_stats, in tcp_default_output()
1034 } else if (SEQ_LT(tp->snd_nxt, tp->snd_max) || sack_rxmit) { in tcp_default_output()
1035 tp->t_sndrexmitpack++; in tcp_default_output()
1046 stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RETXPB, in tcp_default_output()
1053 stats_voi_update_abs_u64(tp->t_stats, VOI_TCP_TXPB, in tcp_default_output()
1082 if (SEQ_LT(tp->snd_nxt, tp->snd_max)) in tcp_default_output()
1088 if (SEQ_LT(tp->snd_nxt, tp->snd_max)) in tcp_default_output()
1098 if (len <= (tp->t_maxseg - optlen)) { in tcp_default_output()
1128 if (tp->t_flags & TF_ACKNOW) in tcp_default_output()
1132 else if (SEQ_GT(tp->snd_up, tp->snd_una)) in tcp_default_output()
1160 if (tp->t_port) { in tcp_default_output()
1163 udp->uh_dport = tp->t_port; in tcp_default_output()
1170 tcpip_fillheaders(inp, tp->t_port, ip6, th); in tcp_default_output()
1175 if (tp->t_port) { in tcp_default_output()
1178 udp->uh_dport = tp->t_port; in tcp_default_output()
1184 tcpip_fillheaders(inp, tp->t_port, ip, th); in tcp_default_output()
1192 if (flags & TH_FIN && tp->t_flags & TF_SENTFIN && in tcp_default_output()
1193 tp->snd_nxt == tp->snd_max) in tcp_default_output()
1194 tp->snd_nxt--; in tcp_default_output()
1201 if (tp->t_state == TCPS_SYN_SENT && V_tcp_do_ecn) { in tcp_default_output()
1202 flags |= tcp_ecn_output_syn_sent(tp); in tcp_default_output()
1205 if ((TCPS_HAVERCVDSYN(tp->t_state)) && in tcp_default_output()
1206 (tp->t_flags2 & (TF2_ECN_PERMIT | TF2_ACE_PERMIT))) { in tcp_default_output()
1207 int ect = tcp_ecn_output_established(tp, &flags, len, sack_rxmit); in tcp_default_output()
1208 if ((tp->t_state == TCPS_SYN_RECEIVED) && in tcp_default_output()
1209 (tp->t_flags2 & TF2_ECN_SND_ECE)) in tcp_default_output()
1210 tp->t_flags2 &= ~TF2_ECN_SND_ECE; in tcp_default_output()
1239 tcp_timer_active(tp, TT_PERSIST)) in tcp_default_output()
1240 th->th_seq = htonl(tp->snd_nxt); in tcp_default_output()
1242 th->th_seq = htonl(tp->snd_max); in tcp_default_output()
1252 if ((tp->t_flags & TF_LRD) && SEQ_GEQ(p->rxmit, p->end)) in tcp_default_output()
1253 p->rxmit = tp->snd_recover; in tcp_default_output()
1254 tp->sackhint.sack_bytes_rexmit += len; in tcp_default_output()
1256 if (IN_RECOVERY(tp->t_flags)) { in tcp_default_output()
1262 tp->sackhint.prr_out += len; in tcp_default_output()
1264 th->th_ack = htonl(tp->rcv_nxt); in tcp_default_output()
1278 recwin < tp->t_maxseg) in tcp_default_output()
1280 if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && in tcp_default_output()
1281 recwin < (tp->rcv_adv - tp->rcv_nxt)) in tcp_default_output()
1282 recwin = (tp->rcv_adv - tp->rcv_nxt); in tcp_default_output()
1294 recwin = roundup2(recwin, 1 << tp->rcv_scale); in tcp_default_output()
1295 th->th_win = htons((u_short)(recwin >> tp->rcv_scale)); in tcp_default_output()
1307 tp->t_sndzerowin++; in tcp_default_output()
1308 tp->t_flags |= TF_RXWIN0SENT; in tcp_default_output()
1310 tp->t_flags &= ~TF_RXWIN0SENT; in tcp_default_output()
1311 if (SEQ_GT(tp->snd_up, tp->snd_nxt)) { in tcp_default_output()
1312 th->th_urp = htons((u_short)(tp->snd_up - tp->snd_nxt)); in tcp_default_output()
1321 tp->snd_up = tp->snd_una; /* drag it along */ in tcp_default_output()
1356 if (tp->t_port) { in tcp_default_output()
1376 if (tp->t_port) { in tcp_default_output()
1402 KASSERT(len > tp->t_maxseg - optlen - ipsec_optlen, in tcp_default_output()
1405 m->m_pkthdr.tso_segsz = tp->t_maxseg - optlen - ipsec_optlen; in tcp_default_output()
1414 hhook_run_tcp_est_out(tp, th, &to, len, tso); in tcp_default_output()
1417 TCP_PROBE3(debug__output, tp, th, m); in tcp_default_output()
1422 if (tcp_bblogging_on(tp)) in tcp_default_output()
1423 lgb = tcp_log_event(tp, th, &so->so_rcv, &so->so_snd, in tcp_default_output()
1456 if (V_path_mtu_discovery && tp->t_maxseg > V_tcp_minmss) in tcp_default_output()
1457 tp->t_flags2 |= TF2_PLPMTU_PMTUD; in tcp_default_output()
1459 tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; in tcp_default_output()
1461 if (tp->t_state == TCPS_SYN_SENT) in tcp_default_output()
1462 TCP_PROBE5(connect__request, NULL, tp, ip6, tp, th); in tcp_default_output()
1464 TCP_PROBE5(send, NULL, tp, ip6, tp, th); in tcp_default_output()
1494 if (V_path_mtu_discovery && tp->t_maxseg > V_tcp_minmss) { in tcp_default_output()
1495 tp->t_flags2 |= TF2_PLPMTU_PMTUD; in tcp_default_output()
1496 if (tp->t_port == 0 || len < V_tcp_minmss) { in tcp_default_output()
1500 tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; in tcp_default_output()
1503 if (tp->t_state == TCPS_SYN_SENT) in tcp_default_output()
1504 TCP_PROBE5(connect__request, NULL, tp, ip, tp, th); in tcp_default_output()
1506 TCP_PROBE5(send, NULL, tp, ip, tp, th); in tcp_default_output()
1522 tcp_account_for_send(tp, len, (tp->snd_nxt != tp->snd_max), 0, hw_tls); in tcp_default_output()
1531 } else if ((tp->t_flags & TF_FORCEDATA) == 0 || in tcp_default_output()
1532 !tcp_timer_active(tp, TT_PERSIST)) { in tcp_default_output()
1533 tcp_seq startseq = tp->snd_nxt; in tcp_default_output()
1540 tp->snd_nxt++; in tcp_default_output()
1542 tp->snd_nxt++; in tcp_default_output()
1543 tp->t_flags |= TF_SENTFIN; in tcp_default_output()
1548 tp->snd_nxt += len; in tcp_default_output()
1549 if (SEQ_GT(tp->snd_nxt, tp->snd_max)) { in tcp_default_output()
1554 if (tp->snd_una == tp->snd_max) in tcp_default_output()
1555 tp->t_acktime = ticks; in tcp_default_output()
1556 tp->snd_max = tp->snd_nxt; in tcp_default_output()
1561 tp->t_sndtime = ticks; in tcp_default_output()
1562 if (tp->t_rtttime == 0) { in tcp_default_output()
1563 tp->t_rtttime = ticks; in tcp_default_output()
1564 tp->t_rtseq = startseq; in tcp_default_output()
1568 if (!(tp->t_flags & TF_GPUTINPROG) && len) { in tcp_default_output()
1569 tp->t_flags |= TF_GPUTINPROG; in tcp_default_output()
1570 tp->gput_seq = startseq; in tcp_default_output()
1571 tp->gput_ack = startseq + in tcp_default_output()
1573 tp->gput_ts = tcp_ts_getticks(); in tcp_default_output()
1587 if (!tcp_timer_active(tp, TT_REXMT) && in tcp_default_output()
1588 ((sack_rxmit && tp->snd_nxt != tp->snd_max) || in tcp_default_output()
1589 (tp->snd_nxt != tp->snd_una))) { in tcp_default_output()
1590 if (tcp_timer_active(tp, TT_PERSIST)) { in tcp_default_output()
1591 tcp_timer_activate(tp, TT_PERSIST, 0); in tcp_default_output()
1592 tp->t_rxtshift = 0; in tcp_default_output()
1594 tcp_timer_activate(tp, TT_REXMT, TP_RXTCUR(tp)); in tcp_default_output()
1596 !tcp_timer_active(tp, TT_REXMT) && in tcp_default_output()
1597 !tcp_timer_active(tp, TT_PERSIST)) { in tcp_default_output()
1617 tp->t_rxtshift = 0; in tcp_default_output()
1618 tcp_setpersist(tp); in tcp_default_output()
1630 tp->t_flags |= TF_SENTFIN; in tcp_default_output()
1632 if (SEQ_GT(tp->snd_nxt + xlen, tp->snd_max)) in tcp_default_output()
1633 tp->snd_max = tp->snd_nxt + xlen; in tcp_default_output()
1636 (tp->rcv_numsacks > 0) && in tcp_default_output()
1637 TCPS_HAVEESTABLISHED(tp->t_state) && in tcp_default_output()
1638 (tp->t_flags & TF_SACK_PERMIT)) { in tcp_default_output()
1640 tcp_clean_dsack_blocks(tp); in tcp_default_output()
1644 SEQ_LT(tp->snd_nxt, SEQ_MIN(p->rxmit, p->end))) { in tcp_default_output()
1649 tp->snd_nxt = SEQ_MIN(p->rxmit, p->end); in tcp_default_output()
1665 if (((tp->t_flags & TF_FORCEDATA) == 0 || in tcp_default_output()
1666 !tcp_timer_active(tp, TT_PERSIST)) && in tcp_default_output()
1671 tp->sackhint.sack_bytes_rexmit -= len; in tcp_default_output()
1672 KASSERT(tp->sackhint.sack_bytes_rexmit >= 0, in tcp_default_output()
1677 tp->snd_nxt -= len; in tcp_default_output()
1679 tp->snd_nxt--; in tcp_default_output()
1681 if (IN_RECOVERY(tp->t_flags)) in tcp_default_output()
1682 tp->sackhint.prr_out -= len; in tcp_default_output()
1688 tp->t_softerror = error; in tcp_default_output()
1691 TCP_XMIT_TIMER_ASSERT(tp, len, flags); in tcp_default_output()
1692 tp->snd_cwnd = tcp_maxseg(tp); in tcp_default_output()
1705 tp->t_flags &= ~TF_TSO; in tcp_default_output()
1707 tcp_mss_update(tp, -1, mtu, NULL, NULL); in tcp_default_output()
1715 if (TCPS_HAVERCVDSYN(tp->t_state)) { in tcp_default_output()
1716 tp->t_softerror = error; in tcp_default_output()
1732 if (SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv)) in tcp_default_output()
1733 tp->rcv_adv = tp->rcv_nxt + recwin; in tcp_default_output()
1734 tp->last_ack_sent = tp->rcv_nxt; in tcp_default_output()
1735 tp->t_flags &= ~(TF_ACKNOW | TF_DELACK); in tcp_default_output()
1736 if (tcp_timer_active(tp, TT_DELACK)) in tcp_default_output()
1737 tcp_timer_activate(tp, TT_DELACK, 0); in tcp_default_output()
1744 tcp_setpersist(struct tcpcb *tp) in tcp_setpersist() argument
1746 int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1; in tcp_setpersist()
1750 tp->t_flags &= ~TF_PREVVALID; in tcp_setpersist()
1751 if (tcp_timer_active(tp, TT_REXMT)) in tcp_setpersist()
1756 if (tp->t_state == TCPS_CLOSED) in tcp_setpersist()
1762 TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], in tcp_setpersist()
1764 if (TP_MAXUNACKTIME(tp) && tp->t_acktime) { in tcp_setpersist()
1765 maxunacktime = tp->t_acktime + TP_MAXUNACKTIME(tp) - ticks; in tcp_setpersist()
1771 tcp_timer_activate(tp, TT_PERSIST, tt); in tcp_setpersist()
1772 if (tp->t_rxtshift < V_tcp_retries) in tcp_setpersist()
1773 tp->t_rxtshift++; in tcp_setpersist()
2123 tcp_sndbuf_autoscale(struct tcpcb *tp, struct socket *so, uint32_t sendwin) in tcp_sndbuf_autoscale() argument
2167 if ((tp->snd_wnd / 4 * 5) >= so->so_snd.sb_hiwat - lowat && in tcp_sndbuf_autoscale()
2172 (tp->snd_nxt - tp->snd_una))) { in tcp_sndbuf_autoscale()