Lines Matching refs:tp

130 tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_start, tcp_seq rcv_end)
151 for (i = 0; i < tp->rcv_numsacks; i++) {
152 tcp_seq start = tp->sackblks[i].start;
153 tcp_seq end = tp->sackblks[i].end;
154 if (SEQ_GEQ(start, end) || SEQ_LEQ(start, tp->rcv_nxt)) {
179 * Update SACK list in tp->sackblks[].
182 if (SEQ_GT(head_blk.start, tp->rcv_nxt)) {
187 tp->sackblks[0] = head_blk;
200 bcopy(saved_blks, &tp->sackblks[num_head],
205 tp->rcv_numsacks = num_head + num_saved;
211 if ((tp->t_flags & TF_STRETCHACK) != 0 && tp->rcv_numsacks > 0)
212 tcp_reset_stretch_ack(tp);
215 if (tp->acc_iaj > 0 && tp->rcv_numsacks > 0)
216 reset_acc_iaj(tp);
224 tcp_clean_sackreport( struct tcpcb *tp)
227 tp->rcv_numsacks = 0;
228 bzero(&tp->sackblks[0], sizeof (struct sackblk) * MAX_SACK_BLKS);
235 tcp_sackhole_alloc(struct tcpcb *tp, tcp_seq start, tcp_seq end)
239 if (tp->snd_numholes >= tcp_sack_maxholes ||
253 tp->snd_numholes++;
263 tcp_sackhole_free(struct tcpcb *tp, struct sackhole *hole)
267 tp->snd_numholes--;
275 tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end,
281 hole = tcp_sackhole_alloc(tp, start, end);
287 TAILQ_INSERT_AFTER(&tp->snd_holes, after, hole, scblink);
289 TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink);
292 if (tp->sackhint.nexthole == NULL)
293 tp->sackhint.nexthole = hole;
302 tcp_sackhole_remove(struct tcpcb *tp, struct sackhole *hole)
305 if (tp->sackhint.nexthole == hole)
306 tp->sackhint.nexthole = TAILQ_NEXT(hole, scblink);
309 TAILQ_REMOVE(&tp->snd_holes, hole, scblink);
312 tcp_sackhole_free(tp, hole);
317 * tp->snd_holes is an ordered list of holes (oldest to newest, in terms of
321 tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack)
332 if (SEQ_LT(tp->snd_una, th_ack) && !TAILQ_EMPTY(&tp->snd_holes)) {
333 sack_blocks[num_sack_blks].start = tp->snd_una;
346 SEQ_GT(sack.start, tp->snd_una) &&
348 SEQ_LT(sack.start, tp->snd_max) &&
349 SEQ_GT(sack.end, tp->snd_una) &&
350 SEQ_LEQ(sack.end, tp->snd_max))
375 if (TAILQ_EMPTY(&tp->snd_holes))
382 tp->snd_fack = SEQ_MAX(tp->snd_una, th_ack);
395 if (SEQ_LT(tp->snd_fack, sblkp->start)) {
403 temp = tcp_sackhole_insert(tp, tp->snd_fack,sblkp->start,NULL);
405 tp->snd_fack = sblkp->end;
418 SEQ_LT(tp->snd_fack, sblkp->start))
421 SEQ_LT(tp->snd_fack, sblkp->end))
422 tp->snd_fack = sblkp->end;
424 } else if (SEQ_LT(tp->snd_fack, sblkp->end))
426 tp->snd_fack = sblkp->end;
428 cur = TAILQ_LAST(&tp->snd_holes, sackhole_head); /* Last SACK hole */
450 tp->sackhint.sack_bytes_rexmit -= (cur->rxmit - cur->start);
457 tcp_sackhole_remove(tp, temp);
479 temp = tcp_sackhole_insert(tp, sblkp->end,
484 tp->sackhint.sack_bytes_rexmit
494 tp->sackhint.sack_bytes_rexmit += (cur->rxmit - cur->start);
511 tcp_free_sackholes(struct tcpcb *tp)
515 while ((q = TAILQ_FIRST(&tp->snd_holes)) != NULL)
516 tcp_sackhole_remove(tp, q);
517 tp->sackhint.sack_bytes_rexmit = 0;
518 tp->sackhint.nexthole = NULL;
519 tp->sack_newdata = 0;
534 tcp_sack_partialack(tp, th)
535 struct tcpcb *tp;
540 tp->t_timer[TCPT_REXMT] = 0;
541 tp->t_rtttime = 0;
543 if (((th->th_ack - tp->snd_una) / tp->t_maxseg) > 2)
545 tp->snd_cwnd = (tp->sackhint.sack_bytes_rexmit +
546 (tp->snd_nxt - tp->sack_newdata) +
547 num_segs * tp->t_maxseg);
548 if (tp->snd_cwnd > tp->snd_ssthresh)
549 tp->snd_cwnd = tp->snd_ssthresh;
550 tp->t_flags |= TF_ACKNOW;
551 (void) tcp_output(tp);
559 tcp_sack_output_debug(struct tcpcb *tp, int *sack_bytes_rexmt)
564 TAILQ_FOREACH(p, &tp->snd_holes, scblink) {
566 if (SEQ_LT(p->rxmit, tp->snd_una)) {/* old SACK hole */
595 tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt)
600 dbg_hole = tcp_sack_output_debug(tp, &dbg_bytes_rexmt);
601 *sack_bytes_rexmt = tp->sackhint.sack_bytes_rexmit;
602 hole = tp->sackhint.nexthole;
607 tp->sackhint.nexthole = hole;
631 tcp_sack_adjust(struct tcpcb *tp)
633 struct sackhole *p, *cur = TAILQ_FIRST(&tp->snd_holes);
637 if (SEQ_GEQ(tp->snd_nxt, tp->snd_fack))
645 if (SEQ_LT(tp->snd_nxt, cur->end))
647 if (SEQ_GEQ(tp->snd_nxt, p->start))
650 tp->snd_nxt = p->start;
654 if (SEQ_LT(tp->snd_nxt, cur->end))
656 tp->snd_nxt = tp->snd_fack;