Lines Matching refs: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 = th->th_ack - tp->snd_una;
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 = th->th_ack - tp->snd_una;
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;
306 if (ss < (int32_t)tp->snd_ssthresh)
307 tp->snd_cwnd = ss + tp->t_maxseg;
309 tp->snd_cwnd = tp->snd_ssthresh;
310 tp->t_bytes_acked = 0;
317 tcp_newreno_after_timeout(struct tcpcb *tp) {
342 if (tp->t_state >= TCPS_ESTABLISHED) {
343 u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg;
346 tp->snd_cwnd = tp->t_maxseg;
347 tp->snd_ssthresh = win * tp->t_maxseg;
348 tp->t_bytes_acked = 0;
349 tp->t_dupacks = 0;
351 tcp_cc_resize_sndbuf(tp);
375 tcp_newreno_delay_ack(struct tcpcb *tp, struct tcphdr *th) {
379 if ((tp->t_flags & TF_RXWIN0SENT) == 0 &&
381 (tp->t_unacksegs == 1))
385 if ((tp->t_flags & TF_RXWIN0SENT) == 0 &&
387 ((tp->t_unacksegs == 1) ||
388 ((tp->t_flags & TF_STRETCHACK) != 0 &&
389 tp->t_unacksegs < (maxseg_unacked))))
403 tcp_newreno_switch_cc(struct tcpcb *tp, uint16_t old_index) {
406 uint32_t cwnd = min(tp->snd_wnd, tp->snd_cwnd);
407 if (tp->snd_cwnd >= tp->snd_ssthresh) {
408 cwnd = cwnd / tp->t_maxseg;
410 cwnd = cwnd / 2 / tp->t_maxseg;
414 tp->snd_cwnd = cwnd * tp->t_maxseg;
417 tp->t_bytes_acked = 0;