Lines Matching defs:tp

86 int tcp_newreno_init(struct tcpcb *tp);
87 int tcp_newreno_cleanup(struct tcpcb *tp);
88 void tcp_newreno_cwnd_init_or_reset(struct tcpcb *tp);
89 void tcp_newreno_inseq_ack_rcvd(struct tcpcb *tp, struct tcphdr *th);
90 void tcp_newreno_ack_rcvd(struct tcpcb *tp, struct tcphdr *th);
91 void tcp_newreno_pre_fr(struct tcpcb *tp);
92 void tcp_newreno_post_fr(struct tcpcb *tp, struct tcphdr *th);
93 void tcp_newreno_after_idle(struct tcpcb *tp);
94 void tcp_newreno_after_timeout(struct tcpcb *tp);
95 int tcp_newreno_delay_ack(struct tcpcb *tp, struct tcphdr *th);
96 void tcp_newreno_switch_cc(struct tcpcb *tp, uint16_t old_index);
119 sndsb->sb_idealsize = min(max(tcp_sendspace, tp->snd_ssthresh), \
122 void tcp_cc_resize_sndbuf(struct tcpcb *tp) {
128 sb = &(tp->t_inpcb->inp_socket->so_snd);
129 if (sb->sb_hiwat > tp->snd_ssthresh &&
131 if (sb->sb_idealsize > tp->snd_ssthresh) {
132 SET_SNDSB_IDEAL_SIZE(sb, tp->snd_ssthresh);
138 void tcp_bad_rexmt_fix_sndbuf(struct tcpcb *tp) {
140 sb = &(tp->t_inpcb->inp_socket->so_snd);
146 SET_SNDSB_IDEAL_SIZE(sb, tp->snd_ssthresh);
154 int tcp_newreno_init(struct tcpcb *tp) {
155 #pragma unused(tp)
160 int tcp_newreno_cleanup(struct tcpcb *tp) {
161 #pragma unused(tp)
176 tcp_newreno_cwnd_init_or_reset(struct tcpcb *tp) {
177 if ( tp->t_flags & TF_LOCAL )
178 tp->snd_cwnd = tp->t_maxseg * ss_fltsz_local;
188 tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380));
191 tp->snd_cwnd = tp->t_maxseg * ss_fltsz;
200 tcp_newreno_inseq_ack_rcvd(struct tcpcb *tp, struct tcphdr *th) {
202 acked = BYTES_ACKED(th, tp);
207 if (tp->snd_cwnd < tp->snd_wnd) {
208 tp->t_bytes_acked += acked;
209 if (tp->t_bytes_acked > tp->snd_cwnd) {
210 tp->t_bytes_acked -= tp->snd_cwnd;
211 tp->snd_cwnd += tp->t_maxseg;
218 tcp_newreno_ack_rcvd(struct tcpcb *tp, struct tcphdr *th) {
232 register u_int cw = tp->snd_cwnd;
233 register u_int incr = tp->t_maxseg;
236 acked = BYTES_ACKED(th, tp);
239 if (cw >= tp->snd_ssthresh) {
240 tp->t_bytes_acked += acked;
241 if (tp->t_bytes_acked >= cw) {
243 tp->t_bytes_acked -= cw;
259 tp->snd_nxt == tp->snd_max) ? incr * 2 : incr;
271 if (cw >= tp->snd_ssthresh)
274 tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<<tp->snd_scale);
278 tcp_newreno_pre_fr(struct tcpcb *tp) {
282 win = min(tp->snd_wnd, tp->snd_cwnd) /
283 2 / tp->t_maxseg;
286 tp->snd_ssthresh = win * tp->t_maxseg;
287 tcp_cc_resize_sndbuf(tp);
292 tcp_newreno_post_fr(struct tcpcb *tp, struct tcphdr *th) {
295 ss = tp->snd_max - th->th_ack;
310 if (ss < (int32_t)tp->snd_ssthresh)
311 tp->snd_cwnd = max(ss, tp->t_maxseg) + tp->t_maxseg;
313 tp->snd_cwnd = tp->snd_ssthresh;
314 tp->t_bytes_acked = 0;
321 tcp_newreno_after_timeout(struct tcpcb *tp) {
346 if (tp->t_state >= TCPS_ESTABLISHED) {
347 u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg;
350 tp->snd_ssthresh = win * tp->t_maxseg;
352 tp->snd_cwnd = tp->t_maxseg;
353 tcp_cc_resize_sndbuf(tp);
377 tcp_newreno_delay_ack(struct tcpcb *tp, struct tcphdr *th) {
380 tp->t_flagsext |= TF_STREAMEOW;
382 tp->t_flagsext &= ~(TF_STREAMEOW);
387 if ((tp->t_flags & TF_RXWIN0SENT) == 0 &&
389 (tp->t_unacksegs == 1))
393 if ((tp->t_flags & TF_RXWIN0SENT) == 0 &&
395 ((tp->t_unacksegs == 1) ||
396 ((tp->t_flags & TF_STRETCHACK) != 0 &&
397 tp->t_unacksegs < (maxseg_unacked))))
411 tcp_newreno_switch_cc(struct tcpcb *tp, uint16_t old_index) {
414 uint32_t cwnd = min(tp->snd_wnd, tp->snd_cwnd);
415 if (tp->snd_cwnd >= tp->snd_ssthresh) {
416 cwnd = cwnd / tp->t_maxseg;
418 cwnd = cwnd / 2 / tp->t_maxseg;
422 tp->snd_cwnd = cwnd * tp->t_maxseg;
425 tp->t_bytes_acked = 0;