* Partial ack handling within a sack recovery episode. Keeping this very * simple for now. When a partial ack is received, force snd_cwnd to a value * that will allow the sender to transmit no more than 2 segments. If * necessary, a better scheme can be adopted at a later point, but for now, * the goal is to prevent the sender from bursting a large amount of data in * the midst of sack rec
| 784 | * the midst of sack recovery. |
| 785 | */ |
| 786 | void |
| 787 | tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th) |
| 788 | { |
| 789 | int num_segs = 1; |
| 790 | u_int maxseg = tcp_maxseg(tp); |
| 791 | |
| 792 | INP_WLOCK_ASSERT(tp->t_inpcb); |
| 793 | tcp_timer_activate(tp, TT_REXMT, 0); |
| 794 | tp->t_rtttime = 0; |
| 795 | /* Send one or 2 segments based on how much new data was acked. */ |
| 796 | if ((BYTES_THIS_ACK(tp, th) / maxseg) >= 2) |
| 797 | num_segs = 2; |
| 798 | tp->snd_cwnd = (tp->sackhint.sack_bytes_rexmit + |
| 799 | (tp->snd_nxt - tp->snd_recover) + num_segs * maxseg); |
| 800 | if (tp->snd_cwnd > tp->snd_ssthresh) |
| 801 | tp->snd_cwnd = tp->snd_ssthresh; |
| 802 | tp->t_flags |= TF_ACKNOW; |
| 803 | (void) tp->t_fb->tfb_tcp_output(tp); |
| 804 | } |
| 805 | |
| 806 | #if 0 |
| 807 | /* |
no test coverage detected