| 3919 | } |
| 3920 | |
| 3921 | void |
| 3922 | tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) |
| 3923 | { |
| 3924 | int snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; |
| 3925 | int maxseg = tcp_maxseg(tp); |
| 3926 | |
| 3927 | INP_WLOCK_ASSERT(tp->t_inpcb); |
| 3928 | |
| 3929 | tcp_timer_activate(tp, TT_REXMT, 0); |
| 3930 | tp->t_rtttime = 0; |
| 3931 | /* |
| 3932 | * Compute the amount of data that this ACK is indicating |
| 3933 | * (del_data) and an estimate of how many bytes are in the |
| 3934 | * network. |
| 3935 | */ |
| 3936 | del_data = tp->sackhint.delivered_data; |
| 3937 | if (V_tcp_do_rfc6675_pipe) |
| 3938 | pipe = tcp_compute_pipe(tp); |
| 3939 | else |
| 3940 | pipe = (tp->snd_nxt - tp->snd_fack) + tp->sackhint.sack_bytes_rexmit; |
| 3941 | tp->sackhint.prr_delivered += del_data; |
| 3942 | /* |
| 3943 | * Proportional Rate Reduction |
| 3944 | */ |
| 3945 | if (pipe >= tp->snd_ssthresh) { |
| 3946 | if (tp->sackhint.recover_fs == 0) |
| 3947 | tp->sackhint.recover_fs = |
| 3948 | imax(1, tp->snd_nxt - tp->snd_una); |
| 3949 | snd_cnt = howmany((long)tp->sackhint.prr_delivered * |
| 3950 | tp->snd_ssthresh, tp->sackhint.recover_fs) - |
| 3951 | tp->sackhint.prr_out; |
| 3952 | } else { |
| 3953 | if (V_tcp_do_prr_conservative) |
| 3954 | limit = tp->sackhint.prr_delivered - |
| 3955 | tp->sackhint.prr_out; |
| 3956 | else |
| 3957 | limit = imax(tp->sackhint.prr_delivered - |
| 3958 | tp->sackhint.prr_out, del_data) + |
| 3959 | maxseg; |
| 3960 | snd_cnt = imin((tp->snd_ssthresh - pipe), limit); |
| 3961 | } |
| 3962 | snd_cnt = imax(snd_cnt, 0) / maxseg; |
| 3963 | /* |
| 3964 | * Send snd_cnt new data into the network in response to this ack. |
| 3965 | * If there is going to be a SACK retransmission, adjust snd_cwnd |
| 3966 | * accordingly. |
| 3967 | */ |
| 3968 | tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + |
| 3969 | tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); |
| 3970 | tp->t_flags |= TF_ACKNOW; |
| 3971 | (void) tcp_output(tp); |
| 3972 | } |
| 3973 | |
| 3974 | /* |
| 3975 | * On a partial ack arrives, force the retransmission of the |
no test coverage detected