Lines Matching +full:half +full:- +full:period

22     /* Unflushed state during multiple on-loss calls. */
55 nr->now_cb = now_cb; in newreno_new()
56 nr->now_cb_arg = now_cb_arg; in newreno_new()
73 int is_reduced = (max_dgram_size < nr->max_dgram_size); in newreno_set_max_dgram_size()
75 nr->max_dgram_size = max_dgram_size; in newreno_set_max_dgram_size()
81 nr->k_init_wnd = 10 * max_dgram_size; in newreno_set_max_dgram_size()
82 if (nr->k_init_wnd > max_init_wnd) in newreno_set_max_dgram_size()
83 nr->k_init_wnd = max_init_wnd; in newreno_set_max_dgram_size()
85 nr->k_min_wnd = 2 * max_dgram_size; in newreno_set_max_dgram_size()
88 nr->cong_wnd = nr->k_init_wnd; in newreno_set_max_dgram_size()
97 nr->k_loss_reduction_factor_num = 1; in newreno_reset()
98 nr->k_loss_reduction_factor_den = 2; in newreno_reset()
99 nr->persistent_cong_thresh = 3; in newreno_reset()
101 nr->cong_wnd = nr->k_init_wnd; in newreno_reset()
102 nr->bytes_in_flight = 0; in newreno_reset()
103 nr->bytes_acked = 0; in newreno_reset()
104 nr->slow_start_thresh = UINT64_MAX; in newreno_reset()
105 nr->cong_recovery_start_time = ossl_time_zero(); in newreno_reset()
107 nr->processing_loss = 0; in newreno_reset()
108 nr->tx_time_of_last_loss = ossl_time_zero(); in newreno_reset()
109 nr->in_congestion_recovery = 0; in newreno_reset()
141 if (p->data_type != OSSL_PARAM_UNSIGNED_INTEGER in bind_diag()
142 || p->data_size != len) in bind_diag()
145 *pp = p->data; in bind_diag()
171 nr->p_diag_max_dgram_payload_len = new_p_max_dgram_payload_len; in newreno_bind_diagnostic()
174 nr->p_diag_cur_cwnd_size = new_p_cur_cwnd_size; in newreno_bind_diagnostic()
177 nr->p_diag_min_cwnd_size = new_p_min_cwnd_size; in newreno_bind_diagnostic()
180 nr->p_diag_cur_bytes_in_flight = new_p_cur_bytes_in_flight; in newreno_bind_diagnostic()
183 nr->p_diag_cur_state = new_p_cur_state; in newreno_bind_diagnostic()
203 (void **)&nr->p_diag_max_dgram_payload_len); in newreno_unbind_diagnostic()
205 (void **)&nr->p_diag_cur_cwnd_size); in newreno_unbind_diagnostic()
207 (void **)&nr->p_diag_min_cwnd_size); in newreno_unbind_diagnostic()
209 (void **)&nr->p_diag_cur_bytes_in_flight); in newreno_unbind_diagnostic()
211 (void **)&nr->p_diag_cur_state); in newreno_unbind_diagnostic()
217 if (nr->p_diag_max_dgram_payload_len != NULL) in newreno_update_diag()
218 *nr->p_diag_max_dgram_payload_len = nr->max_dgram_size; in newreno_update_diag()
220 if (nr->p_diag_cur_cwnd_size != NULL) in newreno_update_diag()
221 *nr->p_diag_cur_cwnd_size = nr->cong_wnd; in newreno_update_diag()
223 if (nr->p_diag_min_cwnd_size != NULL) in newreno_update_diag()
224 *nr->p_diag_min_cwnd_size = nr->k_min_wnd; in newreno_update_diag()
226 if (nr->p_diag_cur_bytes_in_flight != NULL) in newreno_update_diag()
227 *nr->p_diag_cur_bytes_in_flight = nr->bytes_in_flight; in newreno_update_diag()
229 if (nr->p_diag_cur_state != NULL) { in newreno_update_diag()
230 if (nr->in_congestion_recovery) in newreno_update_diag()
231 *nr->p_diag_cur_state = 'R'; in newreno_update_diag()
232 else if (nr->cong_wnd < nr->slow_start_thresh) in newreno_update_diag()
233 *nr->p_diag_cur_state = 'S'; in newreno_update_diag()
235 *nr->p_diag_cur_state = 'A'; in newreno_update_diag()
241 return ossl_time_compare(tx_time, nr->cong_recovery_start_time) <= 0; in newreno_in_cong_recovery()
248 /* No reaction if already in a recovery period. */ in newreno_cong()
252 /* Start a new recovery period. */ in newreno_cong()
253 nr->in_congestion_recovery = 1; in newreno_cong()
254 nr->cong_recovery_start_time = nr->now_cb(nr->now_cb_arg); in newreno_cong()
257 nr->slow_start_thresh in newreno_cong()
258 = safe_muldiv_u64(nr->cong_wnd, in newreno_cong()
259 nr->k_loss_reduction_factor_num, in newreno_cong()
260 nr->k_loss_reduction_factor_den, in newreno_cong()
264 nr->slow_start_thresh = UINT64_MAX; in newreno_cong()
266 nr->cong_wnd = nr->slow_start_thresh; in newreno_cong()
267 if (nr->cong_wnd < nr->k_min_wnd) in newreno_cong()
268 nr->cong_wnd = nr->k_min_wnd; in newreno_cong()
273 if (!nr->processing_loss) in newreno_flush()
276 newreno_cong(nr, nr->tx_time_of_last_loss); in newreno_flush()
279 nr->cong_wnd = nr->k_min_wnd; in newreno_flush()
280 nr->cong_recovery_start_time = ossl_time_zero(); in newreno_flush()
283 nr->processing_loss = 0; in newreno_flush()
291 if (nr->bytes_in_flight >= nr->cong_wnd) in newreno_get_tx_allowance()
294 return nr->cong_wnd - nr->bytes_in_flight; in newreno_get_tx_allowance()
315 nr->bytes_in_flight += num_bytes; in newreno_on_data_sent()
324 /* We are congestion-limited if we are already at the congestion window. */ in newreno_is_cong_limited()
325 if (nr->bytes_in_flight >= nr->cong_wnd) in newreno_is_cong_limited()
328 wnd_rem = nr->cong_wnd - nr->bytes_in_flight; in newreno_is_cong_limited()
331 * Consider ourselves congestion-limited if less than three datagrams' worth in newreno_is_cong_limited()
333 * have consumed half of our window. in newreno_is_cong_limited()
335 return (nr->cong_wnd < nr->slow_start_thresh && wnd_rem <= nr->cong_wnd / 2) in newreno_is_cong_limited()
336 || wnd_rem <= 3 * nr->max_dgram_size; in newreno_is_cong_limited()
348 nr->bytes_in_flight -= info->tx_size; in newreno_on_data_acked()
367 * - Congestion Recovery: Do nothing. We don't start increasing in newreno_on_data_acked()
371 * - Slow Start: Increase the congestion window using the slow in newreno_on_data_acked()
374 * - Congestion Avoidance: Increase the congestion window using in newreno_on_data_acked()
377 if (newreno_in_cong_recovery(nr, info->tx_time)) { in newreno_on_data_acked()
379 } else if (nr->cong_wnd < nr->slow_start_thresh) { in newreno_on_data_acked()
381 nr->cong_wnd += info->tx_size; in newreno_on_data_acked()
382 nr->in_congestion_recovery = 0; in newreno_on_data_acked()
385 nr->bytes_acked += info->tx_size; in newreno_on_data_acked()
390 if (nr->bytes_acked >= nr->cong_wnd) { in newreno_on_data_acked()
391 nr->bytes_acked -= nr->cong_wnd; in newreno_on_data_acked()
392 nr->cong_wnd += nr->max_dgram_size; in newreno_on_data_acked()
395 nr->in_congestion_recovery = 0; in newreno_on_data_acked()
408 if (info->tx_size > nr->bytes_in_flight) in newreno_on_data_lost()
411 nr->bytes_in_flight -= info->tx_size; in newreno_on_data_lost()
413 if (!nr->processing_loss) { in newreno_on_data_lost()
415 if (ossl_time_compare(info->tx_time, nr->tx_time_of_last_loss) <= 0) in newreno_on_data_lost()
424 nr->processing_loss = 1; in newreno_on_data_lost()
429 nr->bytes_acked = 0; in newreno_on_data_lost()
432 nr->tx_time_of_last_loss in newreno_on_data_lost()
433 = ossl_time_max(nr->tx_time_of_last_loss, info->tx_time); in newreno_on_data_lost()
453 nr->bytes_in_flight -= num_bytes; in newreno_on_data_invalidated()
463 nr->processing_loss = 1; in newreno_on_ecn()
464 nr->bytes_acked = 0; in newreno_on_ecn()
465 nr->tx_time_of_last_loss = info->largest_acked_time; in newreno_on_ecn()